Raised This Month: $32 Target: $400
 8% 

Solved Teleport an Entity above Bomb After Plant


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
kratoss1812
Senior Member
Join Date: May 2018
Location: Romānia
Old 11-23-2018 , 11:08   Teleport an Entity above Bomb After Plant
Reply With Quote #1

Can someone help me to teleport a player/entity above the bomb after plant?
My Code:

PHP Code:
..
    
HookEvent("bomb_planted"OnPlant);
..

public 
Action OnPlant(Handle hEvent, const char[] sNamebool none)
{
    
float fPos[3];
    
fPos[0] = GetEventFloat(hEvent"x");
    
fPos[1] = GetEventFloat(hEvent"y");
    
fPos[2] = GetEventFloat(hEvent"z");
        
    
int iPlanter GetClientOfUserId(GetEventInt(hEvent"userid"));

    
float fTelPos[3];
    
fTelPos[0] = fPos[0] += 500.0// this is just for testing
    
fTelPos[1] = fPos[1] += 500.0;
    
fTelPos[2] = fPos[2] += 500.0// this is just for testing
    
    
TeleportEntity(iPlanterfTelPosNULL_VECTORNULL_VECTOR);
    

I don't know why, but the player is teleported in the center of the map insted above the bomb.
Thanks!
__________________

Last edited by kratoss1812; 11-24-2018 at 04:57.
kratoss1812 is offline
Mrs cheng
Member
Join Date: Mar 2017
Old 11-23-2018 , 11:15   Re: Teloport an Entity above Bomb After Plant
Reply With Quote #2

CSS or CSGO?
Mrs cheng is offline
kratoss1812
Senior Member
Join Date: May 2018
Location: Romānia
Old 11-23-2018 , 11:42   Re: Teloport an Entity above Bomb After Plant
Reply With Quote #3

Quote:
Originally Posted by Mrs cheng View Post
CSS or CSGO?
CSGO
__________________
kratoss1812 is offline
Facksy
Senior Member
Join Date: Apr 2017
Location: +2+2
Old 11-23-2018 , 11:46   Re: Teloport an Entity above Bomb After Plant
Reply With Quote #4

There is no x, y, and z parameters in that event

Instead, you can get the abs position of the planter and do your stuff
__________________
My Steam I take private requests if related with TF2
My Plugins

Last edited by Facksy; 11-23-2018 at 11:48.
Facksy is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 11-23-2018 , 11:52   Re: Teloport an Entity above Bomb After Plant
Reply With Quote #5

Like @Facksy said. Another is find entity "planted_c4" and take position of that
__________________
Do not Private Message @me
Bacardi is offline
kratoss1812
Senior Member
Join Date: May 2018
Location: Romānia
Old 11-23-2018 , 13:23   Re: Teloport an Entity above Bomb After Plant
Reply With Quote #6

PHP Code:
public Action OnPlant(Handle hEvent, const char[] sNamebool none)
{
    static 
float fDir[3]; 
    
    
int iPlanter GetClientOfUserId(GetEventInt(hEvent"userid"));
    
    
float fPos[3];
    
GetClientAbsOrigin(iPlanterfPos);
    
fPos[2] += 100.0;
    
    
TeleportEntity(iPlanterfPosNULL_VECTORNULL_VECTOR);

Still not working.. any other help?
__________________
kratoss1812 is offline
eyal282
Veteran Member
Join Date: Aug 2011
Old 11-23-2018 , 14:50   Re: Teloport an Entity above Bomb After Plant
Reply With Quote #7

It already happens. If you plant a bomb, it teleports to your feet, it doesn't even get dropped like CS 1.6, get the planters position if you wish to do something about it. If you wanna teleport the planter to the bomb then it's basically doing nothing.
__________________
I am available to make plugins for pay.

Discord: Eyal282#1334
eyal282 is offline
kratoss1812
Senior Member
Join Date: May 2018
Location: Romānia
Old 11-23-2018 , 15:04   Re: Teloport an Entity above Bomb After Plant
Reply With Quote #8

Quote:
Originally Posted by eyal282 View Post
It already happens. If you plant a bomb, it teleports to your feet, it doesn't even get dropped like CS 1.6, get the planters position if you wish to do something about it. If you wanna teleport the planter to the bomb then it's basically doing nothing.
I want to create a spark using This, but I can't get the position above the bomb after plant and I tried to teleport myself after plant to see exactly where the spark will be.
__________________
kratoss1812 is offline
eyal282
Veteran Member
Join Date: Aug 2011
Old 11-23-2018 , 15:20   Re: Teloport an Entity above Bomb After Plant
Reply With Quote #9

Quote:
Originally Posted by kratoss1812 View Post
I want to create a spark using This, but I can't get the position above the bomb after plant and I tried to teleport myself after plant to see exactly where the spark will be.
Get the player position and increase / reduce 70 / 5. Meaning you gotta make 4 tests.
__________________
I am available to make plugins for pay.

Discord: Eyal282#1334
eyal282 is offline
kratoss1812
Senior Member
Join Date: May 2018
Location: Romānia
Old 11-23-2018 , 15:44   Re: Teloport an Entity above Bomb After Plant
Reply With Quote #10

Quote:
Originally Posted by eyal282 View Post
Get the player position and increase / reduce 70 / 5. Meaning you gotta make 4 tests.
ok, but what value should I modify?
fPos[2] += 70 something like that?
__________________
kratoss1812 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 21:49.


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