Raised This Month: $ Target: $400
 0% 

[L4D2] Help Add Custom Model Weapon In Game L4D2 Plugins


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
manhkst
Member
Join Date: May 2015
Location: Vietnammese
Old 05-17-2017 , 21:25   [L4D2] Help Add Custom Model Weapon In Game L4D2 Plugins
Reply With Quote #1

I need help you by adding model to the game when playing l4d2.
For example: I have a model weapon ak47 but i edit the name does not have the same name ak47 and i want to add a model to the game. I took the SetEntityModel but did not work. I need people help me. I tried a lot of different ways but failed
Sorry i write english bad.
__________________
FD ʚïɞ Team
Blog: http://fleeingdeath.blogspot.com/

Last edited by manhkst; 05-17-2017 at 21:36.
manhkst is offline
Silvers
SourceMod Plugin Approver
Join Date: Aug 2010
Location: SpaceX
Old 05-17-2017 , 23:06   Re: [L4D2] Help Add Custom Model Weapon In Game L4D2 Plugins
Reply With Quote #2

Take a look at this for adding custom things to the download table, unless it's a LAN/SP setup where everyone has the same addons. https://forums.alliedmods.net/showthread.php?t=175952

I guess you're creating a custom addon.vpk? This won't work on clients the first time they join a server, because the game needs to be reloaded to included the addon. L4D2 is not good at supporting custom content like this sent from the server. Again, if it's single player/LAN then that shouldn't matter.

Show some code you're working with. Without that all I can say is check the file paths, or have you tried turning it off and on again lol.
__________________
Silvers is offline
manhkst
Member
Join Date: May 2015
Location: Vietnammese
Old 05-18-2017 , 06:58   Re: [L4D2] Help Add Custom Model Weapon In Game L4D2 Plugins
Reply With Quote #3

I thank silvers for taking care of my problem. I play with my friends and I provide the .vpk file for them. The paths are correct. My problem here is that I have a mod skin weapon rifle and I edited the mod to a different name and I set it to w_rifle_m16a3.

Now when I go to the host, the rifle skin is still the default, I want to when I write the command is: !riflecustom will create a rifle gun but it is w_rifle_m16a3 model, not w_rifle_m16a2. I tried but the results were not as expected. Take a look at the clip I recorded and the code that executed it.
Video:
https://youtu.be/pL8ZdVpOVzU

Code:
Quote:
new ent;
ent= CreateEntityByName("weapon_rifle_spawn");
SetEntityModel(ent,"models/w_models/weapons/w_rifle_m16a3.mdl");
DispatchKeyValue(ent, "count", "4");
DispatchSpawn(ent);
new test=GetEntProp(ent, Prop_Send, WEAPON_ID_ENTPROP);
new Float:pos[3];
new Float:ang[3];
GetClientAbsOrigin(client, pos);
GetClientEyeAngles(client, ang);
new spawnedent;
spawnedent = CreateEntityByName("weapon_spawn");
SetEntityModel(spawnedent,"models/w_models/weapons/w_rifle_m16a3.mdl");
SetEntProp(spawnedent, Prop_Send, WEAPON_ID_ENTPROP, test);
TeleportEntity(spawnedent, pos, ang, NULL_VECTOR);
DispatchKeyValue(spawnedent, "count", "4");
I look forward to receiving your feedback soon. Thanks!
__________________
FD ʚïɞ Team
Blog: http://fleeingdeath.blogspot.com/

Last edited by manhkst; 05-18-2017 at 07:01.
manhkst is offline
Silvers
SourceMod Plugin Approver
Join Date: Aug 2010
Location: SpaceX
Old 05-18-2017 , 07:08   Re: [L4D2] Help Add Custom Model Weapon In Game L4D2 Plugins
Reply With Quote #4

First person view is a different model. I guess that's the problem you're having? Because the texture seems to be applied correctly in 3rd person.
__________________
Silvers is offline
manhkst
Member
Join Date: May 2015
Location: Vietnammese
Old 05-18-2017 , 07:51   Re: [L4D2] Help Add Custom Model Weapon In Game L4D2 Plugins
Reply With Quote #5

I tried searching for similar topics like mine and consulted a lot of code but unfortunately did not talk about the problem I was looking for, could you help me or anything I could find the problem
__________________
FD ʚïɞ Team
Blog: http://fleeingdeath.blogspot.com/
manhkst is offline
cravenge
Veteran Member
Join Date: Nov 2015
Location: Chocolate Factory
Old 05-19-2017 , 00:48   Re: [L4D2] Help Add Custom Model Weapon In Game L4D2 Plugins
Reply With Quote #6

It's a real pain in the ***, I've tried digging deeper in the game's mechanics, coding, etc. etc. and I still haven't found the netprop that involves 1st person weapon models.

I tried playing and messing with "m_hViewModel" but ended up with constant crashes.
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 15:07.


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