SA-MP Forums Archive
Anti Spawn Killing - 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)
+--- Thread: Anti Spawn Killing (/showthread.php?tid=362018)



Anti Spawn Killing - [FBI]M.Vulture[XAC] - 23.07.2012

Hi all,
I made my first Include but i dont know if it work, because my server isnt workind (idk why)

This is the code:

Код:
#if defined _antisk_included
    #endinput
#endif
#define _antisk_included
#include <a_samp>
#include <a_players>
forward AntiSK(playerid, ,killerid, Float:MinX, Float:MinY, Float:MaxX, Float:MaxY)
public AntiSK(playerid, killerid, Float:MinX, Float:MinY, Float:MaxX, Float:MaxY)
{
 	new Float:X, Float:Y, Float:Z;
    GetPlayerPos(playerid, X, Y, Z);
    if(X >= MinX && X <= MaxX && Y >= MinY && Y <= MaxY)
	{
		new string[128];
    	new name[MAX_PLAYER_NAME];
    	GetPlayerName(killerid, name, sizeof name);
        format(string, sizeof string, "%s has been kicked for spawn killing.",name);
        Kick(killerid);
		return 1;
    }
    return 0;
}
Then in the gamemode:

#include <AntiSK>

and in OnPlayerDeath(blabla):

AntiSK(playerid, killerid, Float:MinX, Float:MinY, Float:MaxX, Float:MaxY)

So the killer will be kicked, that will work good? or there is a bug?


Re: Anti Spawn Killing - [FBI]M.Vulture[XAC] - 23.07.2012

Quote:
Originally Posted by Xentiarox
Посмотреть сообщение
Try out the AntiSpawnKill feature provided by Gamer_Z's AntiCheatPlugin at http://gpb.******code.com/
1.- Thanks for answer
2.- Link Dont Work
3.- I want to know if THIS script work. i dont like to use 3rd person scripts


Re: Anti Spawn Killing - Kindred - 23.07.2012

I would probably work if they were at those coordinates.

The only problem is, if they were near the area and was killed, they would still be kicked.

I suggest making a timer and variable, set the variable to 1 or something when the timer starts, and if the player is killed, if the variable is 1, the killerid is kicked. After the timer is finished (make it like, 1-3 seconds maybe), it would reset the variable to 0 so the killerid will not be kicked.