SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 24/02/2013, 06:59 AM   #1
MehranGta
Big Clucker
 
Join Date: Jul 2012
Location: CA - IR
Posts: 192
Reputation: -7
Default Make Simple Anti SpawnKill

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.

Last edited by MehranGta; 24/02/2013 at 08:05 AM. Reason: for fixing some problem
MehranGta is offline   Reply With Quote
Old 24/02/2013, 07:15 AM   #2
JaKe Elite
High-roller
 
JaKe Elite's Avatar
 
Join Date: Apr 2012
Location: Philippines
Posts: 3,687
Reputation: 486
Default Re: Make Simple Anti SpawnKill

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
__________________
Haven County Roleplay (Click here to join the server)
Discord: Click here to join our Discord
Website: Click here to register
____________________________
Discord: Corporal★Shepard#3135
JaKe Elite is offline   Reply With Quote
Old 24/02/2013, 07:25 AM   #3
Gamer_007
Gangsta
 
Gamer_007's Avatar
 
Join Date: Dec 2011
Location: Connecting...
Posts: 670
Reputation: 11
Default Re: Make Simple Anti SpawnKill

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.
Gamer_007 is offline   Reply With Quote
Old 24/02/2013, 07:29 AM   #4
RajatPawar
High-roller
 
RajatPawar's Avatar
 
Join Date: Aug 2011
Location: ヽ༼ຈل͜ຈ༽ノ
Posts: 2,179
Reputation: 311
Default Re: Make Simple Anti SpawnKill

"Go there."
"Find that. Put this there."
"Then do that."
What the .. Try explaining it, rather than instructing.
RajatPawar is offline   Reply With Quote
Old 24/02/2013, 08:13 AM   #5
MehranGta
Big Clucker
 
Join Date: Jul 2012
Location: CA - IR
Posts: 192
Reputation: -7
Default Re: Make Simple Anti SpawnKill

fixed :
expalined
fixed a mistake on SetPlayerHealth(playerid,99999);
[this is my first tutorial don't rigor to me ]
but thanks for say mistakes
MehranGta is offline   Reply With Quote
Old 24/02/2013, 08:43 AM   #6
JaKe Elite
High-roller
 
JaKe Elite's Avatar
 
Join Date: Apr 2012
Location: Philippines
Posts: 3,687
Reputation: 486
Default Re: Make Simple Anti SpawnKill

What the,
Setting player health to 99999. i don't call that a spawn protection.
There is a float number for infinite health.
__________________
Haven County Roleplay (Click here to join the server)
Discord: Click here to join our Discord
Website: Click here to register
____________________________
Discord: Corporal★Shepard#3135
JaKe Elite is offline   Reply With Quote
Old 24/02/2013, 02:09 PM   #7
MehranGta
Big Clucker
 
Join Date: Jul 2012
Location: CA - IR
Posts: 192
Reputation: -7
Default Re: Make Simple Anti SpawnKill

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?
MehranGta is offline   Reply With Quote
Old 11/03/2013, 09:49 PM   #8
rangerxxll
Gangsta
 
rangerxxll's Avatar
 
Join Date: Aug 2011
Posts: 882
Reputation: 59
Default Re: Make Simple Anti SpawnKill

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]
__________________

Server Website: http://www.pgagaming.net/forums/
Server IP:87.98.241.207:7024
rangerxxll is offline   Reply With Quote
Old 11/03/2013, 10:19 PM   #9
LarzI
High-roller
 
LarzI's Avatar
 
Join Date: Apr 2007
Location: Norway
Posts: 2,628
Reputation: 136
Default Re: Make Simple Anti SpawnKill

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 ******' guide for making tutorials, here: http://forum.sa-mp.com/showthread.php?t=65567.
__________________


NEW: [FS] Simple Cellphones

if( strfind( title, "REP", true ) != -1 )
{________________________________________
Sigh();__________________________
}________________________________________


LarzI is offline   Reply With Quote
Old 21/03/2013, 05:21 AM   #10
DaTa[X]
Banned
 
Join Date: Aug 2012
Posts: 374
Reputation: 39
Default Re: Make Simple Anti SpawnKill

ya nice work mehranGTA nice work
DaTa[X] is offline   Reply With Quote
Reply

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] Simple Anti-Spawnkill SublimESmokeR420 Filterscripts 15 26/04/2012 07:42 PM
[FilterScript] Simple Anti-Spawnkill for 10 seconds Mean Filterscripts 15 11/02/2012 11:03 PM
[Tutorial] How to make a very simple Anti-Spawn Kill ViruZZzZ_ChiLLL Tutorials 9 08/08/2010 11:42 AM
[FilterScript] [FS]LiL - (LuX In Log) (+Save information in Log) +Anti(SpawnKill,DriveBy,Spam) LuxurioN™ Filterscripts 15 11/01/2010 03:32 PM


All times are GMT. The time now is 05:51 AM.


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