SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help > Tutorials

Thread Tools Display Modes
Old 16/06/2013, 12:47 PM   #1
Big Clucker
BlackHorse's Avatar
Join Date: Feb 2013
Location: tunnle of zombies
Posts: 63
Reputation: 4
Default How to make Anti-SpawnKill

In this i learn to you that how to make Anti-SpawnKill
Let's Get Started
First add include a_samp because it have many things that is important for our tutorial
PHP Code:
#include a_samp 
Than see public OnPlayerSpawn(playerid) because SpawnKill means killing when spawn so, we need to do on spawn
PHP Code:
public OnPlayerSpawn(playerid
And then add this
PHP Code:
Why this because when player spawn they have 100 health as default so, setting their health to 999999 is good idea so spawn killers can't kill him and we do more steps to setting their health to 100 after 10 seconds
PHP Code:
Why this because this is a function of time in which things came into movement after the seconds i type now what is EndAntiSpawnkill, This is the name of a thing which can be used in public because how computer know what happen You can change this 10000, it's milliseconds of the time after the process attempt this is time of when 10000 milliseconds gone after spawn you can change true, it means it's start really if we change to false it means timer can't i, it means intergel number because 10000 is in intergel You can change this if you haven't intergel playerid, the playerid which spawn and get this if we do only one number so, it's only for him not for all
Now make a forward for public i already said you of public because without forward we can't change a function into public if it is not in an include if you typed any other thing at EndAntiSpawnKill use that you typed not which i typed
PHP Code:
forward EndAntiSpawnKill(playerid
Now we created a forward for a public function now we can use that on public
PHP Code:
public EndAntiSpawnKill(playerid
Now we Created a public and now let's do what happen.We need to add this and any other thing you want
PHP Code:

Why this? Because with this player health will replace to 100 and i typed SetPlayerHealth(playerid, 999999); it means player health setted to 999999 and if we don't replace his health to 100.The player will kill the opponets and others cant kill him.


BlackHorse is offline   Reply With Quote
Old 16/06/2013, 04:23 PM   #2
Glad2BeHere's Avatar
Join Date: Oct 2012
Posts: 771
Reputation: 136
Default Re: How to make Anti-SpawnKill

pawn Code:
SetTimerEx("EndAntiSpawnKill", 10000, true, "i", playerid);  //u realize that this is set to true which means the timer never ends

//should be
SetTimerEx("EndAntiSpawnKill", 10000, false, "i", playerid);
Glad2BeHere is offline   Reply With Quote
Old 13/07/2017, 02:48 AM   #3
Join Date: Feb 2017
Posts: 554
Reputation: 8
Default Re: How to make Anti-SpawnKill

Good Job
GuilhermeNunes is offline   Reply With Quote

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
[FilterScript] Anti-SpawnKill BlackHorse Filterscripts 1 16/06/2013 06:23 AM
[FilterScript] Anti-SpawnKill V:0.1 ACI Filterscripts 7 27/03/2013 11:29 AM
[Tutorial] Make Simple Anti SpawnKill MehranGta Tutorials 10 25/03/2013 03:54 PM
[FilterScript] Simple Anti-Spawnkill SublimESmokeR420 Filterscripts 15 26/04/2012 06:42 PM

All times are GMT. The time now is 05:53 PM.

Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.