20.01.2017, 03:58
You can add a timer for how long the gate takes to open, example if it takes 1/2 seconds for the gate to open make a timer for 1 / 2 seconds, add a variable like this to remember.
Not sure if it will work well, you have to modify it a bit to suit your system and work for everyone that tries the .
You will need few more variables for it to work well but I gave you an idea.
Код:
new gateOpen; if(gateOpen == 1) { add here the code to happen if the gate is opened fully gateOpen = 2; } if(gateOpen == 2) { add here what to happen if the gate is opening... in the process to open SendClientMessage(playerid, -1, "The gate is opening... please way."); SetTimerEx("gateOpenTimer", 2000, false, "i", playerid);//the timer } if(gateOpen == 0) { add here to happen if the gate is closed. gateOpen = 2; } forward gateopentimer(playerid); public gateopentimer { gateOpen = 0; This will happen when the gate fully opened or closed. }
You will need few more variables for it to work well but I gave you an idea.