28.02.2015, 17:40
Hey Guys,
I have a Spawnprotection filterscript but if I use it, the server close the connection after spawnprotection is over.\
I have a Spawnprotection filterscript but if I use it, the server close the connection after spawnprotection is over.\
PHP код:
//> [FS] Spawn Protection - By HotStyle <//
#include <a_samp>
#define PROTECTION 30 // Edit here the 'seconds' if you want
forward AntiSpawnkill(playerid);
public OnFilterScriptInit()
{
print("\n__________________________________________");
print(" Spawn Protection - loaded ");
print(" By: HotStyle ");
print("__________________________________________\n");
return 1;
}
public OnPlayerSpawn(playerid)
{
SetPlayerHealth(playerid, 10000.0);
new str[128];
format(str, sizeof(str), "You can't be killed for %d second(s) - Spawn Protection", PROTECTION);
SendClientMessage(playerid, 0xFF0000AA, str);
SetPlayerChatBubble(playerid, "Anti-Spawnkill protected player", 0xFF0000AA, 100.0, 5000);
SetTimerEx("AntiSpawnkill",PROTECTION*1000,0,"d",playerid);
return 1;
}
public AntiSpawnkill(playerid)
{
SetPlayerHealth(playerid, 100.0);
SendClientMessage(playerid, 0xFF0000AA, "Spawn Protection Over - Move if you're unprotected");
return 1;
}