Raised This Month: $ Target: $400
 0% 

set/get_user_origin problem


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
[ --<-@ ] Black Rose
ANNIHILATED
Join Date: Sep 2005
Location: Stockholm, Sweden.
Old 02-25-2006 , 11:20   set/get_user_origin problem
Reply With Quote #1

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 }
[ --<-@ ] Black Rose is offline
VEN
Veteran Member
Join Date: Jan 2005
Old 02-25-2006 , 11:28  
Reply With Quote #2

Here:
Code:
    get_user_origin(id, origin, 3)

Code:
// amxmodx.inc /* Gets origin from player. * Modes: <b><font color="green">* 0 - current position.</font></b> * 1 - position from eyes (weapon aiming). * 2 - end position from player position. <b><font color="red">* 3 - end position from eyes (hit point for weapon). </font></b> * 4 - position of last bullet hit (only CS). */ native get_user_origin(index, origin[3], mode = 0);

Also better check mapname only once in plugin init. If map equal your map name then set ad. task and register +/- commands.
VEN is offline
[ --<-@ ] Black Rose
ANNIHILATED
Join Date: Sep 2005
Location: Stockholm, Sweden.
Old 02-25-2006 , 11:32  
Reply With Quote #3

ok with some thinking i understand that the origin that was saved was the one on aiming point... i thought it was players location but in the direction he was looking...

so you're telling me i should do
Code:
get_user_origin(id, origin, 0)
?

how would you make him move forward... in the direction of players eyes? not the direction of the map's "forward"
[ --<-@ ] Black Rose is offline
[ --<-@ ] Black Rose
ANNIHILATED
Join Date: Sep 2005
Location: Stockholm, Sweden.
Old 02-25-2006 , 11:57  
Reply With Quote #5

thank you VEN!
[ --<-@ ] Black Rose is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 20:24.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode