Raised This Month: $51 Target: $400
 12% 

Help 'TeleportEntity' Problem


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Nika
New Member
Join Date: Oct 2011
Old 11-04-2011 , 08:58   Help 'TeleportEntity' Problem
Reply With Quote #1

public Action:TouchHook(entity, other)
{
new Float:vReturn[3], Float:cOri[3], Float:eOri[3];

GetEntPropVector(entity, Prop_Send, "m_vecOrigin", eOri);
GetEntPropVector(other, Prop_Send, "m_vecOrigin", cOri);

MakeVectorFromPoints(eOri, cOri, vReturn);
NormalizeVector(vReturn, vReturn);
ScaleVector(vReturn, 100.0);

TeleportEntity(other, NULL_VECTOR, NULL_VECTOR, vReturn);
}

prop TeleportEntity nice work
but player TeleportEntity not work
__________________

My English Badddd!
Nika is offline
tjdgns9246
Member
Join Date: Dec 2009
Old 11-05-2011 , 03:46   Re: Help 'TeleportEntity' Problem
Reply With Quote #2

Quote:
Originally Posted by Nika View Post
public Action:TouchHook(entity, other)
{
new Float:vReturn[3], Float:cOri[3], Float:eOri[3];

GetEntPropVector(entity, Prop_Send, "m_vecOrigin", eOri);
GetEntPropVector(other, Prop_Send, "m_vecOrigin", cOri);

MakeVectorFromPoints(eOri, cOri, vReturn);
NormalizeVector(vReturn, vReturn);
ScaleVector(vReturn, 100.0);

TeleportEntity(other, NULL_VECTOR, NULL_VECTOR, vReturn);
}

prop TeleportEntity nice work
but player TeleportEntity not work
i can't find out what is player or entity.

and you only pushed 'other'
tjdgns9246 is offline
Nika
New Member
Join Date: Oct 2011
Old 11-05-2011 , 06:22   Re: Help 'TeleportEntity' Problem
Reply With Quote #3

Quote:
Originally Posted by tjdgns9246 View Post
i can't find out what is player or entity.

and you only pushed 'other'
TouchHook 'other' is touch all enetity ( players , props , world etc.. )
__________________

My English Badddd!

Last edited by Nika; 11-05-2011 at 06:23.
Nika is offline
Blowst
Senior Member
Join Date: Feb 2011
Location: Korea, Republic of
Old 11-05-2011 , 08:19   Re: Help 'TeleportEntity' Problem
Reply With Quote #4

Quote:
Originally Posted by tjdgns9246 View Post
i can't find out what is player or entity.

and you only pushed 'other'
as you know, touch hook is happened to both entity
__________________
Sorry about my poor English

Blowst is offline
tjdgns9246
Member
Join Date: Dec 2009
Old 11-05-2011 , 13:08   Re: Help 'TeleportEntity' Problem
Reply With Quote #5

how do you want to make client like?

Quote:
entity's origin = eOri
client's origin = cOri

vector's direction = entity ------> client
you pushed client to the direction like above

if you want to push client to entity's origin

change this

PHP Code:
MakeVectorFromPoints(eOricOrivReturn); 
to

PHP Code:
MakeVectorFromPoints(cOrieOrivReturn); 

Last edited by tjdgns9246; 11-05-2011 at 13:09.
tjdgns9246 is offline
Nika
New Member
Join Date: Oct 2011
Old 11-05-2011 , 14:03   Re: Help 'TeleportEntity' Problem
Reply With Quote #6

Quote:
Originally Posted by tjdgns9246 View Post
i can't find out what is player or entity.

and you only pushed 'other'
Quote:
Originally Posted by tjdgns9246 View Post
how do you want to make client like?



you pushed client to the direction like above

if you want to push client to entity's origin

change this

PHP Code:
MakeVectorFromPoints(eOricOrivReturn); 
to

PHP Code:
MakeVectorFromPoints(cOrieOrivReturn); 
i already try cOri <-> eOri
problem is TeleportEntity

TeleportEntity(other, vReturn, NULL_VECTOR, NULL_VECTOR); <- work
TeleportEntity(other, NULL_VECTOR, vReturn, NULL_VECTOR); <- work
TeleportEntity(other, NULL_VECTOR, NULL_VECTOR, vReturn); <- not work, player is no reactions
__________________

My English Badddd!

Last edited by Nika; 11-05-2011 at 14:09.
Nika is offline
Nika
New Member
Join Date: Oct 2011
Old 11-05-2011 , 15:44   Re: Help 'TeleportEntity' Problem
Reply With Quote #7

public Action:TouchHook(entity, other)
{
if(AllCheck(other) == true)
ServerCommand("sm_Knockback %d %d", entity, other);
}

public Action:Command_Knockback(Client, Arguments)
{
if(Arguments < 2)
{
return Plugin_Handled;
}

new Target, Target2, String:TargetEnt[32], String:TargetEnt2[32];
GetCmdArg(1, TargetEnt, sizeof(TargetEnt));
StringToIntEx(TargetEnt, Target);

GetCmdArg(2, TargetEnt2, sizeof(TargetEnt2));
StringToIntEx(TargetEnt2, Target2);

new Float:vReturn[3], Float:cOri[3], Float:eOri[3];

GetEntPropVector(Target, Prop_Send, "m_vecOrigin", eOri);
GetEntPropVector(Target2, Prop_Send, "m_vecOrigin", cOri);

MakeVectorFromPoints(eOri, cOri, vReturn);
NormalizeVector(vReturn, vReturn);
ScaleVector(vReturn, 100.0);
TeleportEntity(Target2, NULL_VECTOR, NULL_VECTOR, vReturn);
return Plugin_Handled;
}

problem solved
__________________

My English Badddd!

Last edited by Nika; 11-06-2011 at 11:09.
Nika is offline
Starbish
AlliedModders Donor
Join Date: Oct 2011
Location: South Korea
Old 11-05-2011 , 23:09   Re: Help 'TeleportEntity' Problem
Reply With Quote #8

한국인들끼리 영어로 말하넼ㅋㅋㅋㅋㅋㅋ
__________________
Starbish 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 09:41.


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