warning 217: loose indentation error 029: invalid expression, assumed zero error 017: undefined symbol "cmd_afk" error 029: invalid expression, assumed zero fatal error 107: too many error messages on one line
CMD:afk(playerid,params[])
{
if(IsAfk[playerid] == 0)
{
new string[128];
new pName[MAX_PLAYER_NAME];
GetPlayerName(playerid,pName,sizeof(pName));
format(string,sizeof(string),"%s(%d) is now AFK -%s",pName,playerid,params);
TogglePlayerControllable(playerid,0);
SendClientMessageToAll(COLOR_YELLOW,string);
IsAfk[playerid] = 1;
}
else
SendClientMessage(playerid,COLOR_BRIGHTRED,"You are already AFK");
return true;
}
forward SendClientMessageToAllCops(msg[]);
public SendClientMessageToAllCops(msg[])
{
for(new i=0; i<MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(HasLawEnforcementRadio[i] == 1)
{
SendClientMessage(i,COLOR_LIGHTBLUE,msg);
}
}
}
forward SendClientMessageToAllCops(msg[]);
public SendClientMessageToAllCops(msg[])
{
for(new i=0; i<MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(HasLawEnforcementRadio[i] == 1)
{
SendClientMessage(i,COLOR_LIGHTBLUE,msg);
}
}
}
return 1;
}
That's why I asked to show also what came BEFORE the afk command. If you miss a bracket in a function, the functions coming after it will throw those random errors. |