Problem|Ban Command
#1

pawn Код:
COMMAND:ban(playerid, params[])
{
    new IsAdmin;
46  IsAdmin = PlayerInfo[playerid][pAdminLevel];
    if(IsAdmin >= 2)
48  new target, reason[128];
    if (sscanf(params, "us[128]", target, reason)) return SendClientMessage(playerid,0xFFFFFFFF, "Incomplete input");
    new string[128];
    format(string, 128, "You have banned %q for %s.", id, reason); // we format it
    SendClientMessage(playerid, 0xFFFFFFFF, string); // and we send the string
    return 1;
}
Now i get these error messages
pawn Код:
C:\GTA.San.Andreas mor55\Samp Server\gamemodes\tutscript.pwn(46) : error 017: undefined symbol "PlayerInfo"
C:\GTA.San.Andreas mor55\Samp Server\gamemodes\tutscript.pwn(48) : error 003: declaration of a local variable must appear in a compound block
C:\GTA.San.Andreas mor55\Samp Server\gamemodes\tutscript.pwn(48) : error 017: undefined symbol "target"
C:\GTA.San.Andreas mor55\Samp Server\gamemodes\tutscript.pwn(48) : warning 215: expression has no effect
C:\GTA.San.Andreas mor55\Samp Server\gamemodes\tutscript.pwn(48) : error 001: expected token: ";", but found "]"
C:\GTA.San.Andreas mor55\Samp Server\gamemodes\tutscript.pwn(48) : fatal error 107: too many error messages on one line
Reply
#2

Quote:
Originally Posted by ******
Посмотреть сообщение
"if" should be followed by braces to enclose the code following it.
Edit: OMG i cant believe i forgot the braces *facepalm* Thanks dude.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)