error 028: invalid subscript
#1

pawn Код:
CMD:afk(playerid, params[])
{
    new str[300];
    AFKTime[playerid] = 1
    if(afkalready[playerid] == 0)
    {
        format(str,sizeof(str), "» %s(%d) is now AFK (Away From Keyboard)!",GetPName(playerid),playerid);
        SendClientMessageToAll(green,str);
        SendClientMessage(playerid,green, ""lyellow"[NOTICE]"lwhite": just type again /afk to UN-AFK!");
        afkalready[playerid] = 1;
        TogglePlayerControllable(playerid, 0);
        SetPlayerArmour(playerid, 99999.0);
        SetPlayerHealth(playerid, 99999.0);
    }
    else if(afkalready[playerid] == 1)
    {
        AFKTime[playerid] = 0;
        IsPlayerAFK[playerid] = false;
        SetPlayerArmour(playerid, 0);
        SetPlayerHealth(playerid, 99.0);
        ResetPlayerWeapons(playerid);
        format(str,sizeof(str),"» %s(%d) is now Back(Welcome Back)!",GetPName(playerid),playerid);
        SendClientMessageToAll(green,str);
        TogglePlayerControllable(playerid, 1);
        afkalready[playerid] = 0;
    }
    return 1;
}
Код:
C:\Users\Matt\Desktop\SA-MP Files\PHT\gamemodes\ets.pwn(7107) : error 001: expected token: ";", but found "if"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Reply
#2

pawn Код:
new Text:VersionNumberTextDraw[MAX_PLAYERS];
Also if it's saying undefined symbol 'playerid' then you obviously don't have the code under a call with playerid.
Reply
#3

thanks solved
Reply
#4

Delete Look Main Post
Reply
#5

AFKTime[playerid] = 1;
This line will make afktime to 0 everytime, to add one each time someone types afk replace this line by
AFKTime ++;
Reply
#6

ah yes i forgot that one lol sorry for bothering
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)