03.07.2011, 20:18
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
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
}
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;
}