Loosing 1 score on death
#1

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

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

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

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

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
Reply
#5

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;
}
Reply
#6

Thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)