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

[L4D2] prop_dynamic_override couldn't teleport with velocity


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
LinLinLin
Senior Member
Join Date: Sep 2021
Old 12-08-2023 , 22:06   [L4D2] prop_dynamic_override couldn't teleport with velocity
Reply With Quote #1

code:
PHP Code:
    int entity CreateEntityByName("prop_dynamic_override");
    if( 
entity || !IsValidEntity(entity) )
        return 
Plugin_Handled;
    
    
DispatchKeyValue(entity"model"PIPEBOMB);
    
DispatchKeyValue(entity"spawnflags""256");
    
DispatchKeyValue(entity"disablereceiveshadows""1");
    
DispatchKeyValue(entity"disableshadows""1");
    
DispatchKeyValue(entity"solid""0");
    
SetEntProp(entityProp_Send"m_nSolidType"61);
    
SetEntProp(entityProp_Send"m_CollisionGroup"2);
    
DispatchSpawn(entity);
    
g_pipebomb[client] = entity;
    
PrintToChat(client"Create pipebomb for client %N"client); 
teleport code in SDKHook_PostThink callback for client.
PHP Code:
    GetEntPropVector(g_pipebomb[client], Prop_Data"m_vecAbsOrigin"currentpos);
    
GetEntPropVector(g_pipebomb[client], Prop_Data"m_angAbsRotation"currentang);
    
PrintToServer("Entity(%d) pos %.1f,%.1f,%.1f ang %.1f,%.1f,%.1f"g_pipebomb[client],
    
currentpos[0],currentpos[1],currentpos[2],
    
currentang[0],currentang[1],currentang[2]);
    
PrintToServer("Target(%d) pos %.1f,%.1f,%.1f ang %.1f,%.1f,%.1f"target,
    
targetpos[0],targetpos[1],targetpos[2],
    
targetang[0],targetang[1],targetang[2]);

    
MakeVectorFromPoints(currentpostargetposvel);
    
PrintToServer("Vel %.0f, %.0f, %.0f"vel[0],vel[1],vel[2]);
    
TeleportEntity(g_pipebomb[client], NULL_VECTORtargetangvel); 
teleport not work for velocity, but ang are changed successfully.
pos and vel num are correct base on the print infomation.
does something wrong with the code?

Last edited by LinLinLin; 12-08-2023 at 22:08.
LinLinLin is offline
King_OXO
Senior Member
Join Date: Dec 2020
Location: Brazil
Old 12-08-2023 , 22:33   Re: [L4D2] prop_dynamic_override couldn't teleport with velocity
Reply With Quote #2

Quote:
Originally Posted by LinLinLin View Post
code:
PHP Code:
    int entity CreateEntityByName("prop_dynamic_override");
    if( 
entity || !IsValidEntity(entity) )
        return 
Plugin_Handled;
    
    
DispatchKeyValue(entity"model"PIPEBOMB);
    
DispatchKeyValue(entity"spawnflags""256");
    
DispatchKeyValue(entity"disablereceiveshadows""1");
    
DispatchKeyValue(entity"disableshadows""1");
    
DispatchKeyValue(entity"solid""0");
    
SetEntProp(entityProp_Send"m_nSolidType"61);
    
SetEntProp(entityProp_Send"m_CollisionGroup"2);
    
DispatchSpawn(entity);
    
g_pipebomb[client] = entity;
    
PrintToChat(client"Create pipebomb for client %N"client); 
teleport code in SDKHook_PostThink callback for client.
PHP Code:
    GetEntPropVector(g_pipebomb[client], Prop_Data"m_vecAbsOrigin"currentpos);
    
GetEntPropVector(g_pipebomb[client], Prop_Data"m_angAbsRotation"currentang);
    
PrintToServer("Entity(%d) pos %.1f,%.1f,%.1f ang %.1f,%.1f,%.1f"g_pipebomb[client],
    
currentpos[0],currentpos[1],currentpos[2],
    
currentang[0],currentang[1],currentang[2]);
    
PrintToServer("Target(%d) pos %.1f,%.1f,%.1f ang %.1f,%.1f,%.1f"target,
    
targetpos[0],targetpos[1],targetpos[2],
    
targetang[0],targetang[1],targetang[2]);

    
MakeVectorFromPoints(currentpostargetposvel);
    
PrintToServer("Vel %.0f, %.0f, %.0f"vel[0],vel[1],vel[2]);
    
TeleportEntity(g_pipebomb[client], NULL_VECTORtargetangvel); 
teleport not work for velocity, but ang are changed successfully.
pos and vel num are correct base on the print infomation.
does something wrong with the code?
Use molotov_projectile. Valve did not develop prop dynamics objects to be movable, just projectiles, players and prop_physics
__________________
My Noob Plugins

Discord:WhiteFire#1301
Steam:WhiteFire
Youtube
King_OXO 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 10:19.


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