AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   not (https://forums.alliedmods.net/showthread.php?t=134758)

BeNq! 08-08-2010 09:02

not
 
not

GXLZPGX 08-08-2010 09:08

Re: Set_user_maxspeed HELP
 
Quote:

Originally Posted by BeNq! (Post 1265360)
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.

BeNq! 08-08-2010 09:30

Re: Set_user_maxspeed HELP
 
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?

mottzi 08-08-2010 09:44

Re: Set_user_maxspeed HELP
 
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.

BeNq! 08-08-2010 10:20

Re: Set_user_maxspeed HELP
 
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


?

DaxProxy 08-08-2010 10:30

Re: Set_user_maxspeed HELP
 
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.

BeNq! 08-08-2010 10:43

Re: Set_user_maxspeed HELP
 
I want to display the August remained as the speed

Devil259 08-08-2010 11:08

Re: Set_user_maxspeed HELP
 
Or use set_pev(pev_maxspeed, speedyouwant) ?

BeNq! 08-08-2010 13:16

Re: Set_user_maxspeed HELP
 
He wants to have written far remained to the end maxspeed

BeNq! 08-09-2010 15:14

Re: Set_user_maxspeed HELP
 
HALLO!!!


All times are GMT -4. The time now is 00:05.

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