SA-MP Forums Archive
[Tutorial] Make Simple Anti SpawnKill - 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] Make Simple Anti SpawnKill (/showthread.php?tid=418246)



Make Simple Anti SpawnKill - MehranGta - 24.02.2013

Hi
This Is my first tutorial to how can u make a simple anti spawnkill for your server:

1.goto your gamemode (.pwn) and find on top of that add this:
Code:
#define COLOR_GREEN 0x00FF00FF
[this define green color]

2.goto your gamemode (.pwn) and search for "forward"
under the new make this :
Code:
forward aspawnkill(playerid)
[this already show what do]

3. search for onplayerspawn and under that add this
Code:
SetPlayerHealth(playerid,99999);
SetTimer("aspawnkill",15000,false);
SendClientMessage(playerid,COLOR_GREEN,"Antisp: You are protected by server for 15 seconds.");
[this do : 1.set health of player to 9999 that any one cant kill for 15 seconds set timer for start 15 sec and send client message for send a message for this anti spawnkill]

4.at the final of the script add this :
Code:
public aspawnkill(playerid)
{
SetPlayerHealth(playerid,100.0);
SendClientMessage(playerid,COLOR_GREEN,"The Anti-time Spawn Kill over");
}
[it already back health of player to 100 and send player the spawnkill over]


sorry for my bad english.


Re: Make Simple Anti SpawnKill - JaKe Elite - 24.02.2013

This is bad tutorial.
You need to use SetTimerEx for all timers who uses a parameters.
Plus, you must teach scripters to have a good indentation not a bad indentation
3rd, You didn't explain what the function do, You just paste the code.
And tell them what to do, But what? No Explanations

-rep


Re: Make Simple Anti SpawnKill - Gamer_007 - 24.02.2013

Quote:
Originally Posted by MehranGta
View Post

3. search for onplayerspawn and under that add this
Code:
SetPlayerHealth(playerid,99999;
SetTimer("aspawnkill",15000,false);
SendClientMessage(playerid,COLOR_GREEN,"Antisp: You are protected by server for 15 seconds.");
You made a mistake here
pawn Code:
SetPlayerHealth(playerid,99999;
It should be
pawn Code:
SetPlayerHealth(playerid,99999);
-Rep.And U didnt expalined well.


Re: Make Simple Anti SpawnKill - RajatPawar - 24.02.2013

"Go there."
"Find that. Put this there."
"Then do that."
What the .. Try explaining it, rather than instructing.


Re: Make Simple Anti SpawnKill - MehranGta - 24.02.2013

fixed :
expalined
fixed a mistake on SetPlayerHealth(playerid,99999);
[this is my first tutorial don't rigor to me ]
but thanks for say mistakes


Re: Make Simple Anti SpawnKill - JaKe Elite - 24.02.2013

What the,
Setting player health to 99999. i don't call that a spawn protection.
There is a float number for infinite health.


Re: Make Simple Anti SpawnKill - MehranGta - 24.02.2013

this set player health to 9999 for that anyone can't kill you
for 15 sec
this is for tdm server to stop spawnkilling and baseraping
know what did i said?


Re: Make Simple Anti SpawnKill - rangerxxll - 11.03.2013

I think the tutorial could've been explained better. Better explanation on what the code means, and does. And next tutorial (Assuming you make another.) use [pawn] instead of [code]


Re: Make Simple Anti SpawnKill - LarzI - 11.03.2013

This is a "copy this, do that" guide, not a tutorial. In the future learn how it works, why it works, and be sure to explain it when putting up a tutorial.

I recommend looking at Y_Less' guide for making tutorials, here: https://sampforum.blast.hk/showthread.php?tid=65567.


Re: Make Simple Anti SpawnKill - DaTa[X] - 21.03.2013

ya nice work mehranGTA nice work