command problems rly help
#7

Quote:
Originally Posted by Marricio
Посмотреть сообщение
pawn Код:
if(strcmp("/akill", cmd, true) == 0)
    {
        if(IsPlayerAdmin(playerid)) {
            tmp = strtok(cmdtext,idx);
            if(!strlen(tmp) || strlen(tmp) > 5) {
                return SendClientMessage(playerid,ADMINFS_MESSAGE_COLOR,"Usage: /akill (id) [reason]");
            }

            new id = strval(tmp);

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

            gMessage = strrest(cmdtext,idx);

            GetPlayerName(id,iName,sizeof(iName));
            SendClientMessage(id,ADMINFS_MESSAGE_COLOR,"-- You have been kiled by an administrator.");

            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 akilled.",iName,id);
            SendClientMessage(playerid,ADMINFS_MESSAGE_COLOR,Message);

            SetPlayerHealth(id,0);
            return 1;
        } else {
            SendClientMessage(playerid,ADMINFS_MESSAGE_COLOR,"/akill : You are not an admin");
            return 1;
        }
    }
Credits to baseAF
thanks but do you know why i can only have four worded commands any higher i get 0 infront of reason? thanks
Reply


Messages In This Thread
command problems rly help[IMPOSSABLE] - by hadzx - 20.02.2011, 22:14
Re: command problems rly help - by Marricio - 20.02.2011, 23:06
Re: command problems rly help - by hadzx - 20.02.2011, 23:08
Re: command problems rly help - by Marricio - 20.02.2011, 23:10
Re: command problems rly help - by hadzx - 20.02.2011, 23:15
Re: command problems rly help - by Marricio - 20.02.2011, 23:18
Re: command problems rly help - by hadzx - 20.02.2011, 23:24
Re: command problems rly help - by Marricio - 20.02.2011, 23:28
Re: command problems rly help - by hadzx - 20.02.2011, 23:30
Re: command problems rly help - by HyperZ - 21.02.2011, 08:55

Forum Jump:


Users browsing this thread: 1 Guest(s)