[Tutorial] Make Simple Anti SpawnKill
#1

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.
Reply
#2

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
Reply
#3

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.
Reply
#4

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

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

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

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?
Reply
#8

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]
Reply
#9

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.
Reply
#10

ya nice work mehranGTA nice work
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)