Command with timer
#1

Hi! I tried to do a command with timer, who must be executed every 2-3 minutes. But, my script isn't good.
Код:
#include <a_samp>
#include <core>
new LSp;
forward Timerf();
forward Timer();

public OnGameModeInit()
{
LSp = CreateObject(5167, -2450.27, 1851.55, 0.15, 0.00, 0.00, 180.00);
SetTimer("Timerf", 5000, true);
SetTimer("Timer", 5000, true);
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext, "/ff"))
{
MoveObject(LSp, -2400.27, 1851.55, 0.15, 5.0);
SetTimer("Timerf2", 5000, true);
return 1;
}
if(!strcmp(cmdtext, "/ff2"))
{
MoveObject(LSp, -2450.27, 1851.55, 0.15, 5.0);
SetTimer("Timer2", 5000, true);
return 1;
}
return 0;
}
Help me. ( Sorry for my English) PS: I know 5000 = 5 sec, i will set it later )
Reply


Messages In This Thread
Command with timer - by KoSmYn - 13.02.2013, 18:46
Re: Command with timer - by zxc1 - 13.02.2013, 18:50
Re: Command with timer - by KoSmYn - 13.02.2013, 19:43
Re: Command with timer - by DiGiTaL_AnGeL - 13.02.2013, 19:51

Forum Jump:


Users browsing this thread: 1 Guest(s)