Raised This Month: $ Target: $400
 0% 

Changing models & skins


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Waleed
Senior Member
Join Date: May 2012
Location: Pakistan
Old 06-26-2012 , 12:46   Changing models & skins
Reply With Quote #1

Hey there,I wanna ask how can I change the model of weapons using client command.
For Example: If clients types in "/giveme" then he would get few stuff + there weapon models or skins will also be changed with my precached skins ?
Is it possible?
I have used "cs_set_user_model" //I know it changes user model,Just checking
But it didn't worked.Any guesses?
Waleed is offline
Send a message via Skype™ to Waleed
Aooka
Veteran Member
Join Date: Aug 2011
Location: Villeurbanne
Old 06-26-2012 , 12:56   Re: Changing models & skins
Reply With Quote #2

Can you give your code please.
__________________
Pawn ? Useless
Aooka is offline
Waleed
Senior Member
Join Date: May 2012
Location: Pakistan
Old 06-26-2012 , 13:05   Re: Changing models & skins
Reply With Quote #3

Here you go,
PHP Code:
#include <amxmodx>

new CustomWeaponHere[] = "models/CustomWeaponHere.mdl"

public plugin_precache()
{
    
precache_model(CustomWeaponHere)
}

public 
plugin_init()
{
    
register_plugin("Beast Mod","1.0","Waleed")
    
register_clcmd("say /giveme","cmd_giveme")    

}

public 
cmd_giveme(id)
{
    
// I want to set user weapon model here
    
    

Waleed is offline
Send a message via Skype™ to Waleed
Backstabnoob
BANNED
Join Date: Feb 2009
Location: Iwotadai Dorm
Old 06-26-2012 , 16:48   Re: Changing models & skins
Reply With Quote #4

hook FM_SetModel.
Backstabnoob is offline
Waleed
Senior Member
Join Date: May 2012
Location: Pakistan
Old 06-26-2012 , 16:57   Re: Changing models & skins
Reply With Quote #5

I found this on wiki,How can I hook this ?
PHP Code:
FM_SetModel,            // void )    (ent, const szModel[]) 
I tried this:

PHP Code:
FM_SetModel(ent,"MyModel"
It gave me following error:

Error: Invalid function call, not a valid address on line 20
Error: Undefined symbol "ent" on line 20
Warning: Expression has no effect on line 20
Error: Expected token: ";", but found ")" on line 20
Error: Too many error messages on one line on line 20

I know I am doing this wrong
Whats the correct way?

Last edited by Waleed; 06-26-2012 at 17:03.
Waleed is offline
Send a message via Skype™ to Waleed
Backstabnoob
BANNED
Join Date: Feb 2009
Location: Iwotadai Dorm
Old 06-26-2012 , 17:31   Re: Changing models & skins
Reply With Quote #6

PHP Code:

new g_Model[ ] = "models/new/v_weapon.mdl"

public plugin_init( )
     
register_forwardFM_SetModel"_FM_SetModel" )

public 
_FM_SetModelentmodel[ ] )
{
     new 
id peventpev_owner )

     if( 
is_user_aliveid ) && equalimodel"models/v_myweapon.mdl" ) )
          
set_pevidpev_viewmodelg_Model 

Last edited by Backstabnoob; 06-26-2012 at 17:33.
Backstabnoob is offline
Waleed
Senior Member
Join Date: May 2012
Location: Pakistan
Old 06-26-2012 , 17:42   Re: Changing models & skins
Reply With Quote #7

Can I use fw_FM_SetModel instead of _FM_SetModel o_O?
What is pev and equali o_O? Where can I use them?
Waleed is offline
Send a message via Skype™ to Waleed
Backstabnoob
BANNED
Join Date: Feb 2009
Location: Iwotadai Dorm
Old 06-26-2012 , 17:45   Re: Changing models & skins
Reply With Quote #8

1) you can use whatever you want
2) search the forums for examples
Backstabnoob is offline
Old 06-26-2012, 17:48
Waleed
This message has been deleted by Waleed.
pokemonmaster
princess milk
Join Date: Nov 2010
Location: Somewhere in this world
Old 06-26-2012 , 17:50   Re: Changing models & skins
Reply With Quote #9

I really you think read some tutorials (as me ), I'm still learning fakemeta whom Backstabnoob gave you an example about it.

If you never read a pawn tutorial, here is a good one that helped me A LOT: Pawn Picture Tutorial
Here is one for fakemeta: Fakemeta General usage

This is a link for Useful Tutorials, Guides, Snippets, and References
__________________
اَشْهَدُ اَنْ لَّآ اِلٰهَ اِلَّا اللہُ وَحْدَه لَا شَرِيْكَ لَه وَ اَشْهَدُ اَنَّ مُحَمَّدًا عَبْدُه وَرَسُوْلُه
No longer active in AMXX. Sorry.

Last edited by pokemonmaster; 06-26-2012 at 17:51.
pokemonmaster is offline
Waleed
Senior Member
Join Date: May 2012
Location: Pakistan
Old 06-26-2012 , 18:02   Re: Changing models & skins
Reply With Quote #10

I have read Pawn Picture Tutorial many times.
But,Thanks for the Fakemeta General Usage tutorial,Let see What I learn from that o_O
Waleed is offline
Send a message via Skype™ to Waleed
Reply


Thread Tools
Display Modes

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:16.


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