please help me please!!!!!! -
lonako45 - 26.03.2012
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 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);
}
}
}
Re: please help me please!!!!!! -
The DeLuca - 26.03.2012
Код:
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.
Re: please help me please!!!!!! -
lonako45 - 26.03.2012
dosent work
Re: please help me please!!!!!! -
The DeLuca - 26.03.2012
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)
Re: please help me please!!!!!! -
lonako45 - 26.03.2012
What? you can get me the true code?
Re: please help me please!!!!!! -
The DeLuca - 26.03.2012
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);
}
}
}
Re: please help me please!!!!!! -
lonako45 - 26.03.2012
KINGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG
YOU KINGGGGGGGGG
What did you do??
Re: please help me please!!!!!! -
[ABK]Antonio - 26.03.2012
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)
Re: please help me please!!!!!! -
The DeLuca - 26.03.2012
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.
Re: please help me please!!!!!! -
lonako45 - 26.03.2012
Listen, I need more help just a little
I ask you a private message

You My brother!