Raised This Month: $ Target: $400
 0% 

Teleport


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 05-10-2007 , 10:37   Teleport
Reply With Quote #1

Hi.I have this plugin that teleport an player,where he aim!But when i'm teleporting i'm stuck in wall! I think i should use trace_line,to block player when he hit wall, but dunno how to do that...

Code:
#include <amxmodx>
#include <fun>
 
#define PLUGIN "Teleport"
#define VERSION "1.0"
#define AUTHOR "Alka"
 
public plugin_init() {
 
    register_plugin(PLUGIN, VERSION, AUTHOR)
    register_clcmd("say /teleport","cmd_teleport");
}
public cmd_teleport(id) {
 
   new origin[3]
   get_user_origin(id,origin,3)
 
   set_user_origin(id,origin)
}
Can someone show me how to do that?
Thanks...
__________________
Still...lovin' . Connor noob! Hello
Alka is offline
VEN
Veteran Member
Join Date: Jan 2005
Old 05-10-2007 , 12:48   Re: Teleport
Reply With Quote #2

Works fine for walls. Still need to handle floor/ceiling/corner situations but i do not have a time.
Code:
#include <amxmodx> #include <fakemeta> #include <xs> public plugin_init() {         register_concmd("tst", "func") } public func(id) {         static Float:start[3], Float:dest[3]         pev(id, pev_origin, start)         pev(id, pev_view_ofs, dest)         xs_vec_add(start, dest, start)         pev(id, pev_v_angle, dest)         engfunc(EngFunc_MakeVectors, dest)         global_get(glb_v_forward, dest)         xs_vec_mul_scalar(dest, 9999.0, dest)         xs_vec_add(start, dest, dest)         engfunc(EngFunc_TraceLine, start, dest, IGNORE_MONSTERS, id, 0)         get_tr2(0, TR_vecEndPos, start)         get_tr2(0, TR_vecPlaneNormal, dest)         static const player_hull[] = {HULL_HUMAN, HULL_HEAD}         engfunc(EngFunc_TraceHull, start, start, DONT_IGNORE_MONSTERS, player_hull[_:!!(pev(id, pev_flags) & FL_DUCKING)], id, 0)         if (!get_tr2(0, TR_StartSolid) && !get_tr2(0, TR_AllSolid) && get_tr2(0, TR_InOpen)) {                 engfunc(EngFunc_SetOrigin, id, start)                 return PLUGIN_HANDLED         }         static Float:size[3]         pev(id, pev_size, size)         xs_vec_mul_scalar(dest, (size[0] + size[1]) / 2.0, dest)         xs_vec_add(start, dest, dest)         engfunc(EngFunc_SetOrigin, id, dest)         return PLUGIN_HANDLED }
VEN is offline
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 05-10-2007 , 13:12   Re: Teleport
Reply With Quote #3

Thanks VEN...it's working! but when you have time,i want to block teleport to floor to!
__________________
Still...lovin' . Connor noob! Hello
Alka is offline
regalis
Veteran Member
Join Date: Jan 2007
Location: F*cking Germany
Old 05-10-2007 , 13:33   Re: Teleport
Reply With Quote #4

Quote:
Originally Posted by VEN View Post
Works fine for walls. Still need to handle floor/ceiling/corner situations but i do not have a time.
Code:
#include <amxmodx> #include <fakemeta> #include <xs> public plugin_init() { register_concmd("tst", "func") } public func(id) { static Float:start[3], Float:dest[3] pev(id, pev_origin, start) pev(id, pev_view_ofs, dest) xs_vec_add(start, dest, start) pev(id, pev_v_angle, dest) engfunc(EngFunc_MakeVectors, dest) global_get(glb_v_forward, dest) xs_vec_mul_scalar(dest, 9999.0, dest) xs_vec_add(start, dest, dest) engfunc(EngFunc_TraceLine, start, dest, IGNORE_MONSTERS, id, 0) get_tr2(0, TR_vecEndPos, start) get_tr2(0, TR_vecPlaneNormal, dest) static const player_hull[] = {HULL_HUMAN, HULL_HEAD} engfunc(EngFunc_TraceHull, start, start, DONT_IGNORE_MONSTERS, player_hull[_:!!(pev(id, pev_flags) & FL_DUCKING)], id, 0) if (!get_tr2(0, TR_StartSolid) && !get_tr2(0, TR_AllSolid) && get_tr2(0, TR_InOpen)) { engfunc(EngFunc_SetOrigin, id, start) return PLUGIN_HANDLED } static Float:size[3] pev(id, pev_size, size) xs_vec_mul_scalar(dest, (size[0] + size[1]) / 2.0, dest) xs_vec_add(start, dest, dest) engfunc(EngFunc_SetOrigin, id, dest) return PLUGIN_HANDLED }
OMFG! I would need a year to code this or maybe forever *lol*
I heard that you will make another nice tutorial about that

Great!
greetz regalis
__________________
regalis is offline
Styles
Veteran Member
Join Date: Jul 2004
Location: California
Old 05-10-2007 , 16:58   Re: Teleport
Reply With Quote #5

when you have time ven could you please explain that. FakeMeta is very hard for me and I would Love to learn it.
Styles is offline
Send a message via AIM to Styles
regalis
Veteran Member
Join Date: Jan 2007
Location: F*cking Germany
Old 05-10-2007 , 18:18   Re: Teleport
Reply With Quote #6

Quote:
Originally Posted by styles View Post
when you have time ven could you please explain that. FakeMeta is very hard for me and I would Love to learn it.
I second that!!
__________________

Last edited by regalis; 05-10-2007 at 18:24.
regalis is offline
_lol_
Senior Member
Join Date: Apr 2009
Old 04-23-2009 , 14:38   Re: Teleport
Reply With Quote #7

when i aim at the floor and teleport my y get stuck on the floor...why?
_lol_ is offline
SnoW
Veteran Member
Join Date: Oct 2008
Location: Finland WisdomNuggets: 8
Old 04-23-2009 , 15:02   Re: Teleport
Reply With Quote #8

Quote:
Originally Posted by _lol_ View Post
when i aim at the floor and teleport my y get stuck on the floor...why?
If you actually read the thread before posting you would know that it doesn't work for floor, but only walls. Actually it was said many times lol.
Quote:
Originally Posted by styles View Post
FakeMeta is very hard for me and I would Love to learn it.
Wow that's long time ago.
SnoW is offline
Send a message via MSN to SnoW
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 10:37.


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