Raised This Month: $ Target: $400
 0% 

Solved [Help] Change W_Model


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
abdobiskra
Veteran Member
Join Date: Jul 2014
Location: Algeria
Old 04-15-2017 , 08:38   Re: [Help] Change W_Model
Reply With Quote #1

DarthMan
you want replace calss of weapon in the map
or
when player drop ...ex ?

btw u used plugin weaponbox model ?
__________________
abdobiskra is offline
Send a message via Skype™ to abdobiskra
DarthMan
Veteran Member
Join Date: Aug 2011
Old 04-15-2017 , 09:08   Re: [Help] Change W_Model
Reply With Quote #2

Quote:
Originally Posted by abdobiskra View Post
DarthMan
you want replace calss of weapon in the map
or
when player drop ...ex ?

btw u used plugin weaponbox model ?
I want to just replace the weapon model skin of weapon_crowbar. This should happen instantly, when map starts, not if the player drops the weapon.
DarthMan is offline
abdobiskra
Veteran Member
Join Date: Jul 2014
Location: Algeria
Old 04-15-2017 , 09:12   Re: [Help] Change W_Model
Reply With Quote #3

but the weapon crowbar in HL1 dont have point spawn in maps ? it just started with player when spawn !
__________________

Last edited by abdobiskra; 04-15-2017 at 09:13.
abdobiskra is offline
Send a message via Skype™ to abdobiskra
DarthMan
Veteran Member
Join Date: Aug 2011
Old 04-15-2017 , 09:16   Re: [Help] Change W_Model
Reply With Quote #4

Quote:
Originally Posted by abdobiskra View Post
but the weapon crowbar in HL1 dont have point spawn in maps ? it just started with player when spawn !
Well, you can add spawn points for the crowbar, I did in one of my maps, and it has the default model.
DarthMan is offline
abdobiskra
Veteran Member
Join Date: Jul 2014
Location: Algeria
Old 04-15-2017 , 09:19   Re: [Help] Change W_Model
Reply With Quote #5

Yes that's what I wanted to make sure of and you should say
so you can used Ham_Spawn function for classname of the weapon and change the model
__________________
abdobiskra is offline
Send a message via Skype™ to abdobiskra
DarthMan
Veteran Member
Join Date: Aug 2011
Old 04-15-2017 , 09:22   Re: [Help] Change W_Model
Reply With Quote #6

Quote:
Originally Posted by abdobiskra View Post
Yes that's what I wanted to make sure of and you should say
so you can used Ham_Spawn function for classname of the weapon and change the model
It won't work. In non-CS games, Ham_Spawn is actually executed on respawn, so there is no way to use Ham_Spawn.
Accept my Skype friend request if you can.

Last edited by DarthMan; 04-15-2017 at 09:23.
DarthMan is offline
abdobiskra
Veteran Member
Join Date: Jul 2014
Location: Algeria
Old 04-15-2017 , 09:25   Re: [Help] Change W_Model
Reply With Quote #7

Why not try?
I mean that!
PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <hamsandwich>


new const CRB_W_MODEL_OLD[] = "models/w_crowbar.mdl"
new const UMB_W_MODEL[] = "models/max/w_umbrella.mdl"


public plugin_init() {
        
    
register_forward(FM_SetModel"fwd_SetModel")
    
RegisterHam(Ham_Spawn"weapon_crowbar""Weapon_Spawn"1);
    
}

// this when player Drop 
public fwd_SetModel(entmodel[])
{    
    if(
equal(modelCRB_W_MODEL_OLD))
    {
        
engfunc(EngFunc_SetModelentUMB_W_MODEL)
        return 
FMRES_SUPERCEDE
    
}
    return 
FMRES_IGNORED
}

//this for spawn point ? 
public Weapon_Spawn(ent)
{
    
engfunc(EngFunc_SetModelentUMB_W_MODEL);
    return 
HAM_IGNORED;
}

public 
plugin_precache()
{
    
precache_model(UMB_W_MODEL)

Sorry I have not used my skype account for a long time and I forgot the login information
__________________

Last edited by abdobiskra; 04-15-2017 at 09:32.
abdobiskra is offline
Send a message via Skype™ to abdobiskra
DarthMan
Veteran Member
Join Date: Aug 2011
Old 04-15-2017 , 09:33   Re: [Help] Change W_Model
Reply With Quote #8

Quote:
Originally Posted by abdobiskra View Post
Why not try?
I mean that!
PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <hamsandwich>


new const CRB_W_MODEL_OLD[] = "models/w_crowbar.mdl"
new const UMB_W_MODEL[] = "models/max/w_umbrella.mdl"


public plugin_init() {
        
    
register_forward(FM_SetModel"fwd_SetModel")
    
RegisterHam(Ham_Spawn"weapon_crowbar""Weapon_Spawn"1);
    
}

// this when player Drop 
public fwd_SetModel(entmodel[])
{    
    if(
equal(modelCRB_W_MODEL_OLD))
    {
        
engfunc(EngFunc_SetModelentUMB_W_MODEL)
        return 
FMRES_SUPERCEDE
    
}
    return 
FMRES_IGNORED
}

//this for spawn point ? 
public Weapon_Spawn(ent)
{
    
engfunc(EngFunc_SetModelentUMB_W_MODEL);
    return 
HAM_IGNORED;
}

public 
plugin_precache()
{
    
precache_model(UMB_W_MODEL)

Sorry I have not used my skype account for a long time and I forgot the login information
Sadly it works only when it respawn.
And btw on drop it seems to be using the weaponbox entity.

Last edited by DarthMan; 04-15-2017 at 09:36.
DarthMan is offline
abdobiskra
Veteran Member
Join Date: Jul 2014
Location: Algeria
Old 04-15-2017 , 10:13   Re: [Help] Change W_Model
Reply With Quote #9

Quote:
Originally Posted by DarthMan View Post
Sadly it works only when it respawn.
what about this ! :

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <hamsandwich>

new const UMB_W_MODEL[] = "models/max/w_umbrella.mdl"


public plugin_precache()
{
    
RegisterHam(Ham_Spawn"weapon_crowbar""Weapon_Spawn"1);
    
precache_model(UMB_W_MODEL)
}
public 
Weapon_Spawn(ent)
{
    
engfunc(EngFunc_SetModelentUMB_W_MODEL);
    return 
HAM_IGNORED;


Quote:
Originally Posted by DarthMan View Post
And btw on drop it seems to be using the weaponbox entity.
you want it to ? , if Yes! you should first used weaponbox model plugin
__________________
abdobiskra is offline
Send a message via Skype™ to abdobiskra
DarthMan
Veteran Member
Join Date: Aug 2011
Old 04-15-2017 , 10:18   Re: [Help] Change W_Model
Reply With Quote #10

Quote:
Originally Posted by abdobiskra View Post
what about this ! :

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <hamsandwich>

new const UMB_W_MODEL[] = "models/max/w_umbrella.mdl"


public plugin_precache()
{
    
RegisterHam(Ham_Spawn"weapon_crowbar""Weapon_Spawn"1);
    
precache_model(UMB_W_MODEL)
}
public 
Weapon_Spawn(ent)
{
    
engfunc(EngFunc_SetModelentUMB_W_MODEL);
    return 
HAM_IGNORED;



you want it to ? , if Yes! you should first used weaponbox model plugin
I finally did it, using a method that I never thinked of, but my idea just came now and it works perfectly.
DarthMan 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 18:04.


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