Raised This Month: $ Target: $400
 0% 

variable movement speed


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 03-24-2021 , 11:17   Re: variable movement speed
Reply With Quote #1

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
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 17:35.


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