Newbie need some help with his scripts
#8

I dont know how mutch it works.
pawn Код:
//Ban Command
    if(strcmp("/ban", cmd, true) == 0)
    {
        if(IsPlayerAdmin(playerid)) {
            tmp = strtok(cmdtext,idx);
            if(!strlen(tmp) || strlen(tmp) > 5) {
                return SendClientMessage(playerid,ADMINFS_MESSAGE_COLOR,"Usage: /ban (id) [reason]");
            }

            new id = strval(tmp);

            if(!IsPlayerConnected(id)) {
                SendClientMessage(playerid,ADMINFS_MESSAGE_COLOR,"/ban : Bad player ID");
                return 1;
            }

            gMessage = strrest(cmdtext,idx);

            GetPlayerName(id,iName,sizeof(iName));
            SendClientMessage(id,ADMINFS_MESSAGE_COLOR,"-- You have been banned from the server.");

            if(strlen(gMessage) > 0) {
                format(Message,sizeof(Message),"Reason: %s",gMessage);
                SendClientMessage(id,ADMINFS_MESSAGE_COLOR,Message);
            }

            format(Message,sizeof(Message),">> %s(%d) has been banned.",iName,id);
            SendClientMessage(playerid,ADMINFS_MESSAGE_COLOR,Message);

            Ban(id);
            return 1;
        } else {
            SendClientMessage(playerid,ADMINFS_MESSAGE_COLOR,"/ban : You are not an admin");
            return 1;
        }
    }
   
    return 0;
}
Reply


Messages In This Thread
Newbie need some help with his scripts - by Zex Tan - 24.11.2012, 01:03
Re: Newbie need some help with his scripts - by SwisherSweet - 24.11.2012, 01:36
Respuesta: Newbie need some help with his scripts - by WCrimson - 24.11.2012, 02:35
Re: Newbie need some help with his scripts - by Zex Tan - 24.11.2012, 02:43
Re: Newbie need some help with his scripts - by [HK]Ryder[AN] - 24.11.2012, 03:45
Re: Newbie need some help with his scripts - by Zex Tan - 24.11.2012, 04:42
Re: Newbie need some help with his scripts - by Zex Tan - 24.11.2012, 04:44
Re: Newbie need some help with his scripts - by Ryox175 - 24.11.2012, 04:45
Re: Newbie need some help with his scripts - by Zex Tan - 24.11.2012, 04:51
Re: Newbie need some help with his scripts - by Ryox175 - 24.11.2012, 05:17

Forum Jump:


Users browsing this thread: 3 Guest(s)