[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
#2

It's Simpel but usefull for some Servers
Reply
#3

here is xD i wrong button i press save xD
Reply
#4

Quote:
Originally Posted by gigi1223
View Post
my frist guide i have to make better one xD bye
Yeah you kinda have to, because this ain't a tutorial. I know I'm an asshole, but you really should explain what is what and why you're doing things.
Reply
#5

Maybe you can explain what the script will do
Reply
#6

ok wait i explain all
Reply
#7

now best?
Reply
#8

How is this any different then this?
Reply
#9

i cant download it so i cant see what is into ... link is broke ..

but the post he make give me a idea to make this tutorial ...



say
Not Found

Sorry, but this page can not be found.

Please contact us if you think this is a bug.
Otherwise, click here to return to our main page.
Reply
#10

Awesome post, Helped me a lot and it worked, Thanks
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)