04.04.2013, 16:01
On top of your script , near the other ones
On the bottom of your script
And the command (zcmd + sscanf )
PS : If you dont use zcmd and sscanf yet you should start now , its easier and faster and better .
pawn Код:
forward ReqBan(playerid);
pawn Код:
public ReqBan(playerid,tobanid,reason[])
{
new themsg[128];
new nume[MAX_PLAYER_NAME];
GetPlayerName(playerid, nume, sizeof(nume));
format(themsg, sizeof(themsg), "Admin %s requests a player ban on %s ,reason %s",nume,tobanid,reason);
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(AdminLevel[playerid] >= 4)
{
SendClientMessage(playerid, 0x347235FF, themsg);
}
}
}
return 1;
}
pawn Код:
COMMAND:requestban(playerid, params[])
{
new idtoban;
new reason[32];
if (!sscanf(params, "us[32]",idtoban,reason ))
{
if (AdminLevel[playerid] >= 1)
{
if(idtoban != INVALID_PLAYER_ID)
{
ReqBan(playerid,idtoban,reason);
return 1;
}
else{ return SendClientMessage(playerid,culoare,"Invalid ID"); }
}
else{ return SendClientMessage(playerid,culoare,"Not autorized to use that"); }
}
else { return SendClientMessage(playerid,culoare,"USE : /requestban playerid reason"); }
}