SA-MP Forums Archive
stock giveplayerscore - 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)
+--- Thread: stock giveplayerscore (/showthread.php?tid=354436)



stock giveplayerscore - thefatshizms - 26.06.2012

hello, sorry if this is completely wrong i was taking a wild guess and im a noob at scripting still

pawn Код:
stock givescore(playerid, ammount)
{
    new currentscore;
    currentscore = GetPlayerScore(playerid);
    SetPlayerScore(playerid, currentscore++ammount);
}
ive done something wrong lol but as i guessed i have no clue what

EDIT: nvm i think i got it


Re: stock giveplayerscore - ViniBorn - 26.06.2012

pawn Код:
givescore(playerid, ammount) SetPlayerScore(playerid, GetPlayerScore(playerid)+ammount);



Re: stock giveplayerscore - thefatshizms - 26.06.2012

near enough

pawn Код:
stock givescore(playerid, ammount)
{
    new currentscore;
    currentscore = GetPlayerScore(playerid);
    SetPlayerScore(playerid, currentscore + ammount);
}
still works though DDD