Raised This Month: $ Target: $400
 0% 

Model isn't changing


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 06-23-2009 , 22:50   Re: Model isn't changing
Reply With Quote #7

Quote:
Originally Posted by DruGzOG View Post
PHP Code:
#include <amxmodx> 
#include <cstrike> 
#include <hamsandwich> 
public plugin_init() { 
    
register_plugin"Team Model""1.0""LeviN" ); 
     
    
RegisterHamHam_Spawn"player""set_players_models"); 

public 
plugin_precache() { 
    
precache_model("models/player/smith/smith.mdl"); 

public 
set_players_models(){
    
    new 
i;
    new 
players[32], ingame;
    
get_players(players,ingame);
    
    for(
i=1;i<=ingame;i++){
        if(
cs_get_user_team(i) == CS_TEAM_CT){
            
cs_set_user_model(i,"smith");
        }
    }
    
    return 
PLUGIN_CONTINUE;

try that
Okay, gross.

Code:
#include <amxmodx> #include <amxmisc> #include <cstrike> #include <hamsandwich> new const g_szModelName[] = "smith"; public plugin_precache() {     new szModelFilename[128];     formatex(szModelFilename, 127, "models/player/%s/%s.mdl",\         g_szModelName, g_szModelName);         precache_model(szModelFilename); } public plugin_init() {     register_plugin("CT Model", "0.1", "Exolent");         RegisterHam(Ham_Spawn, "player", "FwdPlayerSpawn", 1); } public FwdPlayerSpawn(iPlayer) {     if( is_user_alive(iPlayer) )     {         if( cs_get_user_team(iPlayer) == CS_TEAM_CT )         {             cs_set_user_model(iPlayer, g_szModelName);         }     } }

This still isn't the best way.
The best and most efficient way is hooking forwards to block the model from being changed and other complicated stuff.
However, I was lazy and since this is only the CT's, it shouldn't cause SVC_BAD.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!

Last edited by Exolent[jNr]; 06-24-2009 at 19:29.
Exolent[jNr] is offline
 



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


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