what a problem?
#1

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?
Reply
#2

You should use:
pawn Код:
PlayerInfo[killerid][Exp]=PlayerInfo[killerid][Exp]+1000;
...that is adding 1000 to previous value
Reply
#3

Or

pawn Код:
PlayerInfo[killerid][Exp] += 1000;
Reply
#4

Thank you very much.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)