Incorect value? - 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: Incorect value? (
/showthread.php?tid=195199)
Incorect value? -
ThePwherer - 01.12.2010
Hello there. I have made a script for a death match server that i am currently making to improve my scripting skills but this code doesent work corectly how i want it to.
SetPlayerScore(killerid, GetPlayerScore(killerid) + 1);
After the player the killer has killed respawns the score returns to 0. Is it returning an incorect value?
yes of course i do know to put return 1; under it.
}
Re: Incorect value? -
blackwave - 01.12.2010
Quote:
After the player the killer has killed respawns
|
Can't understand this on the quote I put.
if you want to erase killerid's score after him gets killed:
Код:
SetPlayerScore(killerid, 0);
If you want his score on - 1 per each his death:
Код:
SetPlayerScore(killerid, GetPlayerScore(killerid) - 1);
Sorry if didn't tell the correct, because I didn't understand totally what you want
Re: Incorect value? -
SuperS82 - 01.12.2010
Not sure how your using SetPlayerScore but try this:
- Make a Kills variable to store everyones Kills
- Use SetPlayerScore to update the score for the killerid
Then you can use:
pawn Код:
public OnPlayerDeath(blah blah blah)
{
Kills[killerid] + 1;
SetPlayerScore(killerid,Kills[killerid]);
}