03.08.2013, 16:15
(
Последний раз редактировалось dr1ftp0w3r; 03.08.2013 в 16:53.
)
Hello there.
I'm getting a lot of this by CrashDetect:
(every single second)
And after some hours, server gets frozen and no one can join, I mean, they can, but gamemode doesn't load.
I checked htop(proccess monitor for linux) and one of the cpu cores was 100% which is odd, so I believe it's due to this.
I tried that first IF but it didn't work at all, I was using this page https://sampwiki.blast.hk/wiki/GetPlayerTargetPlayer
Basically this checks if a player tries to spawn weapons outside the DM Zones and if shoots at stunters then he gets killed.
I hope someone can help me, thank you for reading.
EDT: Fixed, thanks to Niko_boy and [Comrade]Garsino. Also thanks for telling me about OnPlayerTakeDamage.
PS. way to fix was to check targetplayer != INVALID_PLAYER_ID before DM[targetplayer] == 0
I'm getting a lot of this by CrashDetect:
Код:
[18:18:36] [debug] #0 004aa0cc in public OnPlayerUpdate () from bP.amx [18:18:36] [debug] Run time error 4: "Array index out of bounds" [18:18:36] [debug] Accessing element at index 65535 past array upper bound 499
And after some hours, server gets frozen and no one can join, I mean, they can, but gamemode doesn't load.
I checked htop(proccess monitor for linux) and one of the cpu cores was 100% which is odd, so I believe it's due to this.
Код:
public OnPlayerUpdate(playerid) { new targetplayer = GetPlayerTargetPlayer(playerid); // Store the ID if(DM[targetplayer] != INVALID_PLAYER_ID){ if(DM[targetplayer] == 0 && targetplayer != INVALID_PLAYER_ID) { SetPlayerHealth(playerid,0.0); GameTextForPlayer(playerid, "~R~do not try to use weapons in fun zones!", 5000, 3); } } return 1; }
Basically this checks if a player tries to spawn weapons outside the DM Zones and if shoots at stunters then he gets killed.
I hope someone can help me, thank you for reading.
EDT: Fixed, thanks to Niko_boy and [Comrade]Garsino. Also thanks for telling me about OnPlayerTakeDamage.
PS. way to fix was to check targetplayer != INVALID_PLAYER_ID before DM[targetplayer] == 0