Whats wrong with this?
#1

Whats wrong with this? I am trying to give a +1 score to the killer. But its not giving it to him.
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    if(killerid != INVALID_PLAYER_ID) SetPlayerScore(killerid, GetPlayerScore(killerid) + 1);
    return 1;
}
Reply
#2

Are you testing it with another person? I'll help you test it if you want, just PM me the test server IP.
Reply
#3

You can't give yourself score if you kill yourself.
If you want to do that add this.
pawn Код:
if(killerid == playerid)
{      
    SetPlayerScore(killerid, GetPlayerScore(killerid) + 1);    
    return 1;
}
EDIT: That didn't work. I'll help you test it.
Reply
#4

pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
     printf("%d - Score: %d", killerid, GetPlayerScore(killerid));
     if(killerid != INVALID_PLAYER_ID)
     {
          SetPlayerScore(killerid, GetPlayerScore(killerid) + 1);
          printf("%d - New Score: %d", killerid, GetPlayerScore(killerid));
     }
     return 1;
}
Check if it get's called by reading the server console output.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)