Gang zone - 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: Gang zone (
/showthread.php?tid=122963)
Gang zone -
bluray - 24.01.2010
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.
Re: Gang zone -
bluray - 24.01.2010
So Sorry to bump this post, but i changed the question a bit so might be easier to help with.
Re: Gang zone -
mansonh - 24.01.2010
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
Re: Gang zone -
bluray - 24.01.2010
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
Re: Gang zone -
mansonh - 24.01.2010
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);
}
}
}