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

variable movement speed


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
strikevz
Junior Member
Join Date: Mar 2021
Old 03-24-2021 , 07:00   variable movement speed
Reply With Quote #1

heya!
I need a plugin which gives the admins a cmd to modify all players' speed to a custom value, from 0 to 1000 (I remember default is 250 ). the found plugins so far are buggy or can't change the speed of steam players (console cmd spamming).

thank you so much
strikevz is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 03-24-2021 , 09:31   Re: variable movement speed
Reply With Quote #2

You can't force modify player's cvars. Slowhacking is not allowed.
The best you can do is instruct them to do so on their own with a friendly message.
__________________

Last edited by OciXCrom; 03-24-2021 at 09:31.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
strikevz
Junior Member
Join Date: Mar 2021
Old 03-24-2021 , 10:01   Re: variable movement speed
Reply With Quote #3

it's not about slowhacking, I want to give all players speed, this is the point of the gameplay, as in soccerjam (turbo) or surf.
strikevz is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 03-24-2021 , 10:09   Re: variable movement speed
Reply With Quote #4

If you want to give speed, you would use AMXX's built-in functions instead of modifying their settings.
Give an example of such a "buggy plugin that doesn't work".
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
strikevz
Junior Member
Join Date: Mar 2021
Old 03-24-2021 , 11:04   Re: variable movement speed
Reply With Quote #5

https://forums.alliedmods.net/showthread.php?p=461931

tried this one. steam on players with protected cs take endless errors in console when I enable the speed (including me), causing overflood
so I all want to do is to increase everyone's speed, how do I do that by using AMXX's built-in functions, as you said?
strikevz is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 03-24-2021 , 11:17   Re: variable movement speed
Reply With Quote #6

amx_speed <player> <speed amount|reset>

Code:
#include <amxmodx> #include <amxmisc> #include <fun> #include <hamsandwich> #tryinclude <cromchat> #if !defined _cromchat_included     #error "cromchat.inc" is missing in your "scripting/include" folder. Download it from: "https://amxx-bg.info/inc/" #endif #define MAX_NAME_LENGTH 32 #if !defined MAX_PLAYERS const MAX_PLAYERS = 32 #endif const Float:SPEED_DEFAULT = -120.9 new Float:g_fSpeed[MAX_PLAYERS + 1] = { SPEED_DEFAULT, ... } public plugin_init() {     register_plugin("Change Speed Command", "1.0", "OciXCrom")     register_concmd("amx_speed", "Cmd_Speed", ADMIN_SLAY, "<player> <speed amount|reset>")     RegisterHam(Ham_CS_Player_ResetMaxSpeed, "player", "OnResetMaxSpeed", 1) } public OnResetMaxSpeed(id) {     if(g_fSpeed[id] != SPEED_DEFAULT)     {         set_user_maxspeed(id, g_fSpeed[id])     } } public client_putinserver(id) {     g_fSpeed[id] = SPEED_DEFAULT } public Cmd_Speed(id, iLevel, iCid) {     if(!cmd_access(id, iLevel, iCid, 3))     {         return PLUGIN_HANDLED     }     new szPlayer[MAX_NAME_LENGTH]     read_argv(1, szPlayer, charsmax(szPlayer))     new iPlayer = cmd_target(id, szPlayer, CMDTARGET_ALLOW_SELF|CMDTARGET_OBEY_IMMUNITY)     if(!iPlayer)     {         return PLUGIN_HANDLED     }     new szName[MAX_NAME_LENGTH], szName2[MAX_NAME_LENGTH], szAmount[8]     get_user_name(id, szName, charsmax(szName))     get_user_name(iPlayer, szName2, charsmax(szName2))     read_argv(2, szAmount, charsmax(szAmount))     if(equali(szAmount, "reset"))     {         g_fSpeed[iPlayer] = SPEED_DEFAULT         ExecuteHamB(Ham_CS_Player_ResetMaxSpeed, iPlayer)         CC_LogMessage(0, _, "ADMIN &x03%s &x01reset &x03%s&x01's speed", szName, szName2)     }     else     {         g_fSpeed[iPlayer] = str_to_float(szAmount)         OnResetMaxSpeed(iPlayer)         CC_LogMessage(0, _, "ADMIN &x03%s &x01set &x04%s speed &x01on &x03%s", szName, szAmount, szName2)     }     return PLUGIN_HANDLED }
__________________

Last edited by OciXCrom; 03-25-2021 at 08:57.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
strikevz
Junior Member
Join Date: Mar 2021
Old 03-24-2021 , 11:41   Re: variable movement speed
Reply With Quote #7

Compiled it successfully but it doesn't work. The command works but doesn't modify my speed. I'm using the last version of reHLDS

Last edited by strikevz; 03-24-2021 at 11:47.
strikevz is offline
JocAnis
Veteran Member
Join Date: Jun 2010
Old 03-24-2021 , 13:38   Re: variable movement speed
Reply With Quote #8

OciXCrom seems correct, maybe this could be the issue (pre-post hook):

Code:
RegisterHam(Ham_CS_Player_ResetMaxSpeed, "player", "OnResetMaxSpeed")
->
RegisterHam(Ham_CS_Player_ResetMaxSpeed, "player", "OnResetMaxSpeed", 1 )
__________________
KZ Public Autocup - PrimeKZ

My blog: http://primekz.xyz (in progress...) - not active (dec 2022)
JocAnis is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 03-24-2021 , 13:41   Re: variable movement speed
Reply With Quote #9

I mixed up id and iPlayer. Check now, I edited my code.

Try what JocAnis said if it doesn't work but I'm pretty sure it doesn't have to be post. Gonna check later what I use in my plugins.

If it still doesn't work, check your error logs. If there aren't any, then you have some terrible plugin that's overwriting it.
__________________

Last edited by OciXCrom; 03-24-2021 at 13:42.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Natsheh
Veteran Member
Join Date: Sep 2012
Old 03-24-2021 , 13:46   Re: variable movement speed
Reply With Quote #10

You can increase any player speed by increasing their velocity....
But you need several checks for this method its kind hacky way.
__________________
@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
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 03:36.


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