[Tutorial] How to make /kill cmd!
#1

Hi guys, my first tutorial xD

Код:
Indlude 
#include < a_samp >
#include < zcmd >
#include < sscanf2 >
Than wee need too check if is player admin!

Код:
if(PlayerInfo[playerid][pAdmin] >= 1)
Then
Код:
{
	new id,string[128];//'ID' is player who wee are going to kill
	if(sscanf(params, "u", id)) return SCM(playerid, -1, "Error:/kill [ID/Name]");
	if(!IsPlayerConnected(id)) return SCM(playerid, -1, "Error: Wrong ID!");//if player types wrong ID/name
	SetPlayerHealth(id,0); //we must use 'id' here or u are going to kill yourself :D
	format(string,sizeof(string),"Admin %s killed u!",GetName(playerid));//sends message to player!
	SCM(id,-1,string);
	format(string,sizeof(string),"You killed player %s!",GetName(pplayerid)); //sends message to admin who killed player
	SCM(playerid,-1,string);
}
and if u dont have GetName
Код:
stock GetName(playerid)
{
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
    return name;
}
As i said this is my first tutorial, im scripting about 3 months so please if i did something wrong in this command reply to mee.
and sorry for bad english

EDIT:Sorry add this on bottom of the command
Код:
        else
	{
		SCM(playerid, -1, "Only Admins!");
	}
Reply
#2

man if you going to make a tutorial at least make it nice and know what stuff does...

you didn't define SCM and things like that..


this is crap 1/10
Reply
#3

Okay, everybody have defined SCM, and i said what stuff does.
Reply
#4

Well... You didnt really explain what everything does mate, just trying to help you make your tutorial as detailed as possible, and it wouldn't hurt to add this,
pawn Код:
#define SCM SendClientMessage
Reply
#5

You can't just copy code out of your gamemode and say it's a tutorial.

Like Ihateyou said, you never showed us the define for 'SCM', you could have at least changed it to SendClientMessage for the purpose of the tutorial.
Reply
#6

Please stop making tutorials.

You're an embarrassment.
Reply
#7

okay,i just tryed to help
Reply
#8

I'll just add that you said let's check if the player's an admin with an enum variable yet you never showed someone how to actually make that enum variable or anything.
Reply
#9

Quote:
Originally Posted by Snipa
Посмотреть сообщение
Please stop making tutorials.

You're an embarrassment.
At least he is putting in effort to help the community.
Reply
#10

Lol is this /akill , generally , /kill is used for killing ourselves.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)