14.01.2015, 10:52
pawn Код:
CMD:healall(playerid,params[])
{
new string[200];
LoginCheck(playerid);
if(User[playerid][accountAdmin] >= 4)
{
foreach(Player, i)
{
PlayerPlaySound(i,1057,0.0,0.0,0.0);
SetPlayerHealth(i,100.0);
}
}
format(string, 128, "[HEAL] "white"Everyone has been healed by %s.", GetName(playerid));
SendAMessage(COLOR_RED, string);
} //-> Warning 3348
else //-> Error 3349
{
SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use that command!"); // if not, send him only the following message
}
}
return 1; // This needs to be at the last bracket, so it symbolizes the command
}
Which means you should have a return 1 inside the commands brackets, like above.
And about the "else", you do not have an "if" to activate it?
You might have meant to do underneath.
pawn Код:
CMD:healall(playerid,params[])
{
new string[200];
LoginCheck(playerid);
if(User[playerid][accountAdmin] < 4) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use that command!");
foreach(Player, i)
{
PlayerPlaySound(i,1057,0.0,0.0,0.0);
SetPlayerHealth(i,100.0);
}
format(string, 128, "[HEAL] "white"Everyone has been healed by %s.", GetName(playerid));
SendAMessage(COLOR_RED, string);
return 1; // This needs to be at the last bracket, so it symbolizes the command
}