Raised This Month: $ Target: $400
 0% 

Catching Class Selection


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 10-13-2005 , 21:25  
Reply With Quote #5

Sorry that it's got all the surf stuff in it, but that's what I used it for. This is the best I've been able to do to check when someone has selected their model:

EDIT: Also ignore "client_putinserver", it calls some stuff that's really irrelevant to this particular thing.

Code:
new g_lastmodel[33] = {0,...}; /*     CS_DONTCHANGE = 0,     CS_CT_URBAN = 1,     CS_T_TERROR = 2,     CS_T_LEET = 3,     CS_T_ARCTIC = 4,     CS_CT_GSG9 = 5,     CS_CT_GIGN = 6,     CS_CT_SAS = 7,     CS_T_GUERILLA = 8,     CS_CT_VIP = 9 */

Code:
register_event("TextMsg","join_respawn","a","1=1","2&Game_join_te","2&Game_join_ct");

Code:
public join_respawn() {     if(surfmap == false || !get_cvar_num("surf_on") || !get_cvar_num("surf_respawn"))     {         return 0;     }         new arg[32];     read_data(3,arg,31);         new id = cmd_target(1,arg,0);         if(g_lastmodel[id] == 0)     {         set_task(0.1,"check_model",id,_,_,"b");     }     else     {           // Spawn the player twice to avoid the HL engine bug         set_task(0.5,"player_spawn",id);         set_task(0.7,"player_spawn",id);             // Then give them a suit and a knife         set_task(0.9,"player_giveitems",id);     }         return 0; }

Code:
public check_model(id) {     new model[32];     cs_get_user_model(id,model,31);         if(containi(model,"urban")!=-1)     {         if(g_lastmodel[id]!=1)         {             remove_task(id);                         g_lastmodel[id] = 1;                         /* Spawn the player twice to avoid the HL engine bug */             set_task(0.5,"player_spawn",id);             set_task(0.7,"player_spawn",id);                 /* Then give them a suit and a knife */             set_task(0.9,"player_giveitems",id);                         client_putinserver(id);         }       }     else if(containi(model,"terror")!=-1)     {         if(g_lastmodel[id]!=2)         {             remove_task(id);                         g_lastmodel[id] = 2;                         /* Spawn the player twice to avoid the HL engine bug */             set_task(0.5,"player_spawn",id);             set_task(0.7,"player_spawn",id);                 /* Then give them a suit and a knife */             set_task(0.9,"player_giveitems",id);                         client_putinserver(id);         }       }     else if(containi(model,"leet")!=-1)     {         if(g_lastmodel[id]!=3)         {             remove_task(id);                         g_lastmodel[id] = 3;                         /* Spawn the player twice to avoid the HL engine bug */             set_task(0.5,"player_spawn",id);             set_task(0.7,"player_spawn",id);                 /* Then give them a suit and a knife */             set_task(0.9,"player_giveitems",id);                         client_putinserver(id);         }       }     else if(containi(model,"arctic")!=-1)     {         if(g_lastmodel[id]!=4)         {             remove_task(id);                         g_lastmodel[id] = 4;                         /* Spawn the player twice to avoid the HL engine bug */             set_task(0.5,"player_spawn",id);             set_task(0.7,"player_spawn",id);                 /* Then give them a suit and a knife */             set_task(0.9,"player_giveitems",id);                         client_putinserver(id);         }       }     else if(containi(model,"gsg")!=-1)     {         if(g_lastmodel[id]!=5)         {             remove_task(id);                         g_lastmodel[id] = 5;                         /* Spawn the player twice to avoid the HL engine bug */             set_task(0.5,"player_spawn",id);             set_task(0.7,"player_spawn",id);                 /* Then give them a suit and a knife */             set_task(0.9,"player_giveitems",id);                         client_putinserver(id);         }       }     else if(containi(model,"gign")!=-1)     {         if(g_lastmodel[id]!=6)         {             remove_task(id);                         g_lastmodel[id] = 6;                         /* Spawn the player twice to avoid the HL engine bug */             set_task(0.5,"player_spawn",id);             set_task(0.7,"player_spawn",id);                 /* Then give them a suit and a knife */             set_task(0.9,"player_giveitems",id);             client_putinserver(id);         }       }     else if(containi(model,"sas")!=-1)     {         if(g_lastmodel[id]!=7)         {             remove_task(id);                         g_lastmodel[id] = 7;                         /* Spawn the player twice to avoid the HL engine bug */             set_task(0.5,"player_spawn",id);             set_task(0.7,"player_spawn",id);                 /* Then give them a suit and a knife */             set_task(0.9,"player_giveitems",id);                         client_putinserver(id);         }       }     else if(containi(model,"guerilla")!=-1)     {         if(g_lastmodel[id]!=8)         {             remove_task(id);                         g_lastmodel[id] = 8;                         /* Spawn the player twice to avoid the HL engine bug */             set_task(0.5,"player_spawn",id);             set_task(0.7,"player_spawn",id);                 /* Then give them a suit and a knife */             set_task(0.9,"player_giveitems",id);                         client_putinserver(id);         }       }     else if(containi(model,"vip")!=-1)     {         if(g_lastmodel[id]!=9)         {             remove_task(id);                         g_lastmodel[id] = 9;                         /* Spawn the player twice to avoid the HL engine bug */             set_task(0.5,"player_spawn",id);             set_task(0.7,"player_spawn",id);                 /* Then give them a suit and a knife */             set_task(0.9,"player_giveitems",id);                         client_putinserver(id);         }       } }

Code:
public client_disconnect(id) {     g_lastmodel[id] = 0;         return 0; }

Code:
public client_client_putinserver(id) {     g_lastmodel[id] = 0;     // This is not what it actually is in my script, but it's just to help with this particular instance     return 0; }
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
 



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 00:05.


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