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

Creating a perfect clone


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
cravenge
Veteran Member
Join Date: Nov 2015
Location: Chocolate Factory
Old 01-13-2017 , 04:51   Creating a perfect clone
Reply With Quote #1

Hi, everyone. I could use some help from you.

As what the title says, that's what I have trouble with. I have this neat piece of code here to create clones.
PHP Code:
void TamperModel(int clientbool apply)
{
    if (
apply)
    {
        
float realOrigin[3], realAngles[3];
        
        
GetEntPropVector(clientProp_Send"m_vecOrigin"realOrigin);
        
GetClientEyeAngles(clientrealAngles);
        
        
realAngles[0] += 90.0;
        
        
char currentModel[PLATFORM_MAX_PATH];
        
GetEntPropString(clientProp_Data"m_ModelName"currentModelsizeof(currentModel));
        
        
int fakeModel CreateEntityByName("prop_dynamic_override");
        
SetEntityModel(fakeModelcurrentModel);
        
        
TeleportEntity(fakeModelrealOriginrealAnglesNULL_VECTOR);
        
DispatchSpawn(fakeModel);
        
        
SetEntityRenderMode(fakeModelRENDER_NORMAL);
        
SetEntityRenderColor(fakeModel255255255255);
        
        
SetEntProp(fakeModelProp_Send"m_CollisionGroup"0);
        
SetEntProp(fakeModelProp_Send"m_nSolidType"6);
        
        
SetEntPropFloat(fakeModelProp_Send"m_fadeMinDist"10000.0);
        
SetEntPropFloat(fakeModelProp_Send"m_fadeMaxDist"20000.0);
        
        
modelFake[client] = fakeModel;
        
SetEntityMoveType(clientMOVETYPE_WALK); //real player still doesn't walk afterwards
        
        
SDKHook(clientSDKHook_SetTransmitBugModel);
        
CreateTimer(0.1ProcessFakeModelclientTIMER_REPEAT);
    }
    else
    {
        
SDKUnhook(clientSDKHook_SetTransmitBugModel);
        if (
IsValidEnt(modelFake[client]))
        {
            
AcceptEntityInput(modelFake[client], "Kill");
            
modelFake[client] = 0;
        }
    }
}

public 
Action ProcessFakeModel(Handle timerany client)
{
    if (!
IsValidEnt(modelFake[client]))
    {
        return 
Plugin_Stop;
    }
    
    
int currentSequence GetEntProp(clientProp_Send"m_nSequence");
    
    
float currentOrigin[3], currentAngles[3];
    
    
GetEntPropVector(clientProp_Send"m_vecOrigin"currentOrigin);
    
GetClientEyeAngles(clientcurrentAngles);
    
    
currentAngles[0] += 90.0;
    
    
SetEntProp(modelFake[client], Prop_Send"m_nSequence"currentSequence);
    
TeleportEntity(modelFake[client], currentOrigincurrentAnglesNULL_VECTOR);
    
    return 
Plugin_Continue;
}

public 
Action BugModel(int entityint client)
{
    return 
Plugin_Handled;

As you can see, it follows the real player's sequence while making the real player hidden but the problem is already stated there, the real player acts as if it was climbing on a ladder, teleporting to where the clone was after removing it.

Last edited by cravenge; 01-13-2017 at 04:54.
cravenge 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 17:19.


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