Incorect value?
#1

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.
}
Reply
#2

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

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
pawn Код:
new Kills[MAX_PLAYERS];
Then you can use:
pawn Код:
public OnPlayerDeath(blah blah blah)
{
Kills[killerid] + 1;
SetPlayerScore(killerid,Kills[killerid]);
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)