Problem with IsPlayerInCube
#1

Well this is the script
Код:
stock IsPlayerInCube(playerid, Float:xmin, Float:ymin, Float:zmin, Float:xmax, Float:ymax, Float:zmax)
{
	new Float:x, Float:y, Float:z;
	GetPlayerPos(playerid, x, y, z);
	if(x > xmin && y > ymin && z > zmin && x < xmax && y < ymax && z < zmax)return 1;
	return 0;
}
Код:
 
public Mine()
{
for(new i=0; i<=MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) && IsPlayerInCube(i, 72.1256, 1544.2145, 15.7742, 75.2350, 1546.3352, 16.4206)) 
{
new Float:posx, Float:posy, Float:posz;
GetPlayerPos(i, posx, posy, posz);
SetPlayerHealth(i, 0);
CreateExplosion(posx, posy, posz, 3, 5);
}
}
return 1;
}
But it doesn't work. And i know that the problem is the function IsPlayerInCube because if i use IsPlayerInRangeOfPoint instead of it it works without problems. Well the problem is that i can't use that because the bomb must be hidden under a bridge but it doesn't have to explode who is over the bridge. So the only way is to use IsPlayerInCube.
Reply
#2

Um, it wont explode on the bridge, you have 3D coords, so..cant explain more, bad english. :P
Did you tried that it will explode on the bridge too?
Reply
#3

i think it would work if you add a timer...

the timer checks if the player is in the cube or not
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)