Raised This Month: $ Target: $400
 0% 

[HL2DM] Customguns


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
ChoclatePancake
Junior Member
Join Date: Sep 2009
Old 01-14-2017 , 16:10   Re: [HL2DM] Customguns
Reply With Quote #26

Quote:
Originally Posted by Alienmario View Post
although a definite breaker would be if synergy lacked the weapon_cubemap entity.
If you want to try you'll need synergy's linux server file to get the offsets, convert either with this dumper or manually
Thanks man ill look into this

Quote:
Originally Posted by Alienmario View Post
Btw does synergy have any built-in support for custom weapons?
Well the models materials and script files can be sent to and downloaded by clients
but i tried giving myself the weapon_hands that was used in this plugin and even though i have the weapon_hands.txt in the server's scripts folder (where there are already stock weapons like weapon_slam) it didnt turn up as a vaild entity
so perhaps theres a step i dont know of where you actually register that weapon_hands.txt as an entity
if so id love to find out how to do that!

also as a side note id love to find out how to create new npcs because i
have custom models and sounds for some of the default entities and so i've been working on a plugin that onEntitySpawned if its a certain npc class it's model gets replaced however in game the only class that seems to be getting its model updated is npc_combine_s and i have no idea what im missing or doing wrong, i think perhaps the hook gets called before the npc actually gets its model (even though npc_combine_s gets his damn model) idk for sure heres the code
PHP Code:
public OnEntityCreated(entity, const String:classname[])
{
    
//PrintToServer("[SM] v%s: %d entity spawned.", PLUGIN_VERSION, classname);
    // decl String:playerSlotName[64];
    // GetEntityClassname( entity, playerSlotName, sizeof( playerSlotName ));
    // if ( StrEqual( playerSlotName, "npc_metropolice", false ))
    // {
    //     PrintToServer("[SM] Metropolice found at %s", classname);
    // }
    
SDKHook(entitySDKHook_SpawnOnEntitySpawned);
}

public 
OnEntitySpawned(entity)
{
    
decl String:cheese[128];
    
GetEntityClassnameentitycheesesizeofcheese ));
    if ( 
StrEqualcheese"npc_barney"false ))
    {
        
PrintToServer("[SM] Barney found at %s"cheese);
        
        
decl String:ModelName[256];
        
GetEntPropString(entityProp_Data"m_ModelName"ModelNamesizeof(ModelName));
        if (
StrEqual(ModelName"models/barney.mdl"))
        {
            
PrecacheModel("models/ChoclatePancake/barneyhelmet_faceplate.mdl");
            
PrecacheModel("models/ChoclatePancake/barneyhelmet.mdl");
            
PrecacheModel("models/ChoclatePancake/barney.mdl");
            
SetEntityModel(entity"models/ChoclatePancake/barney.mdl");
        }
    }
    if ( 
StrEqualcheese"npc_combine_s"false ))
    {
        
PrintToServer("[SM] %s Given New Model"cheese);
        
// PrecacheModel("models/alyx.mdl");
        // SetEntityModel(entity, "models/alyx.mdl");
        
        
decl String:ModelName[256];
        
GetEntPropString(entityProp_Data"m_ModelName"ModelNamesizeof(ModelName));
        if (
StrEqual(ModelName"models/combine_soldier.mdl"))
        {
            
PrecacheModel("models/ChoclatePancake/combine_soldier.mdl");
            
SetEntityModel(entity"models/ChoclatePancake/combine_soldier.mdl");
        }
        if (
StrEqual(ModelName"models/combine_soldier_prisonguard.mdl"))
        {
            
PrecacheModel("models/ChoclatePancake/combine_soldier_prisonguard.mdl");
            
SetEntityModel(entity"models/ChoclatePancake/combine_soldier_prisonguard.mdl");
        }
        if (
StrEqual(ModelName"models/combine_super_soldier.mdl"))
        {
            
PrecacheModel("models/ChoclatePancake/combine_super_soldier.mdl");
            
SetEntityModel(entity"models/ChoclatePancake/combine_super_soldier.mdl");
        }
    }
    if ( 
StrEqualcheese"npc_metropolice"false ))
    {
        
decl String:MpodelName[256];
        
GetEntPropString(entityProp_Data"m_ModelName"MpodelNamesizeof(MpodelName));
        if (
StrEqual(MpodelName"models/police.mdl"))
        {
            
PrecacheModel("models/ChoclatePancake/police.mdl");
            
SetEntityModel(entity"models/ChoclatePancake/police.mdl");
        }
        
PrintToServer("[SM] Metropolice found at %s"cheese);
    }
    if ( 
StrEqualcheese"npc_manhack"false ))
    {
        
PrintToServer("[SM] Manhack found at %s"cheese);
        
PrecacheModel("models/manhacker.mdl");
        
PrecacheSound("sound/npc/manhacker/gib.wav");
        
PrecacheSound("sound/npc/manhacker/mh_engine_loop1.wav");
        
PrecacheSound("sound/npc/manhacker/mh_engine_loop2.wav");
        
SetEntityModel(entity"models/manhacker.mdl");
    }
    
// Just incase those pesky metrocops slip past classname identification!
    
new String:lamaname[128];
    
GetEntPropString(entityProp_Data"m_ModelName"lamaname128);
    if (
StrEqual(lamaname"models/police.mdl"))
    {
        
PrecacheModel("models/ChoclatePancake/police.mdl");
        
SetEntityModel(entity"models/ChoclatePancake/police.mdl");
    }
    else if (
StrEqual(lamaname"models/police_ss.mdl"))
    {
        
PrecacheModel("models/ChoclatePancake/police.mdl");
        
SetEntityModel(entity"models/ChoclatePancake/police.mdl");
    }
    

so if that is the case than im thinking maybe id have to create a new entity like npc_manhacker instead of npc_manhack that gets spawned inplace of that npc_manhack but that might be too complicated for something that i feel like could be done simply

Last edited by ChoclatePancake; 01-14-2017 at 16:13.
ChoclatePancake is offline
 



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 23:37.


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