ok guys... need help with this script...
it suppose to move slowly forward ( the same way as the player is aiming ) but it teleports you over the hole map in one second :S
and its not any problem with set task is to fast... its the set/get_user_origin() and/or origin[1]++ i think
heres the scripts
Code:
#include <amxmodx>
#include <fun>
#define PLUGIN "CageCMD"
#define VERSION "1.0"
#define AUTHOR "[ --<-@ ]"
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_clcmd("+cagecmd", "start_cmd")
register_clcmd("-cagecmd", "stop_cmd")
cmd_ad()
}
public start_cmd(id) {
new mapname[32]
get_mapname( mapname, 31 )
if ( ! equali( mapname, "surf_ski") ) {
return PLUGIN_HANDLED
}
set_task( 0.1, "move_forward", id, _, _, "b")
return PLUGIN_CONTINUE
}
public stop_cmd(id) {
remove_task(id)
}
public move_forward(id) {
new origin[3]
get_user_origin(id, origin, 3)
origin[1]++
set_user_origin(id, origin)
}
public cmd_ad() {
new mapname[32]
get_mapname( mapname, 31 )
if ( ! equali( mapname, "surf_ski") ) {
return PLUGIN_HANDLED
}
client_print( 0, print_chat, "to get out of jail use +cagecmd")
client_print( 0, print_chat, "please bind it using: bind key ^"+cagecmd^"")
set_task( 60.0, "cmd_ad", 0 )
return PLUGIN_CONTINUE
}