im newb and have made this plugin, and i'm wanting to add a knife function so that you can only go fast with a knife out if the knife cvar is turned on.
i also need help with amx_nosmod so that it toggles the sv_nosmod on and off.
also could i get some help adding a timming function to it please, say that it only last's bout 3 seconds then takes 10 seconds to load.
thanks a bunch.
could you please also tell me what you did to it?
Code:
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <cstrike>
#define PLUGIN "NOSMod"
#define VERSION "0.1"
#define AUTHOR "DeadlyGFX"
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_cvar("sv_nosmod","1")
register_cvar("sv_nosmod_knife","1")
register_clcmd("+nos", "nos_on")
register_clcmd("-nos", "nos_off")
register_concmd("amx_nosmod","nosmod",ADMIN_SLAY,": toggle's NOSMod on and off")
}
public nosmod(id,level,cid) {
if (!cmd_access(id,level,cid,2))
return PLUGIN_HANDLED
if (get_cvar_num("sv_nosmod")==0) {
set_cvar_string("sv_nosmod","1")
server_print("NOSMod is now on!! bind [key] +nos. To use it.")
}
else {
set_cvar_string("sv_nosmod","0")
server_print("NOSMod is now off!! The admin must be a fucken pussy!!")
}
return PLUGIN_HANDLED
}
public nos_on(id){
if (!get_cvar_num("sv_nosmod")||!is_user_alive(id))
return PLUGIN_HANDLED
if (get_cvar_num("sv_nosmod_knife")==0){
server_cmd ("sv_maxspeed 1500")
client_print(id,print_chat, "Hold on tight!!")
(set_user_maxspeed(id, 2000.0))
client_cmd(id, "cl_forwardspeed 1500");
client_cmd(id, "cl_sidespeed 1500");
client_cmd(id, "cl_backspeed 1500");
}
else {
if (get_cvar_num("sv_nosmod_knife")==1){
if (cs_get_weapon_id(id)==CSW_KNIFE){
server_cmd ("sv_maxspeed 1500")
client_print(id,print_chat, "Hold on tight!!")
(set_user_maxspeed(id, 2000.0))
client_cmd(id, "cl_forwardspeed 1500");
client_cmd(id, "cl_sidespeed 1500");
client_cmd(id, "cl_backspeed 1500");
}
else {
return PLUGIN_HANDLED
}
}
}
return PLUGIN_HANDLED
}
public nos_off(id){
if (get_cvar_num("sv_nosmod")==0)
(set_user_maxspeed(id, 0.0))
client_cmd(id, "cl_forwardspeed 400");
client_cmd(id, "cl_sidespeed 400");
client_cmd(id, "cl_backspeed 400");
return PLUGIN_HANDLED
}
__________________