death zone
#1

i need a a scripft where i can put someone name into a script and they can go into a sertain place but if they dont have the right name they get killed when they tryed to enter
Reply
#2

Script Request Thread.
Reply
#3

Use PlayerToPoint .... when someone enters the Area ..... Check his name with strcmp ... if the name is matched, then do nothing..but if he/she have a wrong name, then set his/her Health to 0.
Reply
#4

i dont know how to use playertopoint
Reply
#5

actuly come to think of it i dont understand any of it
Reply
#6

you want to check rectangluar area or Circular? I will try to make it for you
Reply
#7

Circular
Reply
#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
#9

@Abhinav: Just a question, why did you include the unused functions? They're useless if they're unused.
Reply
#10

I thought I would add something in them..but I didnt .. :P
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)