29.07.2012, 09:57
That's fixed.
It dosen't explode now when the object is "Moving" & IsInRange of target
It should explode.
It dosen't explode now when the object is "Moving" & IsInRange of target
pawn Код:
forward detectbomb(playerid);
public detectbomb(playerid)
{
new
Float:tx,
Float:ty,
Float:tz,
Float:x,
Float:y,
Float:z;
for(new targetid = 0; targetid < MAX_PLAYERS; targetid++)
{
if(!IsPlayerConnected(targetid) || targetid == playerid || !IsPlayerInAnyVehicle(targetid)) continue;
GetPlayerPos(targetid, tx, ty, tz);
GetObjectPos(gRocketObj[playerid], x, y, z);
if(IsPlayerInRangeOfPoint(targetid, 3.0, x, y, z))
{
CreateExplosion(tx, ty, tz, 11, 5.0);
DestroyObject(gRocketObj[playerid]);
KillTimer(detecttimer[playerid]);
}
else if(!IsPlayerInRangeOfPoint(targetid,3.0, x, y, z))
{
}
}
return 1;
}