I want to make a plugin so that when you bind a key, and when you hold that key down, whoever you set it to when you bound it flies into the air. I am having trouble getting this to work. Here is what I have...
Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <engine>
#include <fun>
public plugin_init(){
register_plugin("Rockets","0.0.1","Shibz")
register_clcmd("+amx_fly","cmdFly")
register_clcmd("-amx_fly","cmdunFly")
}
public cmdFly(id,level,cid) {
if (!(get_user_flags(id)&ADMIN_RCON)) {
client_print(id,print_console,"[AMXX] You have no access to that command")
return PLUGIN_HANDLED
}
new arg[32],arg2[3]
read_argv(1,arg,31)
new player = cmd_target(id,arg,5)
if (!player)
return PLUGIN_HANDLED
new sPlayer[2]
sPlayer[0] = player
new victim
set_user_gravity(victim,-1.50)
client_cmd(victim,"+jump;wait;wait;-jump")
return PLUGIN_CONTINUE
new playername[32]
get_user_name(player,playername,31)
return PLUGIN_HANDLED
}
public cmdunFly(id,level,cid) {
if (!(get_user_flags(id)&ADMIN_RCON)) {
client_print(id,print_console,"[AMXX] You have no access to that command")
return PLUGIN_HANDLED
}
new arg[32],arg2[3]
read_argv(1,arg,31)
new player = cmd_target(id,arg,5)
if (!player)
return PLUGIN_HANDLED
new sPlayer[2]
sPlayer[0] = player
new victim
set_user_gravity(victim,1.00)
client_cmd(victim,"+jump;wait;wait;-jump")
return PLUGIN_CONTINUE
new playername[32]
get_user_name(player,playername,31)
return PLUGIN_HANDLED
}
I used Lud's jetpack mod as a reference, and I copied a little... this is only my second plugin.