Raised This Month: $ Target: $400
 0% 

Float speed


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Nutu_
AlliedModders Donor
Join Date: Mar 2016
Location: Germany
Old 02-04-2019 , 06:30   Float speed
Reply With Quote #1

PHP Code:
new Float:FastSpeed 400.0
new Float:NormalSpeed 250.0
new HasSpeed[33]; 
PHP Code:
public logevent_round_end()
{
    
HasSpeed[0] = 0
    set_user_maxspeed
(0NormalSpeed)
}

public 
client_disconnect(id)
{
    
HasSpeed[id] = 0
    set_user_maxspeed
(0NormalSpeed)

PHP Code:
case :
        {
            if ( 
Money ) {
                
CromChat id"---" );
                return 
PLUGIN_HANDLED;
            }
            if (!
HasSpeed[id])
            {
                
set_user_maxspeed(idFastSpeed);
                
HasSpeed[id] = 1
                cs_set_user_money 
(idMoney 7);
                
client_cmd (id"spk ^"%s^""MenuSound );
                
CromChat (id"---");
                
CromChat (0"---"name);
                
            }
            else {
                
CromChat id"----" );
                return 
PLUGIN_HANDLED;
            }
        } 
why the speed gone after changing the weapon, i mean, i buy speed while using weapon, then i switch to pistol and speed is gone, also when round ends speed is not taken, any idea why?
__________________
a simple act of caring creates an endless ripple.
Nutu_ is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 02-04-2019 , 07:52   Re: Float speed
Reply With Quote #2

Because weapons have a maxspeed, so it changes when you switch. IIRC, set it on CurWeapon event. This has been covered before, trying searching.
__________________
Bugsy is offline
Nutu_
AlliedModders Donor
Join Date: Mar 2016
Location: Germany
Old 02-04-2019 , 08:10   Re: Float speed
Reply With Quote #3

Quote:
Originally Posted by Bugsy View Post
Because weapons have a maxspeed, so it changes when you switch. IIRC, set it on CurWeapon event. This has been covered before, trying searching.
thanks, i fixed it, but it still wont take off when round ends

PHP Code:
public logevent_round_end(id)
{
    
HasSpeed[id] = 0
    set_user_maxspeed
(0NormalSpeed)
}

public 
client_disconnect(id)
{
    
HasSpeed[id] = 0
    set_user_maxspeed
(0NormalSpeed)

__________________
a simple act of caring creates an endless ripple.
Nutu_ is offline
iceeedr
Veteran Member
Join Date: Apr 2017
Location: Brazil
Old 02-04-2019 , 10:16   Re: Float speed
Reply With Quote #4

PHP Code:
public logevent_round_end()
{
    new 
iPlayers[32], iNumid
    get_players
(iPlayersiNum"ch")
    for(new 
0iNumi++)
    {
        
id iPlayers[i]
        
        if(!
HasSpeed[id])
            continue
            
        
HasSpeed[id] = 0
        set_user_maxspeed
(idNormalSpeed// "0" on set max speed?

I may be wrong, but logevent does not have the "id" parameter, so you have to loop through all the players.
__________________


Quote:
Originally Posted by fysiks View Post
Please stop trying to help. You appear to just be posting random stuff. Wait until you actually understand more about AMX Mod X and how the game works.
https://iceeedr.com.br/

Last edited by iceeedr; 02-04-2019 at 10:17.
iceeedr is offline
Send a message via Skype™ to iceeedr
Nutu_
AlliedModders Donor
Join Date: Mar 2016
Location: Germany
Old 02-04-2019 , 10:20   Re: Float speed
Reply With Quote #5

seems to work, thank you!
__________________
a simple act of caring creates an endless ripple.
Nutu_ is offline
eat1k
Senior Member
Join Date: Apr 2018
Old 02-04-2019 , 11:55   Re: Float speed
Reply With Quote #6

PHP Code:
public logevent_round_end()
{
    new 
iPlayers[MAX_PLAYERS], iPlayerCount;
    
get_players_ex(iPlayersiPlayerCountGetPlayers_ExcludeHLTV|GetPlayers_ExcludeBots);

    for(new 
iiPlayerCounti++)
    {
        
HasSpeed[iPlayers[i]] = 0;
        
ExecuteHam(Ham_CS_Player_ResetMaxSpeediPlayers[i]);
    }

__________________
eat1k 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 04:49.


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