Raised This Month: $ Target: $400
 0% 

Error get_user_origin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
javinuevo
Junior Member
Join Date: Apr 2013
Old 02-08-2016 , 14:29   Error get_user_origin
Reply With Quote #1

Hi, this is my code:
PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <cstrike>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"

new posicion[33][3];

public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_clcmd("say /tp""teletransporte")
}
public 
teletransporte(id)
{
    
get_user_origin(idposicion[id], 1);
    
set_user_origin(idposicion[id]);

So that means that when I say /tp on chat I must be teleported to the place where my weapon(crosshair) is looking, but it teleport at the same place where I am but with about 10 more unities on Z var
Help plz, Thank you.
javinuevo is offline
wickedd
Veteran Member
Join Date: Nov 2009
Old 02-08-2016 , 15:22   Re: Error get_user_origin
Reply With Quote #2

PHP Code:
public teletransporte(id)
{    
    new 
mOrigin]
    
    
get_user_originidmOrigin);
    
set_user_originidmOrigin );
    

This should do what you want, but you will get stuck in walls.
__________________
Just buy the fucking game!!!!
I hate No-Steamers and lazy ass people.
wickedd is offline
snezzsp
BANNED
Join Date: Apr 2015
Location: GB
Old 02-08-2016 , 15:25   Re: Error get_user_origin
Reply With Quote #3

Don't try to make a player teleport with 4 lines of code.
snezzsp is offline
Send a message via ICQ to snezzsp Send a message via AIM to snezzsp Send a message via Yahoo to snezzsp Send a message via Skype™ to snezzsp
siriusmd99
Veteran Member
Join Date: Oct 2013
Location: Republic of Moldova
Old 02-09-2016 , 08:43   Re: Error get_user_origin
Reply With Quote #4

Look at Warcraft mode source code on human aliance teleport when he uses "ultimate"

search for register_clcmd "ultimate" and then look to human aliance class.

Last edited by siriusmd99; 02-09-2016 at 08:45.
siriusmd99 is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 02-09-2016 , 10:30   Re: Error get_user_origin
Reply With Quote #5

Probably not the most precise approach, but it should do what you want. I may work later on this, if something is not working as you want.

Spoiler
__________________

Last edited by HamletEagle; 02-09-2016 at 10:34.
HamletEagle is offline
Reply


Thread Tools
Display Modes

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 09:26.


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