Jump to content

[ TuT ] Vylepšené /kill


Recommended Posts

Nudil sem se, tak sem si v módu vylepšil /kill neni to nic moc, ale když na toho hráče máte /spec tak je to fakt prdel :d

 

1. způsob

 

do public OnPlayerCommandText(playerid, cmdtext[]) dejte

	if(strcmp(cmdtext, "/kill", true) == 0)
   {
   SetPlayerPos(playerid,154.7325,-1952.3965,42.7288); // to je na tom to hlavní 
   SetPlayerInterior(playerid,0); // aby mu to nebugovalo
   SetPlayerHealth(playerid,1.0); // aby ho to víc bolelo  :D
   GameTextForPlayer(playerid,"~r~sbohem !~r~",5000,5); // rozloučíme se s nim
   return 1;
  	}

 

2. způsob

nahoru do módu (pokud ještě nemáte)

#define dcmd(%1,%2,%3) if ((strcmp((%3)[1], #%1, true, (%2)) == 0) &&((((%3)[(%2) + 1] == 0) && (dcmd_%1(playerid, "")))||(((%3)[(%2) + 1] == 32) && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
#pragma tabsize 0

nahoru do OnPlayerCommandText

dcmd(kill,4,cmdtext);

dolů do módu ! hlavně ne do publicu !

dcmd_kill(playerid, params[])
{
#pragma unused params
SetPlayerPos(playerid,154.7325,-1952.3965,42.7288); // to je na tom to hlavní 
   SetPlayerInterior(playerid,0); // aby mu to nebugovalo
   SetPlayerHealth(playerid,1.0); // aby ho to víc bolelo  :D
   GameTextForPlayer(playerid,"~r~sbohem !~r~",5000,5); // rozloučíme se s nim
return 1;
}

Link to comment
Share on other sites

Chápeš to bude nějaká demence :d...Nastaví mu HP na 1 a portnou ho někam do vzduchu a on jak spadne tak se zabije nebo něco takovýho :d

seš blízko, ale je to větší prdel, zkus to, jo a možná to ještě vylepšim :d

Link to comment
Share on other sites

  • 2 months later...

waaaaaaaaaaaaaaaaaaaaaaaw supeeer fakt nice nice tut takýto som hladal celý život

 

(sladká ironia...)

new Float:x, Float:y, Float:z;

GetPlayerPos(playerid, x, y, z);

SetPlayerPos(playerid,x,y,z+100);

Link to comment
Share on other sites

lepší:

dcmd_kill(playerid, params[]){
new Float:X, Float:Y, Float:Z;
GetPlayerPos(playerid, X,Y,Z);
for(new i=0; i< GetMaxPlayers(); i++){
if(IsPlayerConnected(i)){
if(GetPlayerWeapon(i) > 0){
if(IsPlayerInRangeOfPoint(i, 20, X,Y,Z)==1){
SendClientMessage(playerid, barva, "Nekdo je v blizkosti 20 metru se zbrani, diky zneuzivani se nemuzes zabit, protoze ma zbran !");
return break;
}
}
}
}
SetPlayerHealth(playerid, 0.0);
SendClientMessage(playerid, barva, "Uspesne zabit !");
return true;
}

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...