SetPlayerScore on OnPlayerDeath +REP - 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: SetPlayerScore on OnPlayerDeath +REP (
/showthread.php?tid=332907)
SetPlayerScore on OnPlayerDeath +REP -
TheMightyEddy - 09.04.2012
So I want it so that when John kills Larry, Larry -2 score because he died. I already know how to +2 score for John. I just need to know how to minus score from the dead player.
Re: SetPlayerScore on OnPlayerDeath +REP -
Boooth - 09.04.2012
You wanna save his score into a variable
pawn Код:
public OnPlayerDeath(playerid, killerid, reason) {
playerVariables[playerid][pScore] -= 2;//Minus dead persons score
playerVariables[killerid][pScore] += 2; //Killers score.
Simple as that.
Re: SetPlayerScore on OnPlayerDeath +REP -
.FuneraL. - 09.04.2012
Put on your way OnPlayerDeath
pawn Код:
SetPlayerScore(killerid, GetPlayerScore(killerid) + 2);
SetPlayerScore(playerid, GetPlayerScore(playerid) - 2);
Re: SetPlayerScore on OnPlayerDeath +REP -
TheMightyEddy - 09.04.2012
Here are the errors now:
Код:
C:\Users\Edward\Desktop\CnR1.1\gamemodes\freeroam.pwn(2108) : error 017: undefined symbol "playerVariables"
C:\Users\Edward\Desktop\CnR1.1\gamemodes\freeroam.pwn(2108) : warning 215: expression has no effect
C:\Users\Edward\Desktop\CnR1.1\gamemodes\freeroam.pwn(2108) : error 001: expected token: ";", but found "]"
C:\Users\Edward\Desktop\CnR1.1\gamemodes\freeroam.pwn(2108) : error 029: invalid expression, assumed zero
C:\Users\Edward\Desktop\CnR1.1\gamemodes\freeroam.pwn(2108) : fatal error 107: too many error messages on one line
Btw, I'm using ZCMD
Re: SetPlayerScore on OnPlayerDeath +REP -
.FuneraL. - 09.04.2012
Use my way and try to compile
Re: SetPlayerScore on OnPlayerDeath +REP -
Boooth - 09.04.2012
Use Funerals way, his will work for nubs.
Re: SetPlayerScore on OnPlayerDeath +REP -
TheMightyEddy - 09.04.2012
@.FuneraL. - Works perfectly! +rep thanks so much!