#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; } }
SetTimer("Misile",30000,0);
#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; } }
Originally Posted by Liustas
This is exactly the same code. This funcion shuld be looping, so this object shuld be created and destroyed with same time intervals. However sometimes this cycle tooks about 50 seconds, which is normal and sometimes about 2 minutes. So i want to ask why this funcion cycle is not a constant?
|