21.06.2010, 13:06
This code works, but moves my object not regularly. How to fix that?
Код:
#include <a_samp>
#define COLOR_LIGHTBLUE 0x33CCFFAA
new Scud;
new SkudSmoke;
new ProgressTimer;
new Float:x,Float:y,Float:z;
forward Misile(playerid);
forward ScudLaunch(playerid);
forward ScudProgres(playerid);
public OnFilterScriptInit()
{
SetTimer("Misile",30000,0);
return 1;
}
public OnPlayerSpawn(playerid)
{
return 1;
}
public Misile(playerid)
{
Scud=CreateObject(17050,-1648.990,281.410,6.170,0.0,0.0,-339.434);
SkudSmoke=CreateObject(2780,-1649.058,281.403,5.425,0.0,0.0,0.0);
SetTimer("ScudLaunch",10000,0);
return 0;
}
public ScudLaunch(playerid)
{
MoveObject(Scud,-1648.990,281.410,170.000,15);
DestroyObject(SkudSmoke);
ProgressTimer=SetTimer("ScudProgres",200,1);
}
public ScudProgres(playerid)
{
GetObjectPos(Scud,x,y,z);
CreateExplosion(x,y,z,3,3);
{
if(z>=160.000)
{
KillTimer(ProgressTimer);
DestroyObject(Scud);
SetTimer("Misile",30000,0);
}
return 0;
}
}

