08.01.2018, 16:31
Alta metoda cu timer
Код:
public OnGameModeInit() { new poarta = CreateObject(980, 2720.20020, -2405.67432, 12.53250, 0.00000, 0.00000, 89.00000); //Obiectul return 1; CMD:opengate(playerid, params[]) { if (!IsPlayerInRangeOfPoint(playerid, 10.0, 2720.20020, -2405.67432, 12.53250)) return SendClientMessage(playerid, 0xFFFFFFFF, "You are not at the LS Port Gate!"); // verifica daca esti in apropierea portii SendClientMessage(playerid, 0xFFFFFFFF, "Los Santos Port Gate has been opened. Closing after 10 seconds!"); SetTimer("closegatelsport", 10000, false);// Incepe un timer de 10 secunde MoveObject(poarta, 2720.59888, -2395.50293, 12.53250, 00.00000); // muta obiectul return 1; } forward closegatelsport(); public closegatelsport() { MoveObject(poarta, 2720.20020, -2405.67432, 12.53250, 00.00000); //inchide poarta dupa 10 secunde } }