Help me please, it'd be appreciated
#1

I'm currently trying to make a timer for my command, but it doesn't seem to work, I've tried the two different ways I know of, settimer and settimerex, I either did something wrong or it doesn't work. Please help me out here thanks, it'd be appreciated.
Reply
#2

Quote:
Originally Posted by Andregood
Посмотреть сообщение
I'm currently trying to make a timer for my command, but it doesn't seem to work, I've tried the two different ways I know of, settimer and settimerex, I either did something wrong or it doesn't work. Please help me out here thanks, it'd be appreciated.
whats your code? we could work out the problem from there?

is it like a countdown command? or a total race time or something like that?

Reply
#3

Could you show us the example?
And maybe an explanation on what exactly you want to comply there
Reply
#4

Well I basically want a timer between each jump, that's pretty much it.

Код:
	if(gTeam[playerid] == 2)
	{
		if(PRESSED(KEY_JUMP))
		{
			new Float:vx,Float:vy,Float:vz;
			GetPlayerVelocity(playerid,vx,vy,vz);
			SetPlayerVelocity(playerid,vx + 0.0,vy - 0.0 ,vz + 0.6);
			

		}
	}
	return 1; ////////////////YOU KEEP FUCKING FORGETTING THIS
Reply
#5

Quote:
Originally Posted by Andregood
Посмотреть сообщение
Well I basically want a timer between each jump, that's pretty much it.

Код:
	return 1; ////////////////YOU KEEP FUCKING FORGETTING THIS
OFFTOPIC: Lol'd at the commented part xD

DO I get you wrong or do you want to create a timer to prevent bunnyhoppers?
Reply
#6

No, I want to create a timer between the jumps limiting them slightly as my team 2, which are vampires can jump significantly higher than normal humans but I need to put a limit per jump as they can literally fly in their current state when jumping. So I basically want to put a 3 seconds timer between each jump, limiting it.
Reply
#7

Use GetTickCount.
pawn Код:
new Ticks[MAX_PLAYERS];

// In your command:
if((GetTickCount() - Ticks[playerid]) < 3000)
{
    SendClientMessage(playerid, COLOR_RED, "Please wait before using this command again");
    return 1;
}
Ticks[playerid] = GetTickCount();

// Your jump code goes here
Reply
#8

It works pretty much, except for the fact that whatever button I press I get spammed with that text basically.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)