View Full Version : Fail Job System

09/07/2018, 01:59 PM
Hello. I made a job for my gamemode. You will get a vehicle and you will need to deliver some good. I made it so that if someone works and exits the vehicle, they fail a job. Now I am trying to do it so that if someone exits the vehicle, they get 30 seconds to get back in it, or else the job will fail. I tried to do it with a timer, but I messed up. Can somebody give me an example of how to do it?

09/07/2018, 02:01 PM

uses this instead of a timer

09/07/2018, 02:15 PM

uses this instead of a timer

no,literally the first page,AndreT says most problematic things when you do that..

use y_timer,it's much more clean and readable,there are also many advantages which corne states in this thread.

09/07/2018, 02:36 PM
use gettime to get time when exit and compare to time when enter.
I didnt mean to use a timer sry

09/07/2018, 02:50 PM
Create the timer when it comes out of the vehicle and delete it when it comes back.

Or you can create a [ new timerjob[MAX_PLAYERS] = 0; global variable ] and when you exit the vehicle you set it to [ timerjob [playerid] = 30; ] put it in a 1 second timer and do [ if (timerjob [playerid]> 0) timerjob [playerid]--; ] and when it reaches 0 you can make the vehicle disappear.

I hope you understand what I mean.

Trimite-mi un mesaj privat daca vrei sa te ajut mai mult.