16.02.2011, 16:25
Quote:
If you wont offer any guy help, why the hell should you bullpost about using sscanf?
@ OP Sorry mate, but i can't help as im not into dcmd etc, i just wanted to reply to the guy that replied. |
Just look here (This should work, using 'sscanf2' plugin):
pawn Код:
//#include <sscanf2>
dcmd_ban(playerid, params[])
{
if(!IsPlayerAdmin(playerid))
{
new targetid, reason[128];
if(sscanf(params, "us[128]", targetid, reason)) return SendClientMessage(playerid, red, "USAGE: /ban [playerid] [reason]");
else if(IsPlayerConnected(targetid)) return SendClientMessage(playerid, red, "ERROR: Player is not connected!");
{
new playername[MAX_PLAYER_NAME], targetname[MAX_PLAYER_NAME], string[128];
GetPlayerName(playerid, playername, sizeof(playername));
GetPlayerName(targetid, targetname, sizeof(targetname));
format(string,sizeof(string),"%s has been banned by Administrator %s (Reason: %s)",targetname, playername, reason);
SendClientMessageToAll(red,string);
BanEx(targetid, reason);
}
}
else return SendClientMessage(playerid, red, "ERROR: You must to be an admin before using this command!");
}