Not working
#1

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);
 }
    }
    }
Reply
#2

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
Reply
#3

can you plz make thtem positive?
Reply
#4

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
Reply
#5

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);
        }
    }
}
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)