AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Error get_user_origin (https://forums.alliedmods.net/showthread.php?t=278811)

javinuevo 02-08-2016 14:29

Error get_user_origin
 
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.

wickedd 02-08-2016 15:22

Re: Error get_user_origin
 
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.

snezzsp 02-08-2016 15:25

Re: Error get_user_origin
 
Don't try to make a player teleport with 4 lines of code.

siriusmd99 02-09-2016 08:43

Re: Error get_user_origin
 
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.

HamletEagle 02-09-2016 10:30

Re: Error get_user_origin
 
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


All times are GMT -4. The time now is 09:26.

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