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

Can't increase player speed


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
esenrik
Senior Member
Join Date: Jul 2010
Old 05-25-2018 , 15:23   Can't increase player speed
Reply With Quote #1

Hello.

Im trying to set speed 400 for a player.

I have sv_maxspeed in 9999.

I use this:

Quote:
if (g_predator[id]) {
set_pev(id, pev_maxspeed, get_pcvar_float(cvar_predspd))
}
(( cvar_predspd is 400 ))

But player is not going fast :/

Client vars: cl_backspeed 999, cl_sidespeed 999, cl_forwardspeed 999

So I don't understand what is bad,... thanks you!

Last edited by esenrik; 05-25-2018 at 15:23.
esenrik is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 05-25-2018 , 17:32   Re: Can't increase player speed
Reply With Quote #2

Show full code.
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !

Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
esenrik
Senior Member
Join Date: Jul 2010
Old 05-25-2018 , 18:52   Re: Can't increase player speed
Reply With Quote #3

Quote:
Originally Posted by Natsheh View Post
Show full code.
Code:
// Set proper maxspeed for player
set_player_maxspeed(id)
{
	// If frozen, prevent from moving
	if (g_frozen[id])
	{
		set_pev(id, pev_maxspeed, 1.0)
	}
	// Otherwise, set maxspeed directly
	else
	{
		if (g_zombie[id])
		{
			if (g_nemesis[id]) {
			set_pev(id, pev_maxspeed, get_pcvar_float(cvar_nemspd))
			}
			else {
			set_pev(id, pev_maxspeed, g_zombie_spd[id])
			}
			
			if (g_predator[id]) {
			set_pev(id, pev_maxspeed, get_pcvar_float(cvar_predspd))
			}
			else {
			set_pev(id, pev_maxspeed, g_zombie_spd[id])
			}			
		}
		else
		{
			if (g_survivor[id])
			set_pev(id, pev_maxspeed, get_pcvar_float(cvar_survspd))
			else if (get_pcvar_float(cvar_humanspd) > 0.0)
			set_pev(id, pev_maxspeed, get_pcvar_float(cvar_humanspd))
		}
	}
}
PD: cvar_predspd = 400
esenrik is offline
iceeedr
Veteran Member
Join Date: Apr 2017
Location: Brazil
Old 05-26-2018 , 01:47   Re: Can't increase player speed
Reply With Quote #4

I found this code in another post.

It requires the fun module, I do not know if it helps you, and I do not even know if it works kk.

PHP Code:
set_player_maxspeed(id)
{
    
// If frozen, prevent from moving
    
if (g_frozen[id])
    {
        
set_user_maxspeed(id0.0)
    }
    
// Otherwise, set maxspeed directly
    
else
    {
        if (
g_zombie[id])
        {
            if (
g_nemesis[id]) {
            
set_user_maxspeed(idget_pcvar_float(cvar_nemspd))
            }
            else {
            
set_user_maxspeed(idg_zombie_spd[id])
            }
            
            if (
g_predator[id]) {
            
set_user_maxspeed(idget_pcvar_float(cvar_predspd))
            }
            else {
            
set_user_maxspeed(idg_zombie_spd[id])
            }            
        }
        else
        {
            if (
g_survivor[id])
            
set_user_maxspeed(idget_pcvar_float(cvar_survspd))
            else if (
get_pcvar_float(cvar_humanspd) > 0.0)
            
set_user_maxspeed(idget_pcvar_float(cvar_humanspd))
        }
    }

iceeedr is offline
Send a message via Skype™ to iceeedr
CrazY.
Veteran Member
Join Date: May 2015
Location: SP, Brazil
Old 05-26-2018 , 09:30   Re: Can't increase player speed
Reply With Quote #5

It won't work. You need to do hack with Ham_Item_PostFrame. Try to use this plugin.
Attached Files
File Type: sma Get Plugin or Get Source (cs_maxspeed_api.sma - 496 views - 3.1 KB)
File Type: inc cs_maxspeed_api.inc (773 Bytes, 28 views)
File Type: inc cs_maxspeed_api_const.inc (203 Bytes, 31 views)
File Type: inc cs_maxspeed_api_stocks.inc (565 Bytes, 59 views)
__________________








CrazY. is offline
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 10:21.


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