Raised This Month: $ Target: $400
 0% 

Multiple Models


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Black Rose
Veteran Member
Join Date: Feb 2011
Location: Stockholm, Sweden
Old 08-11-2013 , 21:03   Re: Multiple Models
Reply With Quote #1

It looks fine, what's the problem?

Just some suggestions
All you have to change with this code is modelfiles[][] = { ... }
Use whatever you want.
Code:
#include <amxmodx> #include <cstrike> #define ADMIN_FLAG_X (1<<23) #define ctod(%0) %0-48 new model[33]; new modelfiles[][][] = {     {"admin_te", "admin_ct"},     {"admin_te", "admin_ct"},     {"admin_te", "admin_ct"} } public plugin_init() {     register_plugin("Modele VIP", "1.0", "Gasior");         register_event("ResetHUD", "resetModel", "b");         register_clcmd("say /modele1", "modelevip");     register_clcmd("say /modele2", "modelevip");     register_clcmd("say /modele3", "modelevip");         return PLUGIN_CONTINUE; } public plugin_precache() {     new tempfile[128];         for ( new i = 0 ; i < sizeof modelfiles ; i++ ) {         for ( new j = 0 ; j < 2 ; j++ ) {             formatex(tempfile, 127, "models/player/%s/%s.mdl", modelfiles[i][j], modelfiles[i][j]);             precache_model(tempfile);         }     }         return PLUGIN_CONTINUE; } public client_authorized(id) {     model[id] = 0; } public modelevip(id) {     if ( ! ( get_user_flags(id) & ADMIN_FLAG_X ) )         return;         new arg[32];     read_argv(1, arg, 31);         model[id] = clamp(ctod(arg[7]), 0, sizeof modelfiles); } public resetModel(id) {     new userTeam2, CsTeams:userTeam = cs_get_user_team(id);         switch ( userTeam ) {         case CS_TEAM_T: userTeam2 = 1;         case CS_TEAM_CT: userTeam2 = 2;     }     if ( model[id] && userTeam2 )         cs_set_user_model(id, modelfiles[model[id] - 1][userTeam2 - 1]);     else         cs_reset_user_model(id); }
__________________

Last edited by Black Rose; 08-12-2013 at 21:20. Reason: Sorry...
Black Rose 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 15:53.


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