Raised This Month: $ Target: $400
 0% 

Setting models on the moment, not on next spawn


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
dreamedward
Senior Member
Join Date: Aug 2010
Location: ZombieWorld
Old 08-14-2011 , 17:21   Re: Setting models on the moment, not on next spawn
Reply With Quote #5

Here
PHP Code:
#include <amxmodx>
 #include <cstrike>
 
new bool:golb[33];
 new 
bool:smith[33];
 new 
bool:neo[33];
 
 public 
plugin_init()
 {
    
register_clcmd"/setmodels1","Menu");
    
register_event("ResetHUD","ModelReset","b")
 }
 public 
Menu(id)
 {
    new 
menu menu_create("\rSet Player's Models:""menu_handler");
    
menu_additem(menu"\wGolb""1"0);
    
menu_additem(menu"\wSmith""2"0);
    
menu_additem(menu"\wNeo""3"0);
    
menu_setprop(menuMPROP_EXITMEXIT_ALL);
    
menu_display(idmenu0);
 }
 public 
menu_handler(idmenuitem)
 {
    if( 
item == MENU_EXIT )
    {
        
menu_destroy(menu);
        return 
PLUGIN_HANDLED;
    }
    new 
data[6], szName[64];
    new 
accesscallback;
    
menu_item_getinfo(menuitemaccessdata,charsmax(data), szName,charsmax(szName), callback);
    new 
key str_to_num(data);
    switch(
key)
    {
        case 
1:
        {
    
golb[id] = true
        
}
        case 
2:
        {
            
smith[id] = true
        
}
        case 
3:
        {
            
neo[id] = true
        
}
    }
    
menu_destroy(menu);
    return 
PLUGIN_HANDLED;
 }
 public 
resetModel(id)
 {
    if(
golb[id]) {
 
cs_set_user_model(id"golb")
    }
    
    if(
smith[id]) {
 
cs_set_user_model(id"smith")
    }  
    
    if(
neo[id]) {
 
cs_set_user_model(id"neo")
    }

I have precached the models in another plugin. They're ok.
dreamedward 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 09:12.


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