SA-MP Forums Archive
Loosing 1 score on death - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Loosing 1 score on death (/showthread.php?tid=268595)



Loosing 1 score on death - Cody9611 - 13.07.2011

How do I make it so the player who died looses 1 Score and the player who killed them gains 1 score?


Re: Loosing 1 score on death - =WoR=Varth - 13.07.2011

pawn Код:
public OnPlayerDeath(playerid,killerid,reason);
{
    SetPlayerScore(playerid,GetPlayerScore(playerid) - 1);
    SetPlayerScore(killerid,GetPlayerScore(killerid) + 1);
    return 1;
}
Untested.


Re: Loosing 1 score on death - -Rebel Son- - 13.07.2011

Havn't scripted in awhile, but somthing like so,

Код:
SetPlayerScore(playerid)--;
SetPlayerScore(killerid)++;
Under OnPlayerDeath, somthing simaler to this.


Re: Loosing 1 score on death - Cody9611 - 13.07.2011

varthshenon's worked... Butis it possible to make it so it doesnt go lower than 0? And also the player looses half their money and the killer gets it


Re: Loosing 1 score on death - =WoR=Varth - 13.07.2011

pawn Код:
public OnPlayerDeath(playerid,killerid,reason);
{
    if(GetPlayerScore(playerid) != 0) SetPlayerScore(playerid,GetPlayerScore(playerid) - 1);
    SetPlayerScore(killerid,GetPlayerScore(killerid) + 1);
    GivePlayerMoney(killerid,GetPlayerMoney(playerid) / 2);
    GivePlayerMoney(playerid,-GetPlayerMoney(playerid) / 2);
    return 1;
}



Re: Loosing 1 score on death - Cody9611 - 13.07.2011

Thanks