NPC keeps geting score
#1

Hello!

My NPC keeps getting score of other players kills/deaths.
The NPC has ID 0.

So if you dies in a car/flight crash or kill your self the NPC get score, even if you get rocket launched by a player when you sitting in a vehicle. Im pretty tired of this and i want a solution of this problem.
Anyone who can help with this or explain why it is like it is?
Reply
#2

Post code under callback OnPlayerDeath
Reply
#3

Quote:
Originally Posted by [MG]Dimi
Посмотреть сообщение
Post code under callback OnPlayerDeath
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    if(GetPVarInt(playerid, "nearExp") > -1 && killerid == INVALID_PLAYER_ID) {
    killerid = GetPVarInt(playerid, "nearExp");
    if(killerid == playerid) killerid = INVALID_PLAYER_ID;
    reason = 51;
    }
    SendDeathMessage(killerid, playerid, reason);
    SetPlayerScore(killerid, GetPlayerScore(killerid) + 1);
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)