Problem With OnPlayerDeath
#1

Fixed
Reply
#2

You need to check whether killedid != INVALID_PLAYER_ID before you use it in any arrays.
Reply
#3

Quote:
Originally Posted by MP2
Посмотреть сообщение
You need to check whether killedid != INVALID_PLAYER_ID before you use it in any arrays.
So i do something like this? :
pawn Код:
if(killedid != INVALID_PLAYER_ID)
{
//here my code
return 1;
}
Reply
#4

killerid.
Reply
#5

Yes. If you try to set an array with [killerid] to something and it's INVALID_PLAYER_ID - it will stop the script.
Reply
#6

Quote:
Originally Posted by MP2
Посмотреть сообщение
Yes. If you try to set an array with [killerid] to something and it's INVALID_PLAYER_ID - it will stop the script.
Ok now i will try to see if it works and i tell you
Reply
#7

Also, 'OnPlayerDeath' should have 'public' before it.
Reply
#8

Quote:
Originally Posted by MP2
Посмотреть сообщение
Also, 'OnPlayerDeath' should have 'public' before it.
Yes i know that, i just added the code here and forgot to add onplayerdeath fuction and i didnt type public.
Well i edited it but it seems to dont work :/ I forgot something?
Reply
#9

You're doing

PlayerInfo[killerid][pKills]++;

but not checking if it's valid.
Reply
#10

Oh thanks bro, now it works!!
I will give you +Rep
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)