Raised This Month: $32 Target: $400
 8% 

edict


Post New Thread Reply   
 
Thread Tools Display Modes
Kreation
Veteran Member
Join Date: Jan 2010
Location: Illinois
Old 08-24-2010 , 21:55   Re: Speed
Reply With Quote #21

What he posted was for the countdown, hook the CurWeapon event and use a bool to check if they have speed, if they do then set the speed back. If they don't set it back to normal.
__________________
Hi.
Kreation is offline
mottzi
Veteran Member
Join Date: May 2010
Location: Switzerland
Old 08-25-2010 , 00:40   Re: Speed
Reply With Quote #22

Here look at this exapmle

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <fun>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"

new bool:hasSpeed[33]
new 
count[33]

public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_event("CurWeapon""update_speed""be""1=1")
    
register_clcmd("say Give_Speed""cmdSpeed")
}

public 
cmdSpeed(id)
{
    if(!
hasSpeed[id])
    {
        
hasSpeed[id] = true
        count
[id] = 20
        set_user_maxspeed
(id450.0)
        
// The player have speed now
        
        
set_task(20.0"cmdResetSpeed"id)
        
set_task(1.0"countDown"id 201_,"b")
    }
}

public 
cmdResetSpeed(id)
{
    
hasSpeed[id] = false
    set_user_maxspeed
(id245.0)
}

public 
update_speed(id)
{
    if(
hasSpeed[id])
    {
        
set_user_maxspeed(id450.0)
    }
}  

public 
countDown(id)
{
    if(
hasSpeed[id])
    {
        if(
count[id] >= 0)
        {
            
set_hudmessage(25500, -1.00.1406.02.0)
            
show_hudmessage(id"Seconds of speed left: %i"count[id])
            
count[id]--
        }
    }
    else
    {
        
remove_task(id 201)
    }

__________________
Quote:
#define true ((rand() % 2)? true: false) //Happy debugging suckers

Last edited by mottzi; 08-25-2010 at 00:43.
mottzi is offline
Send a message via MSN to mottzi
Old 08-25-2010, 07:06
BeNq!
This message has been deleted by BeNq!.
Old 08-25-2010, 07:11
BeNq!
This message has been deleted by BeNq!.
mottzi
Veteran Member
Join Date: May 2010
Location: Switzerland
Old 08-25-2010 , 12:14   Re: Speed
Reply With Quote #23

Quote:
Originally Posted by BeNq! View Post
GJ!

Thanks...

But it does not show that:

PHP Code:
set_hudmessage(25500, -1.00.1406.02.0)
            
show_hudmessage(id"Seconds of speed left: %i"count[id])
            
count[id]-- 
strange
__________________
Quote:
#define true ((rand() % 2)? true: false) //Happy debugging suckers
mottzi is offline
Send a message via MSN to mottzi
Old 08-25-2010, 12:31
BeNq!
This message has been deleted by BeNq!.
GXLZPGX
Veteran Member
Join Date: Sep 2009
Old 08-25-2010 , 13:15   Re: Speed
Reply With Quote #24

Always change the variable before displaying the message. So:

PHP Code:
count[id]--
show_hudmessage(id"Seconds of speed left: %i"count[id]) 
Thanks to wrecked. If you remove 1 from the variable each time AFTER displaying the message, it will always be 1 number behind.
__________________
Currently accepting payment US DOLLARS ONLY for custom plugins, contact me through PM.
GXLZPGX is offline
mottzi
Veteran Member
Join Date: May 2010
Location: Switzerland
Old 08-25-2010 , 15:11   Re: Speed
Reply With Quote #25

Quote:
Originally Posted by GXLZPGX View Post
Always change the variable before displaying the message. So:

PHP Code:
count[id]--
show_hudmessage(id"Seconds of speed left: %i"count[id]) 
Thanks to wrecked. If you remove 1 from the variable each time AFTER displaying the message, it will always be 1 number behind.
If you do it like you said, the timer beginns with 19...
__________________
Quote:
#define true ((rand() % 2)? true: false) //Happy debugging suckers
mottzi is offline
Send a message via MSN to mottzi
Old 08-26-2010, 07:16
BeNq!
This message has been deleted by BeNq!.
Old 08-26-2010, 19:04
BeNq!
This message has been deleted by BeNq!.
Old 08-27-2010, 19:29
BeNq!
This message has been deleted by BeNq!.
GXLZPGX
Veteran Member
Join Date: Sep 2009
Old 08-27-2010 , 19:52   Re: Speed
Reply With Quote #26

Quote:
Originally Posted by BeNq! View Post
PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <fakemeta_util>

#define PLUGIN "Speed"
#define VERSION "0.1"
#define AUTHOR "N_A_V_E_N"

new variable[33];

public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
// Add your code here...
}
public 
weapon_event(id)
{
    if(
variable[id] == 0)
    {
        
fm_set_user_maxspeed(id300.0)
    }
    
set_task(20.0"change_variable_value"id)
}
public 
change_variable_value(id)
{
    
variable[id] = 1;
    
set_hudmessage(id1702550.440.7506.01.0);
    
show_hudmessage(id,"Speed in 20 sekund..");
    
show_hudmessage(id,"Speed in 19 sekund..");
    
show_hudmessage(id,"Speed in 18 sekund..");
    
show_hudmessage(id,"Speed in 17 sekund..");
    
show_hudmessage(id,"Speed in 16 sekund..");
    
show_hudmessage(id,"Speed in 15 sekund..");
    
show_hudmessage(id,"Speed in 14 sekund..");
    
show_hudmessage(id,"Speed in 13 sekund..");
    
show_hudmessage(id,"Speed in 12 sekund..");
    
show_hudmessage(id,"Speed in 11 sekund..");
    
show_hudmessage(id,"Speed in 10 sekund..");
    
show_hudmessage(id,"Speed in 9 sekund..");
    
show_hudmessage(id,"Speed in 8 sekund..");
    
show_hudmessage(id,"Speed in 7 sekund..");
    
show_hudmessage(id,"Speed in 6 sekund..");
    
show_hudmessage(id,"Speed in 5 sekund..");
    
show_hudmessage(id,"Speed in 4 sekund..");
    
show_hudmessage(id,"Speed in 3 sekund..");
    
show_hudmessage(id,"Speed in 2 sekund..");
    
show_hudmessage(id,"Speed in 1 sekund..");
    
show_hudmessage(id,"Speed is running");

? yes?
What is it that initiates weapon_event(id)
__________________
Currently accepting payment US DOLLARS ONLY for custom plugins, contact me through PM.
GXLZPGX is offline
BeNq!
Senior Member
Join Date: Mar 2009
Old 08-29-2010 , 11:33   Re: Speed
Reply With Quote #27

lol...
BeNq! is offline
Kreation
Veteran Member
Join Date: Jan 2010
Location: Illinois
Old 08-29-2010 , 22:58   Re: Speed
Reply With Quote #28

Quote:
Originally Posted by BeNq! View Post
lol...
What the fuck kind of response is that..

Code:
register_event( "CurWeapon", "your_retarded_fucking_name_for_the_function", "be" );
__________________
Hi.
Kreation is offline
Old 09-01-2010, 08:53
BeNq!
This message has been deleted by BeNq!.
Old 09-03-2010, 13:46
BeNq!
This message has been deleted by Exolent[jNr]. Reason: Don't bump until 2 weeks have passed since last post.
Old 09-04-2010, 05:38
Brreaker
This message has been deleted by Exolent[jNr]. Reason: Don't bump until 2 weeks have passed since last post.
Reply


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

Forum Jump


All times are GMT -4. The time now is 09:12.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode