please help me please!!!!!!
#1

Guys!!
listen ,
I did they approach the area any time you explode until you die.
But that doesn't work for me, I have no Error or Warnings that doesn't do anything I was approaching the area.
The script code is:
PHP код:
public IsPlayerInArea(playerid,Floatdata[4])
{
    new 
Float:Pos[3];
     for(new 
0<500i++)
      {
           
GetPlayerPos(i,Pos[0],Pos[1],Pos[2]);
        if (
Pos[0] >= 1298.2169 && Pos[0] >= 1475.8424 && Pos[1] <= 2099.4082 && Pos[1] >= 2247.8201)
         {
            
CreateExplosion(Pos[0],Pos[1],Pos[2],12,10.0);
          }
    }

Reply
#2

Код:
public IsPlayerInArea(playerid,Floatdata[4])
{
    new Float:Pos[3];
    for(new i = 0; i <500; i++)
    {
        GetPlayerPos(i,Pos[0],Pos[1],Pos[2]);
   	if (Pos[0] >= 1298.2169 && Pos[0] <= 1475.8424 && Pos[1] <= 2099.4082 && Pos[1] >= 2247.8201)
     	{
      		CreateExplosion(Pos[0],Pos[1],Pos[2],12,10.0);
        }
   }
}
Try this. You had >= twice on the X coordinate.
Reply
#3

dosent work
Reply
#4

Oh I just saw the problem! You have it backwards on the second part for the Y coordinate.

Код:
if (Pos[0] >= 1298.2169 && Pos[0] <= 1475.8424 && Pos[1] >= 2099.4082 && Pos[1] <= 2247.8201)
Reply
#5

What? you can get me the true code?
Reply
#6

Sure bud, here you go! This should work for you.

Код:
public IsPlayerInArea(playerid,Floatdata[4])
{
    new Float:Pos[3];
    for(new i = 0; i <500; i++)
    {
        GetPlayerPos(i,Pos[0],Pos[1],Pos[2]);
   	if (Pos[0] >= 1298.2169 && Pos[0] <= 1475.8424 && Pos[1] >= 2099.4082 && Pos[1] <= 2247.8201)
     	{
      		CreateExplosion(Pos[0],Pos[1],Pos[2],12,10.0);
        }
   }
}
Reply
#7

KINGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG
YOU KINGGGGGGGGG
What did you do??
Reply
#8

pawn Код:
stock IsPlayerInArea(playerid, Float:Pos1X, Float:Pos1Y, Float:Pos2X, Float:Pos2Y)
{
    new Float:Pos[3];
    GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
    if(Pos[0] <= Pos1X && Pos[0] >= Pos2X)
    {
        if(Pos[1] <= Pos1Y && Pos[1] >= Pos2Y) return true;
        else return false;
    }
    else return false;
}
Then where ever it is...

pawn Код:
if(IsPlayerInArea(playerid, X1, Y1, X2, Y2)) //So we start the top at X1,Y1 then we go to the bottom for X2,Y2 (on the map)
{
    new Float:X, Float:Y, Float:Z;
    GetPlayerPos(playerid, X, Y, Z);
    CreateExplosion(X, Y, Z, 12,10.0);
}

So basically, something like this
pawn Код:
//X1 and Y1 will be the larger number'd coordinates
//X2 and Y2 will be the smaller number'd coordinates
if(IsPlayerInArea(playerid, 2099.4082, 2247.8201, 1475.8424, 1298.2169)) //So we start the top at X1,Y1 then we go to the bottom for X2,Y2 (on the map)
{
    new Float:X, Float:Y, Float:Z;
    GetPlayerPos(playerid, X, Y, Z);
    CreateExplosion(X, Y, Z, 12,10.0);
}

This is more practical than doing what you're doing...This way you can use it in other things too.



EDIT: lol I just notice I messed up your coords...

X1: 0 Y1: 0, X2: -10, Y2: -10 as an example... (will in theory create a box at 0, 0 to -10, -10)
Reply
#9

Haha, it was just a simple typo in the if statement. You had it backwards lol. I'm glad I could help, and rep if you want! If you need anymore help just ask on here.
Reply
#10

Listen, I need more help just a little
I ask you a private message
You My brother!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)