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

not


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
BeNq!
Senior Member
Join Date: Mar 2009
Old 08-08-2010 , 09:02   not
Reply With Quote #1

not

Last edited by BeNq!; 07-23-2012 at 12:54.
BeNq! is offline
GXLZPGX
Veteran Member
Join Date: Sep 2009
Old 08-08-2010 , 09:08   Re: Set_user_maxspeed HELP
Reply With Quote #2

Quote:
Originally Posted by BeNq! View Post
Hi,

How do, using set_user_maxspeed / fm_set_user_maxspeed speed for buy 10 seconds and when you change weapons do not lose speed?

Sorry... My bad english. I'm from polish ...

-----------

[PL]

Witam,

Jak zrobic, przy uzyciu set_user_maxspeed / fm_set_user_maxspeed kupic to na 10 sekund szybkosc oraz przy zmianie broni nie traci sie predkosci?
When they buy something - set_task( 10.0, "eventcalled" )

For the speed:

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

new bool:BoughtSpeed[33]; //make this bool true when they buy the speed

public plugin_init()
{
    
register_event("CurWeapon""event_curweapon""be""1=1")
}

public 
event_curweapon(id)
{
    if( !
is_user_alive(id) )
    {
        return 
PLUGIN_HANDLED;
    }
    
    if( 
BoughtSpeed[id] )
    {
        
set_user_maxspeedidspeedyouwant )
    }
    
    return 
PLUGIN_HANDLED;

change "speedyouwant" to the speed you want obviously.

I could be wrong though.
__________________
Currently accepting payment US DOLLARS ONLY for custom plugins, contact me through PM.

Last edited by GXLZPGX; 08-08-2010 at 09:11.
GXLZPGX is offline
BeNq!
Senior Member
Join Date: Mar 2009
Old 08-08-2010 , 09:30   Re: Set_user_maxspeed HELP
Reply With Quote #3

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

new bool:BoughtSpeed[33]; //make this bool true when they buy the speed
new speeds_time[33];

public 
plugin_init()
{
    
register_event("CurWeapon""event_curweapon""be""1=1")
    
register_clcmd("buy""buy_speed")
}

public 
event_curweapon(id)
{
    if( !
is_user_alive(id) )
    {
        return 
PLUGIN_HANDLED;
    }
    
    if( 
BoughtSpeed[id] )
    {
        
set_user_maxspeedidspeedyouwant )
    }
    
    return 
PLUGIN_HANDLED;
}  
public 
buy_speed(id)
{
client_print(id,print_chat,"Buy speeds")
speeds_time[id] = 20;
set_task(1.0"speeds_buy"56465+id""0"b");
}
public 
speeds_buy(taskid);
{
    new 
id taskid-56465;
    if(
speed_time[id] > 0)
    {
        
set_hudmessage(01702550.440.7506.01.0);
        
ShowSyncHudMsg(id,gSyncMessage,"Speeds %d"speed_time[id]);
        
speed_time[id]--;
    }
    else
    {
        ????
        
remove_task(taskid);
    }

Errors ;/

Can someone fix this?
BeNq! is offline
mottzi
Veteran Member
Join Date: May 2010
Location: Switzerland
Old 08-08-2010 , 09:44   Re: Set_user_maxspeed HELP
Reply With Quote #4

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

new bool:has_speed[33]

public 
plugin_init() {
    
register_event("CurWeapon""event_curweapon""be""1=1")
    
register_clcmd("say /buyspeed""cmdBuySpeed")
}

public 
event_curweapon(id)
{
    if(
has_speed[id] == true)
    {
        
set_user_maxspeed(id290.0)
    }
}

public 
cmdBuySpeed(id)
{
    if(!
has_speed[id])
    {
        
set_user_maxspeed(id290.0)
        
client_print(idprint_chat"You brought Speed!")
        
        
set_task(10.0"cmdRemoveSpeed"id)
    }
    else
    {
        
client_print(idprint_chat"You already brought Speed!")
    }
}

public 
cmdRemoveSpeed(id)
{
    
set_user_maxspeed(id240.0// Set normal speed after 10 Seconds

Try to understand its rly easy.

The CurWeapon event each time calls when the player shots or switch between weapons.
__________________
Quote:
#define true ((rand() % 2)? true: false) //Happy debugging suckers
mottzi is offline
Send a message via MSN to mottzi
BeNq!
Senior Member
Join Date: Mar 2009
Old 08-08-2010 , 10:20   Re: Set_user_maxspeed HELP
Reply With Quote #5

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

new bool:has_speed[33]

public 
plugin_init() {
    
register_event("CurWeapon""event_curweapon""be""1=1")
    
register_clcmd("buyspeed""cmdBuySpeed")
}

public 
event_curweapon(id)
{
    if(
has_speed[id] == true)
    {
        
set_user_maxspeed(id290.0)
    }
}

public 
cmdBuySpeed(id)
{
    if(!
has_speed[id])
    {
        
set_user_maxspeed(id450.0)
        
set_hudmessage(255000.00.006.01.0)
        
show_hudmessage(id"You brought Speed in %d sekund",has_speed[id])

        
        
set_task(20.0"cmdRemoveSpeed"id)
    }
    else
    {
        
client_print(idprint_chat"You already brought Speed!")
    }
}

public 
cmdRemoveSpeed(id)
{
    
set_user_maxspeed(id240.0// Set normal speed after 10 Seconds

?
BeNq! is offline
DaxProxy
Senior Member
Join Date: Sep 2007
Old 08-08-2010 , 10:30   Re: Set_user_maxspeed HELP
Reply With Quote #6

When you change weapon, your speed will reset, as players have different speed with different weapons.

Hook change weapon event, and add upgraded speed each time player will change weapon...other wise it wont work.
__________________

Want ApolloRP for Counter-Strike? Show your support: http://forums.alliedmods.net/showthr...39#post1264739
DaxProxy is offline
BeNq!
Senior Member
Join Date: Mar 2009
Old 08-08-2010 , 10:43   Re: Set_user_maxspeed HELP
Reply With Quote #7

I want to display the August remained as the speed
BeNq! is offline
Devil259
Veteran Member
Join Date: Dec 2009
Location: France (59)
Old 08-08-2010 , 11:08   Re: Set_user_maxspeed HELP
Reply With Quote #8

Or use set_pev(pev_maxspeed, speedyouwant) ?
__________________
You can do anything you set your mind to, man.

Devil259 is offline
BeNq!
Senior Member
Join Date: Mar 2009
Old 08-08-2010 , 13:16   Re: Set_user_maxspeed HELP
Reply With Quote #9

He wants to have written far remained to the end maxspeed
BeNq! is offline
BeNq!
Senior Member
Join Date: Mar 2009
Old 08-09-2010 , 15:14   Re: Set_user_maxspeed HELP
Reply With Quote #10

HALLO!!!
BeNq! is offline
Reply



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 23:56.


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