22.02.2013, 21:24
Quote:
|
The current one isn't directly 'bugged', but doesn't function the way you want to either. Your GetPlayerID function is still fucked, as it selects ONE random number out of 500 (MAX_PLAYERS), and if that ID is not connected it'll default to '-0' (which is still 0). I'm pretty sure that most of the time the script will then use player ID 0, considering most servers barely have 50 players. Also, just because a server has players, it doesn't mean someone has to be using player id 0. I'd write your GetPlayerID function as following:
pawn Код:
Last, your OnFilterScriptExit code lacks. timer[0] will always contain the right value as it's a repeating timer, but the timer assigned to timer[1] is run only once, before a new cow is spawned again. If someone was to create a new timer in the interval between destroying the cow and spawning a new one, the timer could easily get assign the same ID that's in your timer[1] variable. You should check if timer[1] is actually running when you exit the filterscript, and if so, it should kill the cow as well (Because if you unload the script right now the cow will still remain an active object!) |
Although I wasn't expecting this filterscript to get any posts. Neither do I expect many people to use it! As i said it's a useless filterscript I scripted at half one in the morning last night because I was bored.


