#1

i wanna make a fonction like if people step in the area it says welcome admin and they get full acces and if a non admin it says get out you got 5 second or die and it kill theym
Reply
#2

I suggest to use Incognito's streamer, it has a great area detection system.

pawn Код:
public OnPlayerEnterDynamicArea(playerid, areaid) // I think this is how it goes, I forgot ^^
{
    if(areaid == ADMIN_AREA)
    {
        if(IsPlayerAdmin(playerid)) // If he's admin
        {
            SendClientMessage(playerid, -1, "Welcom admin!");
        }
        else SendClientMessage(playerid, -1, "You have 5 seconds to get the fuck out!"), SetTimerEx("KillNoob", 5000, false, "i", playerid);
    }
    return 1;
}

forward KillNoob(playerid);
public KillNoob(playerid)
{
    return SetPlayerHealth(playerid, 0.0); // Or do whatever you want to that noob
}
Reply
#3

If you can't bother downloading the plugin use this code.

pawn Код:
public OnPlayerUpdate(playerid)
{
     if (IsPlayerInArea(playerid, areaminx, areamaxx, areaminy, areamaxy)) // change the parameters
     {
         if (IsPlayerAdmin(playerid)) {
               SendClientMessage(playerid, -1, "Welcome to the admin area");
         }else{
               SendClientMessage(playerid, -1, "You are not an admin to enter the admin area!"),
               SetPlayerHealth(playerid, -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;
    return 0;
}
Reply
#4

where i add the staf are pos
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)