Spawnkill = Dead
#1

Hello, how to make that when someone spawnkill that he get killed automatic?
Reply
#2

Make an area using Incognito's Streamer and in OnPlayerDeath if the killerid is a valid player and the playerid is in that area, kill the killerid.
Reply
#3

get a timestamp for each player who spawns,
like this:


global var for players:
sktime[MAX_PLAYERS]=0;

in onplayerspawn:
sktime[playerid] = gettime();

now in onplayertakedamage:
if(gettime() - sktime[playerid] < 60) return // 60 = 1 min. Here do something to the issuerid

that'd be 1 min anti spawnkill in this example


btw. this method using gettime will only work until January 19, 2038
Reply
#4

No i just want that when he shot at the spawn players that he get automatic killed. how to do this?
Reply
#5

oh, okey.
we could do this the easy way,

just take the coords of your spawnpoint, for example 1234.1,1234.1,1234.2

and now in onplayertakedamage:
if(IsPlayerInRangeOfPoint(playerid, 10.0,1234.1, 1234.1, 1234.2)) SetPlayerHealth(issuerid,0.0);
Reply
#6

no need to kill just add spawn killl system No budy can do spawnkill
Код:
Public OnPlayerSpawn(Playerid)
{
   SetPlayerHealth(playerid, 99999.0);
    SetTimerEx("SpawnProtection", 10000, false, "i", playerid);
    SendClientMessage(playerid, COLOR_GREEN, "Anti Spawn Kill Started.");

}

public SpawnProtection(playerid)//Our Function we made.
{//Open Braket 4
    SetPlayerHealth(playerid, 100.0);// Setting the player a Normal Health. 100 change it to what you want.
    SendClientMessage(playerid, COLOR_RED, "Anti Spawn Kill Ended.");
    return 1;// Returning to True
}//Open Braket 4
Reply
#7

no i already had such a system and this sucks.
Reply
#8

Not tested but that should work
pawn Код:
new Protected[MAX_PLAYERS];
public OnPlayerSpawn(playerid)
{
    Protected[playerid] = 1;
    SetTimer("Endprotect",3000,false);//change 3000 to the protect time you want
    return 1;
}
forward Endprotect(playerid);
public Endprotect(playerid)
{
    Protected[playerid] = 0;
}

public OnPlayerDeath(playerid, killerid, reason)
{
    if(Protected[playerid] == 1)
    {
        SetPlayerHealth(killerid,0);
    }
    return 1;
}
Reply
#9

Код:
Antispawnkill(playerid); //put on onplayerspawn


stock Antispawnkill(playerid) //put on the bottom of the script
{
    new spawnkill;
    {
        SetPlayerHealth(playerid,99999);
	SendClientMessage(playerid, 0x00FF00AA, "You are now protected by anti spawn-kill!");
        SetTimerEx("StopAntiSpawnKill",5000,0,"i",playerid);
    }
    return spawnkill;
}

forward StopAntiSpawnKill(playerid);
public StopAntiSpawnKill(playerid)
{
    SetPlayerHealth(playerid,100);
    SendClientMessage(playerid, 0xFF0000AA, "Spawn kill protection is now over!");
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)