[L4D2] Get Ghost Spawntime
Hello all,
I'm new in Sourcemod Scripting so I'm sorry for this noob question. I'm trying to get the ghost spawntime and excute some code if clients spawntime is under 4 seconds. Here is my code: PHP Code:
|
Re: [L4D2] Get Ghost Spawntime
Code:
new spawntime = GetEventFloat(event,"spawntime"); Code:
if (IsHumanPlayer(client) && IsPlayerGhost && GetClientTeam(client) == 3 && spawntime < 4) Code:
if (client > 0 && client <= MaxClients && IsClientInGame(client) && !IsFakeClient(client) && GetClientTeam(client) == 3 && spawntime < 4.0) |
Re: [L4D2] Get Ghost Spawntime
Thank you,
I tried that: PHP Code:
|
Re: [L4D2] Get Ghost Spawntime
I don't know much about how this event works, but maybe it fires only once when the player becomes ghost.
Anyway try like this: PHP Code:
|
Re: [L4D2] Get Ghost Spawntime
I went ahead and actually tested it and found another issue. onPluginStart needs to be OnPluginStart or else it won't fire.
Also, as Marttt mentioned, the event only fires once when you become a ghost. So if you spawn in and your spawntime isn't less than 4s it won't work. Testing alone worked for me, because I was getting a 3s respawn time but I know with more people the respawn time will be higher. This is the full code I tested and it worked: Code:
#include <sourcemod> |
Re: [L4D2] Get Ghost Spawntime
this sounds like an anticheat detection method could you maybe put this in sourcemod anticheat??
|
Re: [L4D2] Get Ghost Spawntime
Quote:
|
Re: [L4D2] Get Ghost Spawntime
is no one gonna suggest this code be added to some kind of anticheat system I keep running into this problem even on valves stupid official servers
|
Re: [L4D2] Get Ghost Spawntime
@canadianjeff
Probably the help he asked for is not for some kind of anti-cheat, maybe its just a warning to the player that he will spawn in "4" seconds, or do some kick/slay if it doesn't move, for example, if you have issues with this, I recommend opening a new thread in the forum asking for help, instead using this one. |
All times are GMT -4. The time now is 23:53. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.