/*
Anti-Spawn Kill System
Made by: Buljak
*/
 
#include a_samp
 
 
//----------------------------------------------------------
public OnFilterScriptInit()
{
 
                print("\n---------------------------------------");
                print("          Anti - Spawn Kill                              ");
                print("         Made by: Buljak                           ");
                print("            L O A D E D                          ");
                print("---------------------------------------\n");
                return 1;
               
}
//----------------------------------------------------------
 
public OnFilterScriptExit()
{
        print("\n---------------------------------------");
                print("          Anti - Spawn Kill                              ");
                print("         Made by: Buljak                             ");
                print("          U N - L O A D E D              ");
                print("---------------------------------------\n");
                return 1;
}
 
public OnPlayerSpawn(playerid)
{
    SetPlayerAttachedObject(playerid, 0, 3280, 1, -0.575999, 0.120999, 0.000000, 2.200001, 88.200027, 0.000000, 1.000000, 1.000000, 1.000000, 0, 0);
        SetPlayerAttachedObject(playerid, 1, 3280, 1, 0.165000, 0.120999, 0.815999, 1.900000, -1.599957, 0.000000, 1.000000, 1.000000, 1.000000, 0, 0);
        SetPlayerAttachedObject(playerid, 2, 3280, 1, 0.209000, 0.150000, -0.759999, 1.900000, -1.599957, -0.200000, 1.000000, 1.000000, 1.000000, 0, 0);
        SetPlayerAttachedObject(playerid, 3, 3280, 1, 0.975000, 0.113999, 0.028000, 0.500001, -91.399932, -2.200000, 1.000000, 1.000000, 1.000000, 0, 0);
        SetPlayerAttachedObject(playerid, 4, 3280, 1, 0.218000, 0.946000, 0.031000, 91.100006, 179.800094, -0.899999, 1.000000, 1.000000, 1.000000, 0, 0);
        SetPlayerAttachedObject(playerid, 5, 3280, 1, 0.218000, -0.614999, -0.024999, 91.100006, 179.800094, -0.899999, 1.000000, 1.000000, 1.000000, 0, 0);
 
    SetPlayerHealth(playerid, 999999999.0);
    SendClientMessage(playerid, 0xCCFF00, "{FFFFFF}Imas {FF0000}10{FFFFFF} seconds  Anti-Spawn kill protection.");
    SetPlayerChatBubble(playerid, "Anti-Spawn kill protected player", 0xCCFF00, 100.0, 10000);
    SetTimerEx("AntiSpawnkill",10000,0,"i",playerid);
    SetTimerEx("DestroyObjects",10000,0,"i",playerid);
    return 1;
}
 
forward AntiSpawnkill(playerid);
public AntiSpawnkill(playerid)
{
    SetPlayerHealth(playerid, 100.0);
    SendClientMessage(playerid, 0xCCFF00, "{FFFFFF}Anti-Spawn kill protection off!");
    return 1;
}
 
forward DestroyObjects(playerid);
public DestroyObjects(playerid)
{
        RemovePlayerAttachedObject(playerid, 0);
        RemovePlayerAttachedObject(playerid, 1);
        RemovePlayerAttachedObject(playerid, 2);
        RemovePlayerAttachedObject(playerid, 3);
        RemovePlayerAttachedObject(playerid, 4);
        RemovePlayerAttachedObject(playerid, 5);
        return 1;
}