12.11.2010, 17:45
how do timer moving objects?
can explain me ?
can explain me ?
//on top of script
new moveobjectid;
//under gamemodeinit
moveobjectid = CreateObject(..... . ...................);
forward MoveTimer(playerid);
public MoveTimer(playerid);
{
MovePlayerObject(playerid, moveobjectid,Float:X, Float:Y, Float:Z, 10.0);//10.0 is speed in milisecs
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/mycommand", cmdtext, true, 10) == 0)
{
SetTimerEx("MoveTimer",timeinmiliseconds,0,"d",playerid);
return 1;
}
return 0;
}