29.12.2015, 16:28
i have this.How can something that works in all directions?
PHP код:
CMD:carepack(playerid, params[])
{
new Float:x, Float:y, Float:z, Float:a, plane;
GetPlayerPos(playerid, x, y, z);
GetPlayerFacingAngle(playerid, a);
plane = CreateObject(1683, x, y+274.4658, z+83.3158, 0.0, 0.0, 0.0);
SetObjectRot(plane, 0, 0, a+90);
MoveObject(plane, x, y-184.3464, z+83.3158, 15.00);
SetTimerEx("endcarepack", 15000, false, "ifff", plane, Float:x, Float:y, Float:z);
return 1;
}
forward endcarepack(plane, Float:x, Float:y, Float:z);
public endcarepack(plane, Float:x, Float:y, Float:z)
{
new pack;
pack = CreateObject(18849, x, y, z+82.4104, 0.0, 0.0, 0.0);
MoveObject(pack, Float:x, Float:y, Float:z+6.2104, 4.00);
SetTimerEx("dplane", 5000, false, "i", plane);
return 1;
}
forward dplane(plane);
public dplane(plane)
{
if(IsValidObject(plane)) DestroyObject(plane);
return 1;
}