Not working - 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: Not working (
/showthread.php?tid=136041)
Not working -
bartje01 - 22.03.2010
Hey guys. I made /challange in a dialog now.
Well. IT has to be like if you aren't inn that zone you it says: YOu are not in grove street.
Well for case 0 it works fine.
If you are not in it. It tells you the message. Else the gang zone will flash.
But with case 1 it just flashes and I don't have a message when I do it out of the zone. Why?
Код:
if(dialogid == 29430)
switch(listitem)
{
case 0:
{
//GROVEZONE
new Float:X,Float:Y,Float:Z;
GetPlayerPos(playerid, X,Y,Z);
if (X <= 2235.0000 && X >= -1729.0000 && Y <= 2501.0000 && Z >= -1642.0000)
{
SendClientMessage(playerid, red, "You must be at grove street");
}
else
{
GangZoneFlashForAll(GroveZone,0xFF0000FF);
}
}
case 1:
{
//lspZONE
new Float:X,Float:Y,Float:Z;
GetPlayerPos(playerid, X,Y,Z);
if (X <= 1326.343 && X >= -1887.144 && Y <= 1702.824 && Z >= -1575.273)
{
SendClientMessage(playerid, red, "You must be at Pershing Sqaure");
}
else
{
GangZoneFlashForAll(LspZone,0xFF0000FF);
}
}
}
Re: Not working -
XGh0stz - 23.03.2010
Double check your Case 1 Cordinates & remember negative Cordinates can be tricky...
>= 50.0 && <= 100.0
VS.
<= -50.0 && >= -100.0
Otherwise, I don't see a problem
Re: Not working -
bartje01 - 23.03.2010
can you plz make thtem positive?
Re: Not working -
XGh0stz - 23.03.2010
Alright, let's just start with the 4 borders, which you only have 3 currently...
I see you have a starting X and also a ending X, but you only have 1 Y...
You need to have that 2nd Y Position...
+++++ <- Y Position
+ +
+ +
+++++ <- Y Postion ( You only have one Y Position when you should have 2! )
^ ^
| |
X X
P P
o o
s s
An example of what you need:
if ( X >= 500 && X<= 600 && Y >= 500 && Y <= 600 ) // Notice you have 4 borders here defining your area, you need to get the other Y Position for your code
The Z cord isnt important, you may remove it if you want
Re: Not working -
MadeMan - 23.03.2010
Replace the Z with Y
pawn Код:
if(dialogid == 29430)
switch(listitem)
{
case 0:
{
//GROVEZONE
new Float:X,Float:Y,Float:Z;
GetPlayerPos(playerid, X,Y,Z);
if (X <= 2235.0000 && X >= -1729.0000 && Y <= 2501.0000 && Y >= -1642.0000)
{
SendClientMessage(playerid, red, "You must be at grove street");
}
else
{
GangZoneFlashForAll(GroveZone,0xFF0000FF);
}
}
case 1:
{
//lspZONE
new Float:X,Float:Y,Float:Z;
GetPlayerPos(playerid, X,Y,Z);
if (X <= 1326.343 && X >= -1887.144 && Y <= 1702.824 && Y >= -1575.273)
{
SendClientMessage(playerid, red, "You must be at Pershing Sqaure");
}
else
{
GangZoneFlashForAll(LspZone,0xFF0000FF);
}
}
}