Raised This Month: $ Target: $400
 0% 

entity_set_model


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
soccdoodcss
Veteran Member
Join Date: Nov 2006
Location: Wisconsin
Old 04-11-2007 , 23:08   entity_set_model
Reply With Quote #1

PHP Code:
case CSW_M4A1:
        {
            new 
V_RIFLE[56]
            new 
P_RIFLE[56]
            
            
format(V_RIFLE,55,"models/v_halorifle.mdl")
            
format(P_RIFLE,55,"models/p_halorifle.mdl")
            
entity_set_model(EV_SZ_modelP_RIFLE)
            
entity_set_model(EV_SZ_viewmodelV_RIFLE)
            
            return 
PLUGIN_HANDLED
        

This isn't setting any models at all, I did precache the models. Also, my knife model sets but when changing to grenade it stays the knife model, any way around that? Thanks
__________________
"Now safe beneath their wisdom and their feet.
Here I will teach you truly how to sleep."
soccdoodcss is offline
Send a message via AIM to soccdoodcss
Deviance
Veteran Member
Join Date: Nov 2004
Location: Sweden
Old 04-11-2007 , 23:24   Re: entity_set_model
Reply With Quote #2

Code:
case CSW_M4A1:         {             new V_RIFLE[56]             new P_RIFLE[56]                         format(V_RIFLE,55,"models/v_halorifle.mdl")             format(P_RIFLE,55,"models/p_halorifle.mdl")             entity_set_string(id, EV_SZ_viewmodel, V_RIFLE)             entity_set_string(id, EV_SZ_weaponmodel, P_RIFLE)                         return PLUGIN_HANDLED         }
Deviance is offline
soccdoodcss
Veteran Member
Join Date: Nov 2006
Location: Wisconsin
Old 04-12-2007 , 00:26   Re: entity_set_model
Reply With Quote #3

This works, but none of the models go through heir movements such as reload and firing and such. Only a picture of the gun.
__________________
"Now safe beneath their wisdom and their feet.
Here I will teach you truly how to sleep."
soccdoodcss is offline
Send a message via AIM to soccdoodcss
Deviance
Veteran Member
Join Date: Nov 2004
Location: Sweden
Old 04-12-2007 , 00:30   Re: entity_set_model
Reply With Quote #4

Quote:
Originally Posted by soccdoodcss View Post
This works, but none of the models go through heir movements such as reload and firing and such. Only a picture of the gun.
This can be because the guns your using is ment to be used on another weapons.
Deviance is offline
soccdoodcss
Veteran Member
Join Date: Nov 2006
Location: Wisconsin
Old 04-12-2007 , 16:41   Re: entity_set_model
Reply With Quote #5

Oh didn't think about that, thanks.

When I change to pistol after having it out, the model stays.
__________________
"Now safe beneath their wisdom and their feet.
Here I will teach you truly how to sleep."
soccdoodcss is offline
Send a message via AIM to soccdoodcss
LittleDude
Member
Join Date: Dec 2004
Location: Selah, WA
Old 04-12-2007 , 20:13   Re: entity_set_model
Reply With Quote #6

Quote:
Originally Posted by soccdoodcss View Post

When I change to pistol after having it out, the model stays.
Use the CurWeapon event to get the current weapon, and if it's not the right model set it back to the right model
__________________
It is stupid to be stupid, and stupid to not be stupid
LittleDude is offline
Send a message via AIM to LittleDude
regalis
Veteran Member
Join Date: Jan 2007
Location: F*cking Germany
Old 04-13-2007 , 15:03   Re: entity_set_model
Reply With Quote #7

Code:
register_event("CurWeapon", "Change_Wpn", "be")//Weapon changed ...... // Called on player switches his weapon public Change_Wpn(id) {     if (!get_pcvar_num(g_speed_enabled)) return PLUGIN_HANDLED             new WeaponNum = read_data(2)  // read and store the weaponID     new WeaponActive = read_data(1)  // read the flag if weapon is active (user holds in his hand)     if (WeaponNum != WeaponUsed[id] && WeaponActive)  // if weapon has changed and its the active weapon continue     {         WeaponUsed[id] = WeaponNum         calculate_speed(id, WeaponNum)         give_speed(id)     }     return PLUGIN_HANDLED } ...... // Calculate the percentual running- and walking-speed for current Weapon (e.g. awp gives a slower speed than knife) stock calculate_speed(id, WeaponNum) {     new speed_value = get_pcvar_num(g_speed_value)     switch (WeaponNum)     {     case 3:{                     // CSW_SCOUT                     g_data[id][0] = (speed_value * 104)/100;                 // Calculate the speed for current Weapon                     g_data[id][1] = (g_data[id][0]*55)/100;        // Calculate the walking speed for current Weapon(plus a little buffer)                  }     case 30:{                     // CSW_P90                     g_data[id][0] = (speed_value * 98)/100;                     g_data[id][1] = (g_data[id][0]*55)/100;                     }     case 5, 8, 14, 15:{                     // CSW_XM1014, CSW_AUG, CSW_GALI, CSW_FAMAS                     g_data[id][0] = (speed_value * 96)/100;                     g_data[id][1] = (g_data[id][0]*55)/100;                     }     case 27:{                     // CSW_SG552                     g_data[id][0] = (speed_value * 94)/100;                     g_data[id][1] = (g_data[id][0]*55)/100;                     }     case 21, 22:{                     // CSW_M3, CSW_M4A1                     g_data[id][0] = (speed_value * 92)/100;                     g_data[id][1] = (g_data[id][0]*55)/100;                     }     case 28:{                     // CSW_AK47                     g_data[id][0] = (speed_value * 884)/1000;                     g_data[id][1] = (g_data[id][0]*55)/100;                     }     case 20:{                     // CSW_M249                     g_data[id][0] = (speed_value * 88)/100;                     g_data[id][1] = (g_data[id][0]*55)/100;                     }     case 13, 18, 24:{                     // CSW_SG550, CSW_AWP, CSW_G3SG1                     g_data[id][0] = (speed_value * 84)/100;                     g_data[id][1] = (g_data[id][0]*55)/100;                     }     default:{                     // All other weapons and nades                     g_data[id][0] = speed_value;                     g_data[id][1] = (g_data[id][0]*55)/100;                     }     }     return PLUGIN_CONTINUE }

Maybe this will help you with your problem!?

greetz regalis
__________________
regalis is offline
soccdoodcss
Veteran Member
Join Date: Nov 2006
Location: Wisconsin
Old 04-13-2007 , 16:42   Re: entity_set_model
Reply With Quote #8

Wow, thanks! That helps a lot. Will try when I get a chance.
__________________
"Now safe beneath their wisdom and their feet.
Here I will teach you truly how to sleep."
soccdoodcss is offline
Send a message via AIM to soccdoodcss
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 06:34.


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