14.03.2011, 12:55
Hey guys... i am at school and i have no gta here... I made this ban code and i wanna know if it cvould work....
Please give a look, it compile without erros/warmnings...
Please give a look, it compile without erros/warmnings...
pawn Код:
Command_ban(playerid, params[])
{
if(IsPlayerConnected(id))
{
if(IsPlayerAdmin(playerid))
{
new id;
if(!sscanf(params, "ui", id))
{
new string[64];
new name[MAX_PLAYER_NAME], PlayerName[MAX_PLAYER_NAME], text[PLAYER_TEXT];
GetPlayerName(playerid, name, sizeof(name));
GetPlayerName(id, PlayerName, sizeof(PlayerName));
GetPlayerText(playerid, text, sizeof(text));
format(string, sizeof(string), "You has been banned by %s, reason %d", name, text);
SendClientMessage(playerid, 0x0259EAAA, string);
format(string, sizeof(string), "You banned %s.)
SendClientMessage(playerid, 0x0259EAAA, string);
BanPlayer(id);
}
else return SendClientMessage(playerid, 0x0259EAAA, "USAGE: /ban [PlayerId/PartOfName] [Reason]");
}
else return SendClientMessage(playerid, 0x0259EAAA, "You are not admin.");
}
else return SendClientMessage(playerid, 0x0259EAAA, "Player is not connected.");
}