30.07.2013, 15:28
Well, how can i do that detects if player near in that object and that object will be destroyed do i need to use timers for that?

stock IsPlayerNearObject(playerid, objectid, Float:range)
{
new Float:X, Float:Y, Float:Z;
GetObjectPos(objectid, X, Y, Z);
if(IsPlayerInRangeOfPoint(playerid, range, X, Y, Z))return true;
return false;
}
IsPlayerNearObject(playerid, OBJECT-HERE, Range) return DestroyObject(objectid);
|
Hi, well I'm half sure you can.
You will need to see if player is near object, using a stock. Add the following: pawn Код:
pawn Код:
![]() |
SetPVarInt(playerid, "Object", CreateDynamicSphere(x, y, z, 0.5, 0, 0);
public OnPlayerEnterDynamicArea(playerid, areaid)
{
if(GetPVarType(playerid, "Object"))
{
if(areaid == GetPVarInt(playerid, "Objects"))
{
DestroyObject(objectid);
return 1;
}
}
return 1;
}