How anti sk dont work? - 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: How anti sk dont work? (
/showthread.php?tid=630369)
How anti sk dont work? -
Pokemon64 - 13.03.2017
There is code, why its didn't work. I think i made everything fine.
Code:
if(IsPlayerInRangeOfPoint(killerid,2.0,Map[ZombieSpawnX],Map[ZombieSpawnY],Map[ZombieSpawnZ]) || IsPlayerInRangeOfPoint(killerid,2.0,Map[ZombieSpawn2X],Map[ZombieSpawn2Y],Map[ZombieSpawn2Z]))
{
SetPlayerHealth(killerid, 0); // my punishment for the Spawn Killer is Death.
new zmstring2[256],pNames[MAX_PLAYER_NAME];
GetPlayerName(killerid,pNames,sizeof(pNames));
format(zmstring2,sizeof(zmstring2),""COL_LIGHTBLUE">> %s has been killed for spawn killing.",pNames);
SendClientMessageToAll(-1,zmstring2);
}
Re: How anti sk dont work? -
Flamehaze7 - 13.03.2017
I never used 'RangeOfPoint' but here's how i'd do it:
Top of the code:
Code:
new AntiSK[MAX_PLAYERS];
OnPlayerConnect
Code:
AntiSK[playerid] = 0;
OnPlayerSpawn
Code:
AntiSK[playerid] = 1;
SetTimerEx("AntiSpawnKill",5000,false,"d",playerid);
Code:
public AntiSpawnKill(playerid)
{
AntiSK[playerid] = 0;
}
OnPlayerTakeDamage
Code:
if(AntiSK[playerid] == 1) SetPlayerHealth(issuerid, 0);
That should work just fine
Re: How anti sk dont work? -
Pokemon64 - 13.03.2017
Quote:
Originally Posted by Flamehaze7
I never used 'RangeOfPoint' but here's how i'd do it:
Top of the code:
Code:
new AntiSK[MAX_PLAYERS];
OnPlayerConnect
Code:
AntiSK[playerid] = 0;
OnPlayerSpawn
Code:
AntiSK[playerid] = 1;
SetTimerEx("AntiSpawnKill",5000,false,"d",playerid);
Code:
public AntiSpawnKill(playerid)
{
AntiSK[playerid] = 0;
}
OnPlayerTakeDamage
Code:
if(AntiSK[playerid] == 1) SetPlayerHealth(issuerid, 0);
That should work just fine
|
Ok thanks i will do how you said, bat maybe you can explain why "RangeOfPoint" are bad?
Re: How anti sk dont work? -
Toroi - 13.03.2017
Quote:
Originally Posted by Pokemon64
Ok thanks i will do how you said, bat maybe you can explain why "RangeOfPoint" are bad?
|
It's not bad at all, although the way you wanted to use it was not fit for it, as if the player who dies run to the spawn point even 5 min after spawning, it'd take it as a spawn kill aswell.
(also, i think the reason it does not work is because 2.0 for range is too small)
FlameHaze7's way is better.
Re: How anti sk dont work? -
Flamehaze7 - 13.03.2017
Quote:
Originally Posted by Pokemon64
Ok thanks i will do how you said, bat maybe you can explain why "RangeOfPoint" are bad?
|
I never said RoP is bad, it's just that it doesn't make much sense to kill people that go in that zone in my opinion (I don't know how's your script)
Re: How anti sk dont work? -
Pokemon64 - 13.03.2017
Quote:
Originally Posted by Flamehaze7
I never said RoP is bad, it's just that it doesn't make much sense to kill people that go in that zone in my opinion (I don't know how's your script)
|
Well okay thanks for information. I will test it and let you know how it work.