[Question] Ban
#1

Hi,
I've made an script that ban players. It works fine but when i type 1 letter in reason, it will ban me.
Example: /ban 5 a
PHP код:
CMD:ban(playeridparams[])
{
    new
        
targetid,
        
Reason,
        
AdminName[MAX_PLAYERS],
        
TargetName[MAX_PLAYER_NAME],
        
banmsg[128];
    if(
PlayerInfo[pAdmin][playerid]>2)
    {
         if(
sscanf(params"is[50]"targetidReason)) return SendClientMessage(playerid0xE90A0AFF"[CMD] /ban [playerid] [reason]");
        if(!
IsPlayerConnected(targetid)) return SendClientMessage(playerid0xE90A0AFF"[ERROR] Invalid player ID.");
        
GetPlayerName(playeridAdminNamesizeof(AdminName));
        
GetPlayerName(targetidTargetNamesizeof(TargetName));
        
format(banmsgsizeof(banmsg), "[ADMIN] Admin %s has banned %s [Reason: %s]"AdminNameTargetNameReason);
        
SendClientMessageToAll(0xE90A0AFFbanmsg);
        
TextDrawShowForPlayer(targetidTextdraw0);
        
TextDrawShowForPlayer(targetidTextdraw1);
        
TextDrawShowForPlayer(targetidTextdraw2);
        
PlayerInfo[Banned][targetid] = 1;
        
Kick(targetid);
    }
    else
    {
        
SendClientMessage(playerid0xE90A0AFF"[ERROR] You are not authorized.");
    }
    return 
1;

I have the same problem with /kick
What's wrong?
Reply


Messages In This Thread
[Question] Ban - by javad - 17.08.2015, 10:53
Re: [Question] Ban - by ZToPMaN - 17.08.2015, 10:59
Re: [Question] Ban - by javad - 17.08.2015, 11:06
Re: [Question] Ban - by Dokins - 17.08.2015, 11:24
Re: [Question] Ban - by javad - 17.08.2015, 11:37
Re: [Question] Ban - by Dokins - 17.08.2015, 11:38
Re: [Question] Ban - by javad - 17.08.2015, 11:42
Re: [Question] Ban - by Dokins - 17.08.2015, 11:43
Re: [Question] Ban - by javad - 17.08.2015, 11:45
Re: [Question] Ban - by Dokins - 17.08.2015, 11:49

Forum Jump:


Users browsing this thread: 6 Guest(s)