[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
![Cheesy](images/smilies/biggrin.png)
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?
![huh](images/smilies/confused.gif)
The function is contionously running, and how i can stop it?
![huh](images/smilies/confused.gif)
please give me the code
Re: [HELP]Anti Spawnkill problem -
ScRipTeRi - 27.07.2013
killertime(timerid)