Raised This Month: $ Target: $400
 0% 

Help setting maxspeed


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
winds
Member
Join Date: Aug 2010
Old 10-26-2011 , 10:24   Help setting maxspeed
Reply With Quote #1

Hey guys,
I am trying to make a menu for special rounds and I have this code:

PHP Code:
public logevent_round_start()
{
    static 
iMaxPlayers;
    if ( !
iMaxPlayers )
        
iMaxPlayers get_maxplayers();

    for(new 
id 1id <= get_maxplayers(); id++) 
    {
        if ( 
SpecialDay == )
        {
            
server_cmd("sv_maxspeed 1000");
            
set_user_maxspeed(11000.0);
            
set_hudmessage();
            
show_hudmessage(0"This is a speed round");
            
b_Speed false
            b_SpeedWeapon 
true
            SpecialDay 
0
        

and also

PHP Code:
public CurWeapon(id)
{
    if(
b_SpeedWeapon == true);
    {
        
set_user_maxspeed(id1000.0);
    }

Everything works except actually changing the players speed. It doesn't matter if I don't change weapons or I do, I stay the same speed. What am I doing wrong?
Also, how do I change it so it gives everyone maxspeed? I tried setting that to set_user_maxspeed(0, 1000.0) with a 0 instead of 1 but that didn't work at all.
Thanks!
winds is offline
Evaldas.Grigas
Senior Member
Join Date: Sep 2011
Location: Lithuania
Old 10-26-2011 , 10:29   Re: Help setting maxspeed
Reply With Quote #2

You set only max speed. You need to set player speed.

EDIT: I don't know maybe I am wrong.
__________________
Please enter this website everyday: http://forums.alliedmods.net/showthread.php?t=169067

Last edited by Evaldas.Grigas; 10-26-2011 at 10:31.
Evaldas.Grigas is offline
Send a message via Skype™ to Evaldas.Grigas
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 10-26-2011 , 10:31   Re: Help setting maxspeed
Reply With Quote #3

http://forums.alliedmods.net/showpos...2&postcount=11
__________________
Bugsy is offline
winds
Member
Join Date: Aug 2010
Old 10-26-2011 , 16:27   Re: Help setting maxspeed
Reply With Quote #4

Hmm, i'm not quite sure I understand what's happening in that plugin
winds is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 10-26-2011 , 18:21   Re: Help setting maxspeed
Reply With Quote #5

Your way is fine, Bugsy way is more accurate but it won't help with your problem.
Your problem is that clients cvars limit clients maxspeed. Those cvars are cl_forwardspeed, cl_backspeed and cl_sidespeed. Changing them without asking clients permission is considerated as slowhacking and is not allowed.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 10-26-2011 , 18:30   Re: Help setting maxspeed
Reply With Quote #6

If you set speed too high, does the value get clamped or just ignored? I assumed it was working but getting reset on him frequently that's why I was hinting towards using ResetMaxSpeed for setting speed.
__________________
Bugsy is offline
winds
Member
Join Date: Aug 2010
Old 10-26-2011 , 19:05   Re: Help setting maxspeed
Reply With Quote #7

Hm, when I put this in it, it still doesn't work.

PHP Code:
if ( SpecialDay == )
        {
            
server_cmd("sv_maxspeed 700");
            
set_user_maxspeed(1700.0);
            
client_cmd(id"cl_forwardspeed 700");
            
client_cmd(id"cl_sidespeed 700");
            
client_cmd(id"cl_backspeed 700");
            
set_hudmessage();
            
show_hudmessage(0"This is a speed round");
            
b_Speed false
            b_SpeedWeapon 
true
            SpecialDay 
0
        

winds is offline
F0RCE
Senior Member
Join Date: Oct 2010
Old 10-26-2011 , 20:14   Re: Help setting maxspeed
Reply With Quote #8

You speed is still 320? [MAX]

You are setting the speed on server side.
Why don't You set it on client side too?

PHP Code:
client_cmd(id"sv_maxspeed 700"); 

Last edited by F0RCE; 10-26-2011 at 20:14.
F0RCE is offline
winds
Member
Join Date: Aug 2010
Old 10-26-2011 , 20:49   Re: Help setting maxspeed
Reply With Quote #9

sv_maxspeed as a client command? I think thats a server side command, thats what the sv_ stands for. Correct me if i'm wrong though.

I tried already setting the client command cl_forwardspeed, sidespeed, and backspeed to 700, but the effect was still the same. No change in speed
winds is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 10-26-2011 , 21:11   Re: Help setting maxspeed
Reply With Quote #10

Did you search the forums yet because there are a lot of threads on the topic, you can even look at an existing plugin to see how its done and maybe it'll help solve your problem.

In that plugin thread:
Code:
Make sure that server cvars sv_maxspeed and sv_maxvelocity are set in 
consequence to the plugin settings. Also, you have to alter client cvars 
cl_forwardspeed, cl_backspeed and cl_sidespeed if you want to have more than 400
as maxspeed.
__________________

Last edited by Bugsy; 10-26-2011 at 21:16.
Bugsy 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 14:20.


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