problem (big) - 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)
+--- Thread: problem (big) (
/showthread.php?tid=405066)
problem (big) -
CBCandyBoy - 05.01.2013
hello everyone
i made an admin island for my server and im in problem there is a road which goes into that area i want that if someone (non-admin) enters that area
he get killed automatically
look its not an interior like admin area it an island made by me and there is a road whgich connects it i want ifd any non admin entrs that area he automatically gets killed
Re: problem (big) -
Infinity90 - 05.01.2013
https://sampforum.blast.hk/showthread.php?tid=235122
Then Check if the player is a admin... if(IsPlayerAdmin(playerid)) .... Then SetPlayerHealth(playerid,0);
Re: problem (big) -
DaRk_RaiN - 05.01.2013
Pu this at the bottom of your script
pawn Код:
IsPlayerInArea(playerid, Float:MinX, Float:MinY, Float:MaxX, 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;
}
Now get the coordination of that area there are a lot of tutorials for that, after you get done with that use
OnPlayerUpdate to check if he is in the area
Put this in a timer or in OnplayerUpdate.
pawn Код:
if(IsPlayerInArea(playerid,MaxX,MaxY,MinX,MinY)&& !=IsPlayerAdmin(playerid))//change the MaxX,MaxY,MinX,MinY to the real cords
{//This will only allow Rcon admin to get into the area, if you have an admin system, change IsPlayerAdmin
SetPlayerHealth(playerid,0);//Kills the player
SendClientMessage(playerid,-1,"this area is only for admins);//bla bla
return 1;
}
Re: problem (big) -
CBCandyBoy - 05.01.2013
man i cant under stand first i have to make something like a zone or something because cords are of just a point on map
Re: problem (big) -
DaRk_RaiN - 05.01.2013
Yes would be easier if you make a temp zone to make sure the coords work.
Re: problem (big) -
CBCandyBoy - 05.01.2013
np i can make a adminonly gate btw do u know how to make always moving objects // objects which are always moving
Re: problem (big) -
DaRk_RaiN - 05.01.2013
Yes use
MoveObject function
Also check some tutorials.
Re: problem (big) -
CBCandyBoy - 05.01.2013
i know about move object but wb always moving object