death zone
#8

here is the code ..in this code you need to replace NAME with the name you want to allow to enter ..... also this will create Area 51 a locked one.
pawn Код:
/////////////////////////////////////////////////////
///////////// Script by Abhinav ////////////////////
///////////////////////////////////////////////////

#include <a_samp>

forward DeathZone();
new DZTimer;
new bool:Found[MAX_PLAYERS]=false;

public OnFilterScriptInit()
{
    DZTimer=SetTimer("DeathZone",100,1);
    GangZoneShowForAll(GangZoneCreate(95.0,1800.0,286.0,1940.0),0xEE3333FF);
    return 1;
}

public OnFilterScriptExit()
{
    KillTimer(DZTimer);
    return 1;
}

public OnPlayerConnect(playerid)
{
    return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
    return 1;
}

public OnPlayerSpawn(playerid)
{
    return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
    return 1;
}

public DeathZone(){
    for(new i;i<=MAX_PLAYERS;i++){
      Found[i]=false;
        if(IsPlayerConnected(i) && IsPlayerInArea(i,95.0,286.0,1800.0,1940.0)){
        if(!strcmp(GetPName(i),"NAME",false,8) && strlen(GetPName(i))==8) Found[i]=true; ///// chnage NAME to the desired name you want
        }
        if(!Found[i] && IsPlayerConnected(i) && IsPlayerInArea(i,95.0,286.0,1800.0,1940.0)){
            SetPlayerHealth(i,0);
            return 1;
        }
    }
   
    return 1;
}

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;
    }
    else{
      return 0;
    }
}

stock GetPName(playerid){
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
    return name;
}
Reply


Messages In This Thread
death zone - by sggassasin - 21.07.2009, 11:43
Re: death zone - by refshal - 21.07.2009, 12:37
Re: death zone - by abhinavdabral - 21.07.2009, 13:35
Re: death zone - by sggassasin - 22.07.2009, 07:05
Re: death zone - by sggassasin - 22.07.2009, 07:07
Re: death zone - by abhinavdabral - 22.07.2009, 08:46
Re: death zone - by sggassasin - 22.07.2009, 09:59
Re: death zone - by abhinavdabral - 22.07.2009, 15:44
Re: death zone - by refshal - 22.07.2009, 16:15
Re: death zone - by abhinavdabral - 23.07.2009, 00:40

Forum Jump:


Users browsing this thread: 6 Guest(s)