SA-MP Forums Archive
help - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: help (/showthread.php?tid=266168)



help - Loading... - 03.07.2011

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


Re: help - [L3th4l] - 03.07.2011

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
}



Re: help - admantis - 03.07.2011

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;
}



Re: help - Loading... - 03.07.2011

where i add the staf are pos