[ES>SP] Port Possible?
-
- Junior Member
- Posts: 2
- Joined: Wed Jul 23, 2014 4:43 pm
At first glance that looks correct. I should note to both of you that you can use [python][/python] to create proper syntax blocks:
http://www.sourcepython.com/showthread.php?527-Syntax-Highlighting-is-back!!!
For the SayText2 example, you might also consider:
Also, VOL_NORM is the default value for the volume, so you don't really need to provide that argument if using the default.
http://www.sourcepython.com/showthread.php?527-Syntax-Highlighting-is-back!!!
For the SayText2 example, you might also consider:
Syntax: Select all
current_leader = SayText2(message='\x06$name\x04 is the actual leader with\x06 $kills\x04 kills.')
new_leader = SayText2(message='\x06$name\x04 has taken the leadership!')
# Then, when sending:
current_leader.tokens = {'name': leader.name, 'kills': players[leader]}
current_leader.send()
new_leader.tokens = {'name': attacker.name}
new_leader.send()
Also, VOL_NORM is the default value for the volume, so you don't really need to provide that argument if using the default.
Didn't realise python highlighting was enabled, but cool.
Um, is there a problem in the SayText2 function with using variables? I only found this in CSGO. But if you use a variable to define "message" in SayText2 then colours are not displayed. It just displays the text as actual text, with no replacement of the colours. It works in CSS but only gives this outcome in CSGO.
e.g
Um, is there a problem in the SayText2 function with using variables? I only found this in CSGO. But if you use a variable to define "message" in SayText2 then colours are not displayed. It just displays the text as actual text, with no replacement of the colours. It works in CSS but only gives this outcome in CSGO.
e.g
Syntax: Select all
text = '\x06Test \x04Test'
SayText2(message=text).send()
-
- Junior Member
- Posts: 2
- Joined: Wed Jul 23, 2014 4:43 pm
I tested this now on my server but I get many errors.
http://prntscr.com/45weg7
Did I made something wrong?
http://prntscr.com/45weg7
Did I made something wrong?
- L'In20Cible
- Project Leader
- Posts: 1536
- Joined: Sat Jul 14, 2012 9:29 pm
- Location: Québec
You don't need to precache sounds if you are using the Sound class. It will take care of it for you. 
https://github.com/Source-Python-Dev-Team/Source.Python/blob/master/addons/source-python/packages/source-python/engines/sound.py#L140

https://github.com/Source-Python-Dev-Team/Source.Python/blob/master/addons/source-python/packages/source-python/engines/sound.py#L140
No, you need. EngineSound.is_sound_precached don't workAyuto wrote:You don't need to precache sounds if you are using the Sound class. It will take care of it for you.
https://github.com/Source-Python-Dev-Team/Source.Python/blob/master/addons/source-python/packages/source-python/engines/sound.py#L140


Maybe I'm wrong but it can be an engine bug...
In case you missed it, he wants this ported to cs:go, and yes it will crash 100%.
Also for the precache, it doesn't seem like the sound classs takes care of it.
If i don't precache it with the .precache() method i'm getting a "is not precached" error in the console when playing.
Where as if i do use the method i am not getting the error. Therefor it clearly makes a difference.
Also for the precache, it doesn't seem like the sound classs takes care of it.
If i don't precache it with the .precache() method i'm getting a "is not precached" error in the console when playing.
Where as if i do use the method i am not getting the error. Therefor it clearly makes a difference.
If you look at Ayuto's link, you will see that the Sound class does indeed precache the sound. However, if is_precached always returns True, it will skip precaching. I will have to do some tests later to find out what is happening with that. We have noticed that PlayerInfo.is_player always seems to return True, as well.
- L'In20Cible
- Project Leader
- Posts: 1536
- Joined: Sat Jul 14, 2012 9:29 pm
- Location: Québec
PlayerEntity.isdead will returns True when you are spectating while PlayerEntity.pl.deadflag will returns 1 when your player is actually dead. This is not an issue with the plugin itself but how VALVe named things behind.Hedgehog wrote:As I remember PlayerEntity.isdead had same problem some time ago... Not sure about now![]()
Then the best way is probably to check if the sample is contained into the "soundprecache" string table.Hedgehog wrote:By the way, is_precached don't work on CS:S windows server (don't know about other one).
Just a heads up, in case anyone has not been paying attention to the repository, but is_precached has been updated to use the stringtable for soundprecache, as L'In20Cible has suggested. There has not been a new release with that available, but you can get it by cloning the repository, building the core yourself, and uploading the necessary files to your server.
Return to “Plugin Development Support”
Who is online
Users browsing this forum: No registered users and 85 guests