Auto kill after 15 sec
#9

pawn Код:
#include <a_samp>

new pKill[MAX_PLAYERS];
new pCount[MAX_PLAYERS];

public OnFilterScriptInit()
{
    SetTimer("Area_Check", 5000, true);
}

forward Area_Check();
public Area_Check()
{
    for(new i; i < MAX_PLAYERS +1; i++)
    {
        if(IsPlayerInArea(i, 997, 917, 2046, 2182))
        {
            if(!IsPlayerAdmin(i))
            {
                pKill[i] = SetTimerEx("KillTime", 15000, false, "i", i);
            }
        }
        else if(!IsPlayerInArea(i, 997, 917, 2046, 2182))
        {
            KillTimer(pKill[i]);
            pCount[i] = 15;
        }
    }
    return 1;
}

forward KillTime(playerid);
public KillTime(playerid)
{
    pCount[playerid]--;
    if(pCount[playerid] > 15)
    {
        SetPlayerHealth(playerid, 0.0);
        pCount[playerid] = 15;
    }
}

stock IsPlayerInArea(playerid, Float:minx, Float:maxx, Float:miny, Float:maxy)
{
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
if (x > minx && x < maxx && y > miny && y < maxy) return 1;
return 0;
}
Reply


Messages In This Thread
Auto kill after 15 sec - by Larsey123IsMe - 08.11.2010, 16:35
Re: Auto kill after 15 sec - by Cameltoe - 08.11.2010, 16:37
Re: Auto kill after 15 sec - by Larsey123IsMe - 08.11.2010, 16:40
Re: Auto kill after 15 sec - by Cameltoe - 08.11.2010, 16:45
Re: Auto kill after 15 sec - by The_Moddler - 08.11.2010, 16:47
Re: Auto kill after 15 sec - by Larsey123IsMe - 08.11.2010, 17:03
Re: Auto kill after 15 sec - by Cameltoe - 08.11.2010, 17:04
Re: Auto kill after 15 sec - by Larsey123IsMe - 08.11.2010, 17:10
Re: Auto kill after 15 sec - by Cameltoe - 08.11.2010, 17:16
Re: Auto kill after 15 sec - by Larsey123IsMe - 08.11.2010, 18:05

Forum Jump:


Users browsing this thread: 1 Guest(s)