23.05.2016, 15:58
Hii there.
I've a problem :
I have an error. I don't know how to resolve it.
I've a problem :
PHP код:
//new GODAFK;
new PlayerAfkName[MAX_PLAYERS][MAX_PLAYER_NAME+1];
CMD:afk(playerid, params[])
{
if(afk[playerid] == 1 && PlayerInfo[playerid][pAdminlvl] == 5)
{
if(ZDM[playerid] != 2 && Dming[playerid] != 2)
{
new Float:x, Float:y, Float:z;
GetPlayerName(playerid, PlayerAfkName[playerid][MAX_PLAYER_NAME], sizeof(PlayerAfkName[playerid][MAX_PLAYER_NAME])); // THIS LINE GET A ERROR
TogglePlayerControllable(playerid, 0);
GetPlayerHealth(playerid, afkHealth[playerid]);
SetPlayerHealth(playerid, 9999999.0);
//GODAFK = SetTimerEx("GodMode", 100, true, "i", playerid);
GameTextForPlayer(playerid, "AFK", 4000, 3);
GetPlayerPos(playerid, x, y, z);
new Text3D:afk3D = Create3DTextLabel("[AFK]",red1, x, y, z, 40, 0, 0);
Attach3DTextLabelToPlayer(afk3D, playerid, 0.0, 0.0, 0.0);
afk[playerid] = 2;
afkDraw = TextDrawCreate(285.000000, 18.000000,"~r~AFK");
TextDrawShowForPlayer(playerid, afkDraw);
return 1;
}
return 1;
}
else if(afk[playerid] == 2 && ZDM[playerid] != 2 && Dming[playerid] != 2)
{
TogglePlayerControllable(playerid, 1);
//DeletePlayer3DTextLabel(playerid,
SetPlayerHealth(playerid, afkHealth[playerid]);
//KillTimer(GODAFK);
TextDrawHideForPlayer(playerid, afkDraw);
afk[playerid] = 1;
return 1;
}
else return 1;
}
PHP код:
C:\--(5807) : error 001: expected token: "]", but found "-identifier-"
C:\--(5807) : warning 215: expression has no effect
C:\--(5807) : error 001: expected token: ";", but found "]"
C:\--(5807) : error 029: invalid expression, assumed zero
C:\--(5807) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
4 Errors.