[Tutorial] How to make anti spawn kill
#1

Hi all! Welcome to my tutorial
How to make anti spawn kill!
my frist tutorial

this script is for make a Anti spawn kill when u spawn your life get to 99999 for 6 seconds
and you cant get killed by spawn killers (bad english -.-)

frist you have to open your gamemode or a new filterscript

Under
pawn Code:
#inculde <a_samp>
put..

pawn Code:
forward NoSpawnKill(playerid);
forward NoSpawnKill(playerid); = this is for forward a function in pawno you have 2 do this or you get a warning

ok now we have to put the player life to 999999 and make a timer for player of 6 second

to public OnPlayerSpawn(playerid)
and add this ...
pawn Code:
SetPlayerHealth(playerid,99999);
pawn Code:
SetTimerEx("NoSpawnKill",6000,0,"i",playerid);
SetPlayerHealth(playerid,99999); = this function is for set the player healt to one float you put (99999 is a float of life) this set the health only to the player make the command of function in this case player spawn

SetTimerEx("NoSpawnKill",6000,0,"i",playerid); = this is for set a timer for playerid is for call a function after some time in this case is 6 second 6000 millisecond

you have to make like this

pawn Code:
public OnPlayerSpawn(playerid)
{
    SetPlayerHealth(playerid,99999);
    SetTimerEx("NoSpawnKill",6000,0,"i",playerid);
    return 1;
}
now we have to create the function for put player life to 100 when timer is over

down of gamemode/filterscript or where u want no up of #include <a_samp> xD
put..
pawn Code:
public NoSpawnKill(playerid)
{
    SetPlayerHealth(playerid,100.0);
    return 1;
}
public NoSpawnKill(playerid) is a function this get called when player spawn and wait 6 seconds and then set player life to normal SetPlayerHealth(playerid,100.0);

if u want to add a message put under SetPlayerHealth(playerid,100.0);
pawn Code:
SendClientMessage(playerid,put a color here,"NoSpawnKill off you have 100.0 life now !");

my frist guide i have to make better one xD bye
Reply


Messages In This Thread
How to make anti spawn kill - by iJumbo - 23.09.2010, 12:28
AW: How to make anti spawn kill - by Ic3_T - 23.09.2010, 12:28
Re: How to make anti spawn kill - by iJumbo - 23.09.2010, 12:42
Re: How to make anti spawn kill - by Hiddos - 23.09.2010, 12:45
AW: How to make anti spawn kill - by Ic3_T - 23.09.2010, 12:45
Re: How to make anti spawn kill - by iJumbo - 23.09.2010, 12:46
Re: How to make anti spawn kill - by iJumbo - 23.09.2010, 12:53
Re: How to make anti spawn kill - by Scenario - 23.09.2010, 12:58
Re: How to make anti spawn kill - by iJumbo - 23.09.2010, 12:59
Re: How to make anti spawn kill - by Bolt3D08 - 15.12.2010, 21:13

Forum Jump:


Users browsing this thread: 1 Guest(s)