I have two problems - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: I have two problems (
/showthread.php?tid=602673)
I have two problems [+REP] -
Antonio2323 - 11.03.2016
Hello,
On my chat log of server-samp see debug error:
#0 000e1698 in public OnPlayerDeath (playerid=6, killerid=65535, reason=255)
And i have an other problem: my gamemode has used 100% usage CPU, what's problem?
Please, help me, thank you.
Re: I have two problems -
Shaheen - 11.03.2016
In OnPlayerDeath, check if issuerid is not INVALID_PLAYER_ID before using it in arrays. If you don't understand, see the example in the wiki:
https://sampwiki.blast.hk/wiki/OnPlayerDeath
It increases the kills for the killer ONLY if the player is valid.
and u kept playerid=6, why do u want that > instead just try playerid,
Re: I have two problems -
itsCody - 11.03.2016
killerid=65535 = invalid killer id
PHP код:
public OnPlayerDeath(playerid, killerid, reason)
{
if(killerid != INVALID_PLAYER_ID
{
// do stuff
}
return 1;
}
100% cpu could result in a lot of things..
timers, unoptimized code, etc
or something running on background on your server?
Re: I have two problems -
Antonio2323 - 11.03.2016
Thanks, on my gamemode i use sevent timers in OnGameModeInit whith include fixes2.inc