okay im trying to write this script for my server because i couldnt find one here that did what i wanted it to do. problem is i have no idea how to script. ive been looking at other peoples scripts and trying to figure it out that way and this is what ive come up with. feel free to make fun of me. im sure its a mess. what im trying to get it to do is allow a player to say /semiclip and that will turn semiclip off that player for 3 seconds then turn back on. any help please?
Code:
#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <engine>
new cp_pluginname[] = "Semiclip Toggle"
public plugin_init() {
register_plugin(cp_pluginname,"1.0","Hadoken")
register_cvar("cp_semiclip","0")
register_clcmd("semiclip","cp_semiclip",0)
register_clcmd("say /semiclip","cp_semiclip",0)
}
public cp_semiclip(id) {
if(get_cvar_num("cp_semiclip") == 0)
return PLUGIN_CONTINUE
new name[33]
get_user_name(id,name,32)
entity_set_int(id, EV_INT_solid, SOLID_NOT)
client_print(id,print_chat,"[%s] Your SemiClip Is Now Off",cp_pluginname)
set_task(3.0,"stop_clip",0,id,1)
return PLUGIN_HANDLED
}
public stop_clip(id) {
new name[33]
get_user_name(id,name,32)
entity_set_int(id, EV_INT_solid, SOLID_BBOX)
client_print(id,print_chat,"[%s] Your Semiclip Is Now On",cp_pluginname)
return PLUGIN_HANDLED
}