Anti Spawn Kill

Started by Finch Real, Jun 19, 2016, 08:23 AM

Previous topic - Next topic

Finch Real

I have added this on PlayerSpawn

SP( player.ID );
But Whenever I spawn it shows error at console

attempt to call 'bool' on Line 707 which is SP( player.ID );

Function SP and SPoff

function SP( plr )
 {
 local player = FindPlayer(plr);
 AntiSP[ player.ID ] = "true";
  NewTimer( "SPoff", 5000, 1, player.ID );
  MessagePlayer( "[#daff00]Spawn Protection has been Enabled for 5 Seconds" , player );
 }
function SPoff( p )
{
local player = FindPlayer(p);
if(player){
AntiSP[ player.ID ] = "false";
MessagePlayer( "[#83bab3]Spawn Protection has been Disabled" , player );
}
}
My Snipet Showroom

http://pastebin.com/5KKuU5cg

.

Are we supposed to guess the line where that happened? Are we supposed to guess the remaining information about the error? If not, then I guess we're supposed to also not give a phuk about the topic and move on to better things.

If we can take the time to look through some foreign code and detect an issue. Then you scan also take your time to report the error properly. So we can get over this crap quicker.

But oh no. Why should things be that easy.
.

Finch Real

Updated Topic Error was on Line SP( player.ID );
My Snipet Showroom

http://pastebin.com/5KKuU5cg

Xmair

Change
AntiSP[ player.ID ] = "true";
AntiSP[ player.ID ] = "false";
to
AntiSP[ player.ID ] = true;
AntiSP[ player.ID ] = false;

Credits to Boystang!

VU Full Member | VCDC 6 Coordinator & Scripter | EG A/D Contributor | Developer of VCCNR | Developer of KTB | Ex-Scripter of EAD

Finch Real

Still Same Error attempt to call bool on same line
My Snipet Showroom

http://pastebin.com/5KKuU5cg

Kewun

#5
try changing
SP( player.ID );
to
SP( player );

+

  NewTimer( "SPoff", 5000, 1, player.ID );

to

  NewTimer( "SPoff", 5000, 1, player );

and those "true" "falses" without the " things

Finch Real

My Snipet Showroom

http://pastebin.com/5KKuU5cg

Kewun

did you add that AntiSP to class? i ment

AntiSP[ player.ID ] = YourClass();

Did you use an class or not?


Kewun

last thing would be

AntiSP[ player.ID ] =  "true";
AntiSP[ player.ID ] = "false";


change to

AntiSP[ player.ID ] = return true;
AntiSP[ player.ID ] = return false;

if doesnt help then idk :(

Kewun

#9
well,

AntiSK <- false;

function onPlayerSpawn(player)
{
AntiSK = true;
NewTimer("DisableSK" , 5500 , 1, player );
return 1;
}

function onPlayerHealthChange( player, lastHP, newHP )
{
if (AntiSK)
{
player.Health = 100;
}
}

function DisableSK(player)
{
AntiSK = false;
MessagePlayer("Anti spawn kill disabled", player )
}

tell me if works or not

KingOfVC

SP <- array( 100, null )

function onPlayerSpawn( player )
{
SP[ player.ID ] = time();
}

function onPlayerKill( killer , player, reason bodypart )
{
if( ( time() - SP[ player.ID ] ) < 10 )
{
/* take action against killer  */
}
}

KAKAN

And atlast, someone finally did it without timer.
oh no

Finch Real

My Snipet Showroom

http://pastebin.com/5KKuU5cg