Gang zone
#1

hey i am making an admin zone,
EDIT: Due to the lack of replies, can anyone just help me with this, so whoever isnt admin dies,
https://sampwiki.blast.hk/wiki/Areacheck
Would really love some help.
Thanks.
Reply
#2

So Sorry to bump this post, but i changed the question a bit so might be easier to help with.
Reply
#3

Well just check if the player is in the area using whatever system you want, then if the player isn't an admin then set their health to 0;
https://sampwiki.blast.hk/wiki/IsPlayerAdmin
https://sampwiki.blast.hk/wiki/SetPlayerHealth
Reply
#4

well first, umm the health thing is easy, but the area is the problem, do u know any way of using a area check. And also the isplayeradmin only works for RCONS im guessing, but i use a diff admin system, so idk how to get it to work for them
Reply
#5

Area check can be easily done. If you don't already have an area check you can easily write a simple one or use previously created ones.
I don't know how your admin system works either, so thats up to you.

Two possibilities, use my hidden checkpoint system(See signature) below and create an admin checkpoint Square, or the following small script:

pawn Код:
/*      _________________ Point 2 North East;
       |        |
       |  This is   |
       | the area that |
       |  you want  |
       |  to define!  |
       |________________|
   Point 1 South West;
*/

new Float:X1 = , Float:X2 = , Float:Y1 = , Float:Y2 = ;

public OnFilterScriptInit()
{
  SetTimer("checkAdminZone", 1000, 1);
}

forward checkAdminZone();
public checkAdminZone()
{
  new Float:X, Float:Y, Float:Z;
  for(new playerid=0; playerid<GetMaxPlayers(); playerid++)
  {
    if(!IsPlayerConnected(playerid) || /*your admin check*/ ) continue;
    GetPlayerPos(playerid, X, Y, Z);
    if(X>X1 && X<X2 && Y>Y1 && Y<Y2)
    {
      SendClientMessage(playerid, 0xAAAAAAAA, "Admin area only, you die now!");
      SetPlayerHealth(playerid, 0.0);
    }
  }

}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)