[Help] Jetpack Time
#1

Hello , i want to add a function that when player spawn jetpack and then again if he want to spawn jetpack so if the last jetpack was spawned before 10 seconds ago then he can spawn the other one other wise he get a message "You spawn another jetpack in the warning time".
Reply
#2

Just make a timer when he spawns a jetpack of 10 seconds while setting a variable to 1, then reset the variable to 0 when timer is finished.
Then detect if the variable is set to 1 when spawning another jetpack, and send that message if it is.
Reply
#3

how to start timer after spawning jetpack . so that if the jetpack isn't attached to him he still get the message .
Reply
#4

https://sampwiki.blast.hk/wiki/SetTimerEx
Use this under your jetpack spawning command.
Reply
#5

I know this function but i don't know how to detect that player got an jetpack and then no jetpack can spawn even player don't have jetpack.
Reply
#6

Add this in the command

pawn Код:
if(GetPVarInt(playerid,"CMDABUSE")>GetTickCount())return SendMessageToPlayer(playerid,0xFF0000FF,"* You must wait 10 seconds before spawning a jeppack again...");
SetPVarInt(playerid,"CMDABUSE",GetTickCount()+10000);
Reply
#7

Thanks , it worked
+rep.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)