public OnPlayerDeath(playerid, killerid, reason)
{
SendDeathMessage(killerid, playerid, reason);
if(killerid != INVALID_PLAYER_ID)
{
SetPlayerScore(killerid, +1);
PLAYER_CASH[killerid] += 100;
GivePlayerMoney(killerid, 100);
}
PLAYER_DEATHS[playerid]++;
PLAYER_CASH[playerid] -= 100;
PLAYER_KILLS[killerid]++;
PLAYER_SCORE[killerid]++;
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
SendDeathMessage(killerid, playerid, reason);
if(killerid != INVALID_PLAYER_ID)
{
SetPlayerScore(killerid, GetPlayerScore(killerid)+1);
PLAYER_CASH[killerid] += 100;
GivePlayerMoney(killerid, 100);
}
PLAYER_DEATHS[playerid]++;
PLAYER_CASH[playerid] -= 100;
PLAYER_KILLS[killerid]++;
PLAYER_SCORE[killerid]++;
return 1;
}
C:\Users\tadej\Desktop\SA-MP Server\gamemodes\New.pwn(283) : error 028: invalid subscript (not an array or too many subscripts): "PLAYER_MONEY" C:\Users\tadej\Desktop\SA-MP Server\gamemodes\New.pwn(283) : warning 215: expression has no effect C:\Users\tadej\Desktop\SA-MP Server\gamemodes\New.pwn(283) : error 001: expected token: ";", but found "]" C:\Users\tadej\Desktop\SA-MP Server\gamemodes\New.pwn(283) : error 029: invalid expression, assumed zero C:\Users\tadej\Desktop\SA-MP Server\gamemodes\New.pwn(283) : 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)
{
SendDeathMessage(killerid, playerid, reason);
if(killerid != INVALID_PLAYER_ID)
{
SetPlayerScore(killerid, GetPlayerScore(killerid)+1);
GivePlayerMoney(killerid, 100);
}
PLAYER_DEATHS[playerid]++;
PLAYER_MONEY[playerid] -= 100;
PLAYER_KILLS[killerid]++;
PLAYER_SCORE[killerid]++;
PLAYER_MONEY[killerid]++= 100;
return 1;
}
PHP код:
|
PLAYER_MONEY[killerid]+= 100;
That's the implementation of the variables, not their declaration.
He means, show us where you define the variables (new PLAYER_DEATHS...) |
enum PLAYER_MAIN
{
PLAYER_NAME[MAX_PLAYER_NAME],
PLAYER_IP[16],
PLAYER_REGGED,
PLAYER_PASS,
PLAYER_LEVEL,
PLAYER_MONEY,
PLAYER_SCORE,
PLAYER_MUTED,
PLAYER_MUTE_TIME,
PLAYER_KILLS,
PLAYER_DEATHS
public OnPlayerDeath(playerid, killerid, reason)
{
SendDeathMessage(killerid, playerid, reason);
if(killerid != INVALID_PLAYER_ID)
{
SetPlayerScore(killerid, GetPlayerScore(killerid)+1);
GivePlayerMoney(killerid, 100);
}
gPlayerInfo[playerid][PLAYER_DEATHS]++;
gPlayerInfo[playerid][PLAYER_MONEY] -= 100;
gPlayerInfo[killerid][PLAYER_KILLS]++;
gPlayerInfo[killerid][PLAYER_SCORE]++;
gPlayerInfo[killerid][PLAYER_MONEY]+= 100;
return 1;
}