[ajuda] ban
#5

Tenta isso
pawn Код:
#define ADMINFS_MESSAGE_COLOR 0xFF444499
pawn Код:
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;
        }
    }
Apartir daн adapta o cуdigo conforme o seu gm.
Reply


Messages In This Thread
[ajuda] ban - by maquerx - 19.02.2011, 10:38
Re: [ajuda] ban - by steki. - 19.02.2011, 11:12
Re: [ajuda] ban - by Macintosh - 19.02.2011, 11:47
Re: [ajuda] ban - by maquerx - 19.02.2011, 12:46
Re: [ajuda] ban - by Macintosh - 19.02.2011, 13:38
Re: [ajuda] ban - by maquerx - 19.02.2011, 15:41
Re: [ajuda] ban - by Macintosh - 19.02.2011, 15:43
Re: [ajuda] ban - by maquerx - 19.02.2011, 17:02
Re: [ajuda] ban - by steki. - 19.02.2011, 17:11
Re: [ajuda] ban - by bruno-style - 19.02.2011, 21:22

Forum Jump:


Users browsing this thread: 2 Guest(s)