what a problem? - 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: what a problem? (
/showthread.php?tid=98218)
what a problem? -
AiVAMAN - 19.09.2009
hello, I was coding my new exp and lvl system, and I get 1 error when compiling... can some one help me?
here is my script:
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
if(PlayerInfo[killerid][LoggedIn] && killerid != INVALID_PLAYER_ID )
{
PlayerInfo[killerid][Exp]+1000;
PlayerInfo[killerid][Kills]++;
}
if(PlayerInfo[playerid][LoggedIn] && playerid != INVALID_PLAYER_ID)
{
PlayerInfo[playerid][Deaths]++;
}
return 1;
}
error:
Line - PlayerInfo[killerid][Exp]+1000;
code - warning 215: expression has no effect
help me, please?
Re: what a problem? -
Sznupek - 19.09.2009
You should use:
pawn Код:
PlayerInfo[killerid][Exp]=PlayerInfo[killerid][Exp]+1000;
...that is adding 1000 to previous value
Re: what a problem? -
MadeMan - 19.09.2009
Or
pawn Код:
PlayerInfo[killerid][Exp] += 1000;
Re: what a problem? -
AiVAMAN - 20.09.2009
Thank you very much.