SA-MP Forums Archive
[Tutorial] How to make /kill cmd! - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Tutorials (https://sampforum.blast.hk/forumdisplay.php?fid=70)
+---- Thread: [Tutorial] How to make /kill cmd! (/showthread.php?tid=536929)



How to make /kill cmd! - mirza1221 - 12.09.2014

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!");
	}



Re: How to make /kill cmd! - Ihateyou - 13.09.2014

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


Re: How to make /kill cmd! - mirza1221 - 13.09.2014

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


Re: How to make /kill cmd! - Abagail - 13.09.2014

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



Re: How to make /kill cmd! - Flake. - 13.09.2014

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.


Re: How to make /kill cmd! - Snipa - 13.09.2014

Please stop making tutorials.

You're an embarrassment.


Re: How to make /kill cmd! - mirza1221 - 13.09.2014

okay,i just tryed to help


Re: How to make /kill cmd! - Blast3r - 13.09.2014

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.


Re: How to make /kill cmd! - Khanz - 13.09.2014

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

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


Re: How to make /kill cmd! - Ricagor - 14.09.2014

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