09.08.2010, 08:51
Well this is the script
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.
Код:
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; }