SA-MP Forums Archive
[HELP]Anti Spawnkill problem - 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: [HELP]Anti Spawnkill problem (/showthread.php?tid=453999)



[HELP]Anti Spawnkill problem - qazwsx - 27.07.2013

Hi guys, ive made some Script For Anti Spawnkill protection.
Here is the code :

Код:
public OnPlayerRequestClass(playerid)
{
SetPlayerHealth(playerid, 1000000);
	SetTimerEx("endspawnkillprotect", 5000, false, "i", playerid);
	SendClientMessage(playerid, COLOR_BRIGHTRED, "Youre Protected by Anti Spawnkill Now");
	return 1;
}
And here is the endspawnkillprotect
Код:
public endspawnkillprotect(playerid)
{
SetPlayerHealth(playerid, 100.0);
SetPlayerArmor(playerid, 100.);
}
Here is the error code when i compiled it:
Код:
E:\Rockstar Games\GTA San Andreas\samp03x_svr_R1-2_win32_3\gamemodes\owntdm.pwn(116) : warning 217: loose indentation
E:\Rockstar Games\GTA San Andreas\samp03x_svr_R1-2_win32_3\gamemodes\owntdm.pwn(117) : warning 217: loose indentation
E:\Rockstar Games\GTA San Andreas\samp03x_svr_R1-2_win32_3\gamemodes\owntdm.pwn(175) : error 025: function heading differs from prototype
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.



Re: [HELP]Anti Spawnkill problem - ScRipTeRi - 27.07.2013

pawn Код:
public OnPlayerRequestClass(playerid)
{
SetPlayerHealth(playerid, 1000000);
    SetTimerEx("endspawnkillprotect", 5000, false, "i", playerid);
    SendClientMessage(playerid, COLOR_BRIGHTRED, "Youre Protected by Anti Spawnkill Now");
    return 1;
}
public endspawnkillprotect(playerid)
{
SetPlayerHealth(playerid, 100.0);
SetPlayerArmor(playerid, 100.0);
return 1;
}



Re: [HELP]Anti Spawnkill problem - qazwsx - 27.07.2013

Quote:
Originally Posted by ScRipTeRi
Посмотреть сообщение
pawn Код:
public OnPlayerRequestClass(playerid)
{
SetPlayerHealth(playerid, 1000000);
    SetTimerEx("endspawnkillprotect", 5000, false, "i", playerid);
    SendClientMessage(playerid, COLOR_BRIGHTRED, "Youre Protected by Anti Spawnkill Now");
    return 1;
}
public endspawnkillprotect(playerid)
{
SetPlayerHealth(playerid, 100.0);
SetPlayerArmor(playerid, 100.0);
return 1;
}
Whats the different? -_-
What you wrote, is what have i wrote in my gamemode lol.


Re: [HELP]Anti Spawnkill problem - ScRipTeRi - 27.07.2013

SetPlayerArmor(playerid, 100.); this was your and SetPlayerArmor(playerid, 100.0); min this was diferent


Re: [HELP]Anti Spawnkill problem - qazwsx - 27.07.2013

I changed the script like yours but it is still show me the same error


Re: [HELP]Anti Spawnkill problem - MellowHammer - 27.07.2013

Make sure you have this line in your script:
pawn Код:
forward endspawnkillprotect(playerid);



Re: [HELP]Anti Spawnkill problem - ScRipTeRi - 27.07.2013

pawn Код:
forward SpawnProtection(playerid);
public OnPlayerSpawn(playerid)
{
//Protected
    SetTimerEx("SpawnProtection",5000,0,"i",playerid);
    SetPlayerHealth(playerid,99999);
return 1;
}
public SpawnProtection(playerid)
    {
    SetPlayerHealth(playerid,100.0);
    SetPlayerArmour(playerid,100.0);
    return 1;
    }



Re: [HELP]Anti Spawnkill problem - qazwsx - 27.07.2013

Quote:
Originally Posted by MellowHammer
Посмотреть сообщение
Make sure you have this line in your script:
pawn Код:
forward endspawnkillprotect(playerid);
Thanks mane
Lol, ive write that forward endspawnkillprotect(); without playerid


Re: [HELP]Anti Spawnkill problem - qazwsx - 27.07.2013

And guys, the problem is how can i stop my timmer?
The function is contionously running, and how i can stop it?
please give me the code


Re: [HELP]Anti Spawnkill problem - ScRipTeRi - 27.07.2013

killertime(timerid)