Line 355: public OnPlayerDeath(playerid, killerid, reason)
Line 356: {
Line 357: GivePlayerMoney(playerid, -500);
Line 358: GivePlayerMoney(killerid, 1000);
Line 359: PlayerInfo[playerid][pDeaths] += 1;
Line 360: PlayerInfo[killerid][pKills] += 1;
Line 361: SetPlayerScore(killerid, +1);
Line 362: SendClientMessage(playerid, COLOR_ORANGE,"For dying, you have lost $500.");
Line 363: SendClientMessage(killerid, COLOR_ORANGE,"For killing someone, you have received $1000.");
Line 364: return 1;
Line 365: }
C:\Users\Matt\Desktop\My Stuff\WC-DM\gamemodes\WC-DM.pwn(361) : error 029: invalid expression, assumed zero C:\Users\Matt\Desktop\My Stuff\WC-DM\gamemodes\WC-DM.pwn(361) : warning 215: expression has no effect C:\Users\Matt\Desktop\My Stuff\WC-DM\gamemodes\WC-DM.pwn(361) : error 001: expected token: ";", but found ")" C:\Users\Matt\Desktop\My Stuff\WC-DM\gamemodes\WC-DM.pwn(361) : error 029: invalid expression, assumed zero C:\Users\Matt\Desktop\My Stuff\WC-DM\gamemodes\WC-DM.pwn(361) : fatal error 107: too many error messages on one line Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 4 Errors.
public OnPlayerDeath(playerid, killerid, reason)
{
GivePlayerMoney(playerid, -500);
GivePlayerMoney(killerid, 1000);
PlayerInfo[playerid][pDeaths] += 1;
PlayerInfo[killerid][pKills] += 1;
SetPlayerScore(killerid, GetPlayerScore(killerid) + 1);
SendClientMessage(playerid, COLOR_ORANGE,"For dying, you have lost $500.");
SendClientMessage(killerid, COLOR_ORANGE,"For killing someone, you have received $1000.");
return 1;
}
PlayerInfo[killerid][pKills] += 1;
will break if killerid is INVALID_PLAYER_ID. You need to add a check for this. |
if(killerid != INVALID_PLAYER_ID)
{
PlayerInfo[killerid][pKills] += 1;
GivePlayerMoney(killerid, 1000);
SetPlayerScore(killerid, GetPlayerScore(killerid) + 1);
}