20.03.2012, 12:28
Ok i'll Explain to you guys how make simple /akill
Ok first go to your's ZCMD and do it
this is your section where's you will make your's Commands
add it on the Top of your server u will use it soon
new Playername[MAX_PLAYER_NAME], Adminname[MAX_PLAYER_NAME];//you will use it later with your sscanf
GetPlayerName(playerid, Adminname, sizeof(Adminname)); //defines the function with the adminname we wanna get
GetPlayerName(tragetID, Playername, sizeof(Playername));[/CODE]
ok here is the sscanf that mean you making command that will be like /akill (id)(reason)
on other player
ok now we need make that only admin can use this command
do it
ok we done with it, if u not logged in Rcon so u cannot use this cmd
ok now we need add the reason like admin name: have been akilled tragetid: (reason)
ok ad this
Ok we soon will done
this message will send to eveyone
ok now we need add it
to kill the player after u type /akill
add this
SetPlayerHealth(tragetID, 0);
Ok now we done
NOTE
this is my first TUT so please don't be made
if you not like it so please leave this Section
i'm newbie to
Ok first go to your's ZCMD and do it
Код:
CMD:akill(playerid, params[])
add it on the Top of your server u will use it soon
Код:
new tragetID; new reason[64]; new str[128];
GetPlayerName(playerid, Adminname, sizeof(Adminname)); //defines the function with the adminname we wanna get
GetPlayerName(tragetID, Playername, sizeof(Playername));[/CODE]
ok here is the sscanf that mean you making command that will be like /akill (id)(reason)
on other player
Код:
if(sscanf(params, "us[64]", tragetID,reason)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /akill [playerid] [reason]");
do it
Код:
if(!IsPlayerAdmin(playerid)) SendClientMessage, COLOR_RED, "you are not admin");
Код:
if(!IsPlayerConnected(tragetID))//if u did /akill 0 hha and the player not connected so you will get message-> return SendClientMessage(playerid, COLOR_GREY, "Player is not connected!");
ok ad this
Код:
format(str, sizeof(str), "'%s' has been akill by administrator '%s'. Reason: %s ", Playername, Adminname, reason); //format the string we've defined to send the message, playername and adminname are used to receive the information about the names SendClientMessageToAll(COLOR_RED, str); //send that message to all
this message will send to eveyone
ok now we need add it
to kill the player after u type /akill
add this
SetPlayerHealth(tragetID, 0);
Ok now we done
NOTE
this is my first TUT so please don't be made
if you not like it so please leave this Section
i'm newbie to