gangzone messages 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: gangzone messages help (
/showthread.php?tid=106790)
gangzone messages help -
kennyist - 05.11.2009
ive got a gangzone , but how can i make it so when you enter it a message appears?
Re: gangzone messages help -
dice7 - 05.11.2009
Use a timer + loop to check all the players positions and see if they're in the zone
Re: gangzone messages help -
kennyist - 05.11.2009
ummmm , how , thats way above my level of scripting.
Re: gangzone messages help -
Ritchie999 - 05.11.2009
i tried doing it using "strcmp" and "IsPlayerInArea" but it doesnt come up automatically, you have to type the command to see the message, and even so, you can still type it even if you are outside the area.. no one told me yet how to use a timer and loop
Re: gangzone messages help -
Nameless303 - 06.11.2009
Quote:
Originally Posted by Ritchie999
i tried doing it using "strcmp" and "IsPlayerInArea" but it doesnt come up automatically, you have to type the command to see the message, and even so, you can still type it even if you are outside the area.. no one told me yet how to use a timer and loop
|
This will show a gametext when your IN the gangzone. (Doesn't disappears until you get out the ganzone)
Код:
//Somewhere in your script
stock IsPlayerInArea(playerid,Float:minX,Float:minY,Float:maxX,Float:maxY)
{
new Float:pX,Float:pY,Float:pZ;
GetPlayerPos(playerid,pX,pY,pZ);
if(pX >= minX && pX <= maxX && pY >= minY && pY <= maxY) return 1;
else return 0;
}
//OnPlayerUpdate
public OnPlayerUpdate(playerid)
{
if(IsPlayerInArea(playerid,-210.2018, 1599.869, 548.8602, 2312.219)) //Same coords as your gangzone
{
GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~y~Location Gangzone", 3000, 3);
}
return 1;
}
Have fun with it (: