01.03.2014, 21:09
Hello, I'm trying to make a ban command using a tutorial on the sa-mp forums although, somewhy, I get these following errors.
The script for the command is the following.
P.S: Ignore the warning please, as I'm aware of it.
pawn Код:
C:\Users\vasu\Desktop\Sa-Mp Roleplay Serv\gamemodes\Roleplay.pwn(866) : error 017: undefined symbol "SInfo"
C:\Users\vasu\Desktop\Sa-Mp Roleplay Serv\gamemodes\Roleplay.pwn(866) : warning 215: expression has no effect
C:\Users\vasu\Desktop\Sa-Mp Roleplay Serv\gamemodes\Roleplay.pwn(866) : error 001: expected token: ";", but found "]"
C:\Users\vasu\Desktop\Sa-Mp Roleplay Serv\gamemodes\Roleplay.pwn(866) : error 029: invalid expression, assumed zero
C:\Users\vasu\Desktop\Sa-Mp Roleplay Serv\gamemodes\Roleplay.pwn(866) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
4 Errors.
pawn Код:
CMD:ban(playerid,params[])
{
if(PlayerInfo[playerid][Level] < 1) return SendClientMessage(playerid, COLOR_GREY, "You can't use this command!");//Checking if the player has admin level 1, if not it sends him a message.
{
new id, r[25], string[100];//R = Reason
new name[MAX_PLAYER_NAME], name2[MAX_PLAYER_NAME];
if(sscanf(params, "is", id, r)) return SendClientMessage(playerid, 0xF69521AA, "USAGE: /ban [id] [reason]");
{
if(id != INVALID_PLAYER_ID)
{
PlayerInfo[id][Banned]=1;//To Make Player Banned When He Connect It Kick Him
GetPlayerName(playerid, name, sizeof(name));
GetPlayerName(id, name2, sizeof(name2));
format(string, sizeof(string), "%s[%d] has been banned by Admin %s[%d] - %s", id, name2, playerid, name, r);
else
if(PlayerInfo[playerid][Level] < 1) format(string, sizeof(string), ""%s[%d] has been banned by Moderator %s[%d] - %s", id, name2, playerid, name, r);
SendClientMessageToAll(0xFF1493FF, string);
Kick(ID);
}
else SendClientMessage(playerid, COLOR_GREY, "The specified player is currently not connected.");
}
}
else SendClientMessage(playerid, COLOR_GREY, "You can't use this command!");