View Single Post
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 08-29-2019 , 08:12   Re: [Req] Admin_Access
Reply With Quote #3

Quote:
Originally Posted by thEsp View Post
Code:
// Next time use proper () tags to put the code on. #include <amxmodx> #include <engine> #include <fakemeta> new bool:is_sprinting[33] = false public plugin_init() {     register_plugin("Speed","1.3","Unknown")     register_clcmd("+sprint","start_speed")     register_clcmd("-sprint","end_speed") } public start_speed(id) if(get_user_flags(id) & ADMIN_IMMUNITY){     is_sprinting[id] = true     return PLUGIN_HANDLED; } public end_speed(id){     is_sprinting[id] = false     return PLUGIN_HANDLED; } public server_frame(){     for(new i=0; i < get_maxplayers(); i++) {         if(is_sprinting[i] == true){             set_speed(i);         }     } } public set_speed(id){     if(!is_user_alive(id)) return PLUGIN_HANDLED;     new Float:returnV[3], Float:Original[3]     VelocityByAim ( id,600, returnV )     pev(id,pev_velocity,Original)     returnV[2] = Original[2]         set_pev(id,pev_velocity,returnV)     return PLUGIN_HANDLED; }
Use get_players() instead of looping from 1 to MaxPlayers, or at least cache get_maxplayers() into a global variable in plugin_init()
__________________
edon1337 is offline