pawn Код:
#include <a_samp>
forward AntiSpawnkill(playerid);
public OnFilterScriptInit() { print("\n--------------------------------------"), print("* Anti-Spawnkill by Mean loaded"), print("--------------------------------------\n"); return 1;}
public OnPlayerSpawn(playerid) { SetPlayerHealth(playerid, 10000.0), SendClientMessage(playerid, 0xFF0000AA, "You have 10 seconds of Anti-Spawnkill protection"), SetPlayerChatBubble(playerid, "Anti-Spawnkill protected player", 0xFF0000AA, 100.0, 10000),SetTimerEx("AntiSpawnkill",10000,0,"d",playerid);}
public AntiSpawnkill(playerid) { SetPlayerHealth(playerid, 100.0), SendClientMessage(playerid, 0xFF0000AA, "Anti-Spawnkill protection over, you are on your own now");}
5 lines now :P
(was bored)
maybe an suggestion:
pawn Код:
#include <a_samp>
#define PROTECTIONTIME 10 //Inseconds
forward AntiSpawnkill(playerid);
public OnFilterScriptInit()
{
print("\n--------------------------------------");
print("* Anti-Spawnkill by Mean loaded");
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)", PROTECTIONTIME);
SendClientMessage(playerid, 0xFF0000AA, str);
SetPlayerChatBubble(playerid, "Anti-Spawnkill protected player", 0xFF0000AA, 100.0, 10000);
SetTimerEx("AntiSpawnkill",PROTECTIONTIME*1000,0,"d",playerid);
return 1;
}
public AntiSpawnkill(playerid)
{
SetPlayerHealth(playerid, 100.0);
SendClientMessage(playerid, 0xFF0000AA, "Anti-Spawnkill protection over, you are on your own now");
return 1;
}
Just that you can change the anti spawn kill time