Raised This Month: $ Target: $400
 0% 

variable movement speed


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 03-25-2021 , 15:10   Re: variable movement speed
Reply With Quote #16

It never ends with just one simple request. I added @all/@ct/@alive etc support. I don't feel like doing the permanent thing.

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 #tryinclude <targetex> #if !defined _targetex_included     #error "targetex.inc" is missing in your "scripting/include" folder. Download it from: "https://forums.alliedmods.net/showthread.php?t=331010" #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.1", "OciXCrom")     register_concmd("amx_speed", "Cmd_Speed", ADMIN_SLAY, "<player|group> <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 szArg[MAX_NAME_LENGTH], szTarget[MAX_NAME_LENGTH]     read_argv(1, szArg, charsmax(szArg))     new iPlayers[MAX_PLAYERS], iPnum = cmd_targetex(id, szArg, iPlayers, szTarget, charsmax(szTarget), TARGETEX_OBEY_IMM_SINGLE)     if(!iPnum)     {         return PLUGIN_HANDLED     }     new szName[MAX_NAME_LENGTH], szAmount[8]     get_user_name(id, szName, charsmax(szName))     read_argv(2, szAmount, charsmax(szAmount))     if(equali(szAmount, "reset"))     {         for(new iPlayer, i; i < iPnum; i++)         {             iPlayer = iPlayers[i]             g_fSpeed[iPlayer] = SPEED_DEFAULT             ExecuteHamB(Ham_CS_Player_ResetMaxSpeed, iPlayer)         }         CC_LogMessage(0, _, "ADMIN &x03%s &x01reset speed for &x03%s", szName, szTarget)     }     else     {         for(new iPlayer, i; i < iPnum; i++)         {             iPlayer = iPlayers[i]             g_fSpeed[iPlayer] = str_to_float(szAmount)             OnResetMaxSpeed(iPlayer)         }                 CC_LogMessage(0, _, "ADMIN &x03%s &x01set &x04%s speed &x01on &x03%s", szName, szAmount, szTarget)     }     return PLUGIN_HANDLED }
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
 



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:38.


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