AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Snippets and Tutorials (https://forums.alliedmods.net/forumdisplay.php?f=112)
-   -   Entity System v1.1 (https://forums.alliedmods.net/showthread.php?t=315369)

xfusionlockx 04-04-2019 14:26

Entity System v1.1
 
A couple months ago, I wrote a basic entity control system for props and prop ownership so I didn't have to each time I want to write a new building plugin.

Features:
Quote:

  • Prop Ownership
  • Prop Naming
  • Getting Entity Type
    • Cycler - cycler
    • Door - prop_door_rotating
    • Dynamic - prop_dynamic
    • Light - prop_light
    • NPC - npc_
    • Physics - prop_physics
    • Unknown
  • Setting Render Color
  • Setting Entity Motion
  • Extra Information Storing
  • Teleporting To Crosshair

Changelog:
Quote:

  • v1.1 - Updated a critical flaw in the system so now it'll actually work.
  • v1.0 - Added the system.

It's pretty simple and easy to use. I plan on writing up better documentation.

Prop Spawning Example: [4/8/19: Updated]
Code:

int iProp = CreateProp(Entity Name (cycler, prop_dynamic_override, prop_physics_override), Entity Model, Prop Name);
       
EntitySystem iEntity = EntitySystem(iProp);
       
iEntity.SetColor(255, 255, 255, 255);
       
iEntity.TeleportToCrosshair(iClient);
       
iEntity.Owner = iClient;

entitysystem.inc v1.1 Download

404UserNotFound 04-04-2019 16:37

Re: Entity System v1.0
 
This is the perfect thing for this entity management system I'm working on that allows for on-the-fly editing of any entity.

SHUFEN 04-05-2019 22:01

Re: Entity System v1.0
 
looks good! Thanks.

xfusionlockx 04-08-2019 15:04

Re: Entity System v1.1
 
Well, it's updated so it'll work properly now.

Dragokas 05-15-2019 07:43

Re: Entity System v1.1
 
Missing CloseHandle

PHP Code:

    public void TeleportToCrosshair(int iClient)
    {
        
float fAngles[3], fFinalAngles[3], fFinalOrigin[3], fOrigin[3];
        
        
GetClientEyePosition(iClientfOrigin);
        
GetClientEyeAngles(iClientfAngles);
        
GetClientAbsAngles(iClientfFinalAngles);
        
        
Handle hTraceRay TR_TraceRayFilterEx(fOriginfAnglesMASK_SOLIDRayType_InfiniteOFilterPlayer);
        
        if (
TR_DidHit(hTraceRay))
        {
            
TR_GetEndPosition(fFinalOriginhTraceRay);
            
            
TeleportEntity(this.iEntityfFinalOriginfFinalAnglesNULL_VECTOR);
        }
    } 


xfusionlockx 06-08-2019 04:42

Re: Entity System v1.1
 
Quote:

Originally Posted by Dragokas (Post 2651731)
Missing CloseHandle

PHP Code:

    public void TeleportToCrosshair(int iClient)
    {
        
float fAngles[3], fFinalAngles[3], fFinalOrigin[3], fOrigin[3];
        
        
GetClientEyePosition(iClientfOrigin);
        
GetClientEyeAngles(iClientfAngles);
        
GetClientAbsAngles(iClientfFinalAngles);
        
        
Handle hTraceRay TR_TraceRayFilterEx(fOriginfAnglesMASK_SOLIDRayType_InfiniteOFilterPlayer);
        
        if (
TR_DidHit(hTraceRay))
        {
            
TR_GetEndPosition(fFinalOriginhTraceRay);
            
            
TeleportEntity(this.iEntityfFinalOriginfFinalAnglesNULL_VECTOR);
        }
    } 


Thank you, I've decided to re-build this from the ground up while developing a mod with it. The old version was rushed and not fully tested.


All times are GMT -4. The time now is 00:17.

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