Raised This Month: $ Target: $400
 0% 

player model changing in fakemeta


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Hunter-Digital
Veteran Member
Join Date: Aug 2006
Location: In the Game [ro]
Old 03-15-2009 , 16:02   player model changing in fakemeta
Reply With Quote #1

I can't understand a damn thing from this http://forums.alliedmods.net/showthread.php?t=69386 because the codes are scrambled across the page...
also I found this in some plugins:
PHP Code:
engfunc(EngFunc_SetClientKeyValueidengfunc(EngFunc_GetInfoKeyBufferid), "model""model_name"
but doesn't seem to work... it worked for an older plugin of mine but for a plain simple plugin it doesn't...

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

public plugin_init()
{
    
register_clcmd("test_model""test_model")
}

public 
plugin_precache()
{
    
precache_model("models/player/vip/vip.mdl")
}

public 
test_model(id)
{
    
engfunc(EngFunc_SetClientKeyValueidengfunc(EngFunc_GetInfoKeyBufferid), "model""vip")

    return 
PLUGIN_HANDLED

__________________
Hunter-Digital is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 03-15-2009 , 16:16   Re: player model changing in fakemeta
Reply With Quote #2

Try something that ( Orangetuz' method ) :

Code:
    #include <amxmodx>     #include <fakemeta>     #include <hamsandwich>     const MAX_MODEL_LENGTH = 32;     const MAX_CLIENTS      = 32;     new gModel[ MAX_CLIENTS + 1 ][ MAX_MODEL_LENGTH ];         new const gModelName [] = "model";     new const gNewModel  [] = "vip";     public plugin_precache ()     {         precache_model( "models/player/vip/vip.mdl" );     }     public plugin_init ()     {         RegisterHam( Ham_Spawn, "player", "Event_PlayerSpawn", 1 );         register_forward( FM_SetClientKeyValue, "Event_SetClientKeyValue" );         register_message( get_user_msgid( "ClCorpse" ), "Event_ClCorpse" );     }     public client_putinserver ( Client )     {         gModel[ Client ][ 0 ] = '^0';     }     public Event_PlayerSpawn ( const Client )     {         if ( is_user_alive( Client ) )         {             copy( gModel[ Client ], charsmax( gModel[] ), gNewModel );             set_user_info( Client, gModelName, gModel[ Client] );         }     }     public Event_SetClientKeyValue ( const Client, const InfoBuffer[], const Key[], const Value[] )     {         if ( gModel[ Client ][ 0 ] && equal( Key, gModelName ) && !equal( Value, gModel[ Client ] ) )         {             set_user_info( Client, gModelName, gModel[ Client ] );             return FMRES_SUPERCEDE;         }         return FMRES_IGNORED;     }     public Event_ClCorpse ()     {         new Client = get_msg_arg_int( 12 );         if ( gModel[ Client ][ 0 ] )         {             set_msg_arg_string( 1, gModel[ Client ] );         } }
Arkshine is offline
Hunter-Digital
Veteran Member
Join Date: Aug 2006
Location: In the Game [ro]
Old 03-16-2009 , 07:20   Re: player model changing in fakemeta
Reply With Quote #3

thanks, works great, but there's still a mistery behind that code above... it's much more simple but doesn't seem to work... at least, anymore, 'cause it did sometime...
__________________
Hunter-Digital is offline
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 03-16-2009 , 10:22   Re: player model changing in fakemeta
Reply With Quote #4

Counter-Strike always checks if player's model is the default one, if not - set it back. You would have to block that check if you want your code to work. Check how it's done in the code arkshine provided.
__________________
hleV is offline
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 08:57.


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