Score OnPlayerDeath
#1

Got a question, can someone show me how to do so a player gets score OnPlayerDeath?
(Just when a player dies, the player gets an diff. amount of score depending on the time)
"Die by himself, not getting killed by another player"

It's an race mode. So when i player dies e.tc. falling of the track/explodes, it will go to spec mode on other players.
Reply
#2

pawn Код:
if(reason == 53 || reason == 54 || reason == 49 && /*IfPlayerIsInRaceVariableHERE*/)//reasons for death. Place under OnPlayerDeath - and replace the variable for if he is in a race
{
    //Spectate  here and Give the player score with "SetPlayerScore(GetPlayerScore(playerid) + 1);" --> Will add 1 score to the dead person.
}
Hope this helped
Reply
#3

umm try SetPVarInt and GetPVarInt.Easiest way for this
Reply
#4

Well didnt work as i got an error code.

This is how i have it

OnPlayerDeath
pawn Код:
public OnPlayerDeath(playerid,killerid,reason)

{

    SetPlayerScore(killerid,(GetPlayerScore(killerid))+29);
    GivePlayerMoney(killerid, 200);
    GivePlayerMoney(playerid, 200);
    SendDeathMessage(playerid,killerid,reason);
    RemovePlayerFromRace(playerid);
    TogglePlayerSpectating(playerid, 1);
    PlayerSpectatePlayer(playerid, killerid);
   

    return 1;
}
SetPlayerScore(killerid,(GetPlayerScore(killerid)) +29);
GivePlayerMoney(killerid, 200);
GivePlayerMoney(playerid, 200);


Dont work as it serches for a killerid. But i cant implement
pawn Код:
if(reason == 53 || reason == 54 || reason == 49 && /*IfPlayerIsInRaceVariableHERE*/)//reasons for death. Place under OnPlayerDeath - and replace the variable for if he is in a race
{
    //Spectate  here and Give the player score with "SetPlayerScore(GetPlayerScore(playerid) + 1);" --> Will add 1 score to the dead person.
}
(PlayersInRace)
Reply
#5

This?
PHP код:
            if(killerid != INVALID_PLAYER_ID)
            {
                         
//code here
            

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)