[HELP]Anti Spawnkill problem
#1

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.
Reply
#2

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;
}
Reply
#3

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.
Reply
#4

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

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

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

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;
    }
Reply
#8

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
Reply
#9

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
Reply
#10

killertime(timerid)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)