24.08.2013, 22:51
I made this command, however after I changed the AFK[MAX_PLAYERS] and put it into the command, it's giving me these errors.
Code:
Errors:
Line 1817:
Code:
Код:
CMD:afk(playerid, params[]) { new sendername[MAX_PLAYER_NAME], string[128]; new PlayerText3D:AFK, Float:x, Float:y, Float:z; else if(AFK[playerid] == 1) { GetPlayerName(playerid, sendername, sizeof(sendername)); sendername[strfind(sendername,"_")] = ' '; format(string, sizeof(string), "[SERVER] {FFFFFF}%s is no longer AFK.", sendername,playerid); SendClientMessageToAll(COLOR_YELLOW, string); SetPlayerHealth(playerid,100); SetPlayerArmour(playerid,0); SetOriginalColor(playerid); AFK[playerid] = 0; DeletePlayer3DTextLabel(playerid, PlayerText3D:AFK); TogglePlayerControllable(playerid, 1); } else { GetPlayerName(playerid, sendername, sizeof(sendername)); sendername[strfind(sendername,"_")] = ' '; format(string, sizeof(string), "[SERVER] %s is now AFK.",sendername,playerid); SendClientMessageToAll(COLOR_YELLOW, string); SetPlayerHealth(playerid,1000000); SetPlayerArmour(playerid,1000000); SetPlayerColor(playerid,0x96008CFF); AFK[playerid] = 1; GetPlayerPos(playerid, Float:x, Float:y, Float:z); AFK = CreatePlayer3DTextLabel(playerid,"[[ AFK ]]",COLOR_GREEN,Float:x,Float:y,Float:z,40.0); TogglePlayerControllable(playerid, 0); } return 1; }
Код:
C:\Users\Scoot\Desktop\gecko\gamemodes\Gecko.pwn(1817) : error 029: invalid expression, assumed zero C:\Users\Scoot\Desktop\gecko\gamemodes\Gecko.pwn(1817) : warning 215: expression has no effect C:\Users\Scoot\Desktop\gecko\gamemodes\Gecko.pwn(1817) : error 001: expected token: ";", but found "if" C:\Users\Scoot\Desktop\gecko\gamemodes\Gecko.pwn(1817) : error 028: invalid subscript (not an array or too many subscripts): "AFK" C:\Users\Scoot\Desktop\gecko\gamemodes\Gecko.pwn(1817) : fatal error 107: too many error messages on one line
Код:
else if(AFK[playerid] == 1)