SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help > Help Archive

 
 
Thread Tools Display Modes
Old 29/04/2011, 11:31 AM   #1
Andregood
Huge Clucker
 
Join Date: Oct 2009
Location: Sweden
Posts: 254
Reputation: 20
Default Help me please, it'd be appreciated

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.
Andregood is offline  
Old 29/04/2011, 11:33 AM   #2
Slash01
Little Clucker
 
Join Date: Apr 2011
Posts: 21
Reputation: 0
Default Re: Help me please, it'd be appreciated

Quote:
Originally Posted by Andregood View Post
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?

__________________
Slash01 is offline  
Old 29/04/2011, 11:33 AM   #3
[DDC]Delight
Big Clucker
 
Join Date: May 2009
Location: Netherlands
Posts: 156
Reputation: 0
Default Re: Help me please, it'd be appreciated

Could you show us the example?
And maybe an explanation on what exactly you want to comply there
[DDC]Delight is offline  
Old 29/04/2011, 11:45 AM   #4
Andregood
Huge Clucker
 
Join Date: Oct 2009
Location: Sweden
Posts: 254
Reputation: 20
Default Re: Help me please, it'd be appreciated

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

Code:
	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
Andregood is offline  
Old 29/04/2011, 11:48 AM   #5
[DDC]Delight
Big Clucker
 
Join Date: May 2009
Location: Netherlands
Posts: 156
Reputation: 0
Default Re: Help me please, it'd be appreciated

Quote:
Originally Posted by Andregood View Post
Well I basically want a timer between each jump, that's pretty much it.

Code:
	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?
[DDC]Delight is offline  
Old 29/04/2011, 12:29 PM   #6
Andregood
Huge Clucker
 
Join Date: Oct 2009
Location: Sweden
Posts: 254
Reputation: 20
Default Re: Help me please, it'd be appreciated

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.
Andregood is offline  
Old 29/04/2011, 12:34 PM   #7
Vince
Godfather
 
Vince's Avatar
 
Join Date: Sep 2007
Location: Belgium
Posts: 6,784
Reputation: 1782
Default Re: Help me please, it'd be appreciated

Use GetTickCount.
pawn Code:
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
__________________

I am not your "bro", not your "nigga" and not your friend.
Vince is online now  
Old 29/04/2011, 02:28 PM   #8
Andregood
Huge Clucker
 
Join Date: Oct 2009
Location: Sweden
Posts: 254
Reputation: 20
Default Re: Help me please, it'd be appreciated

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

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
/accent help! Please! Seriously appreciated :) maramizo Help Archive 5 09/02/2011 10:09 AM
Help Appreciated Max_Coldheart Help Archive 1 18/01/2011 02:51 PM
Help Needed, Help Appreciated DRCharlie Help Archive 0 26/05/2010 04:54 PM
Spectate help appreciated Marclang Help Archive 25 01/06/2009 05:43 PM
Help appreciated Marclang Help Archive 2 23/05/2009 12:09 PM


All times are GMT. The time now is 07:01 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.