Timer issue
#1

Код:
forward treetutrespawn();
new obj;
Код:
public OnGameModeInit()
{
obj = CreateObject(680, -1227.4000244141, -3230.5, 1.2000000476837, 0, 0, 0);
}
Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
	
    if(pickupid == pickup1)
    {
        new string[50];
        new movetime = MoveObject(obj, -1227.4000244141, -3230.5, -50, 12000);
        format(string, sizeof(string), " ", movetime);
        SendClientMessage(playerid, 0xFF000000, string);
        
       	SetTimer("treetutrespawn",12000,true);
      }
}
Код:
public treetutrespawn()
{
    MoveObject(obj, -1227.4000244141, -3230.5, 1.2000000476837, 12000);
    pickup1 = CreatePickup(19130, 2, -1226, -3230, 2, 0);
}
Ok I made a script where if I cut a tree with a chainsaw the tree would disappear and reappear it works for a couple of times but then the tree starts to come back within 1 second or the pickup would spawn before the tree. How do I make it so that they both spawn at the same time and they spawn every 12 seconds after being cut down?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)