Mensajes: 170
Temas: 45
Registro en: Aug 2017
Reputación:
0
Código PHP:
if( g_clase_De_arma_secundaria [ id ] == 3 || g_clase_De_arma_secundaria [ id ] == 6 || g_clase_De_arma_secundaria [ id ] == 7 )
Buenas, se puede reducir eso?
Mensajes: 6,664
Temas: 81
Registro en: Jan 2014
Reputación:
68
Código PHP:
#define wclass(%0,%1,%2,%3) g_clase_De_arma_secundaria[%0] == %1 || g_clase_De_arma_secundaria[%0] == %2 || g_clase_De_arma_secundaria[%0] == %3 if( wclass ( id , 3 , 6 , 7 ) )
► NO DOY AYUDA VIA MENSAJE PRIVADO ◄
* Si requieres algún servicio de pago puedes contactarme vía MP o en mi facebook
Mensajes: 2,094
Temas: 59
Registro en: Feb 2015
Reputación:
15
Código PHP:
if( g_clase_De_arma_secundaria [ id ] == 3 || 6 <= g_clase_De_arma_secundaria [ id ] <= 7 )
(18/11/2014, 05:47 PM) Neeeeeeeeeel.- escribió: Por qué necesitan una guía para todo? Meté mano y que salga lo que salga... es la mejor forma de aprender.
(16/05/2016, 11:08 PM) kikizon2 escribió: No cabe duda que tienen mierda en vez de cerebro, par de pendejos v:
Mensajes: 688
Temas: 31
Registro en: Nov 2015
Reputación:
7
Código PHP:
switch( g_clase_De_arma_secundaria [ id ]) { case 3 , 6 , 7 : client_print ( id , 3 , "Clase Arma: #%d" , g_clase_De_arma_secundaria [ id ]) }
Mensajes: 3,466
Temas: 18
Registro en: Oct 2013
Reputación:
54
(03/10/2018, 01:20 PM) mlibre escribió: Código PHP:
switch( g_clase_De_arma_secundaria [ id ]) { case 3 , 6 , 7 : client_print ( id , 3 , "Clase Arma: #%d" , g_clase_De_arma_secundaria [ id ]) }
Prefiero esta ya que permite una fácil edición a futuro, y se traduce en exactamente lo mismo que se puso arriba
Mensajes: 546
Temas: 65
Registro en: Jan 2017
Reputación:
4
Porque yo cuando paso todas las if a switch se me bajan los fps y luego se normaliza al empezar una ronda nueva?. Primero pense que era mi pc, pero cuando lo subi al servidor , a todos les pasaba y tuve q volver a dejar los if y no los switch
Mensajes: 6,664
Temas: 81
Registro en: Jan 2014
Reputación:
68
(04/10/2018, 10:18 PM) warrior escribió: Porque yo cuando paso todas las if a switch se me bajan los fps y luego se normaliza al empezar una ronda nueva?. Primero pense que era mi pc, pero cuando lo subi al servidor , a todos les pasaba y tuve q volver a dejar los if y no los switch
manda una porción de como lo estas haciendo
► NO DOY AYUDA VIA MENSAJE PRIVADO ◄
* Si requieres algún servicio de pago puedes contactarme vía MP o en mi facebook
Mensajes: 546
Temas: 65
Registro en: Jan 2017
Reputación:
4
05/10/2018, 03:21 AM
(Última modificación: 05/10/2018, 03:23 AM por warrior .)
Código PHP:
if ( g_clase [ victim ] >= ZOMBIE ) { if ( g_clase [ victim ] == NEMESIS ) { if (! get_pcvar_num ( cvar_nempainfree )) return; } else if ( g_clase [ victim ] == ALIEN ) { if (! get_pcvar_num ( cvar_alipainfree )) return; } else { if ( g_clase [ victim ] == LAST_ZOMBIE ) { if (! get_pcvar_num ( cvar_zombiepainfree )) return; } else if ( g_clase [ victim ] == FIRST_ZOMBIE ) { if (! get_pcvar_num ( cvar_zombiepainfree )) return; } else return; } } else { if ( g_clase [ victim ] == SURVIVOR ) { if (! get_pcvar_num ( cvar_survpainfree )) return; } else if ( g_clase [ victim ] == WESKER ) { if (! get_pcvar_num ( cvar_weskpainfree )) return; } else return; } //////////////////////////////////// if ( g_clase [ victim ] >= ZOMBIE ) { switch( g_clase [ victim ]){ case NEMESIS : if (! get_pcvar_num ( cvar_nempainfree )) return; case ALIEN : if (! get_pcvar_num ( cvar_alipainfree )) return; default:{ switch( g_clase [ victim ]){ case LAST_ZOMBIE : if (! get_pcvar_num ( cvar_zombiepainfree )) return; case FIRST_ZOMBIE : if (! get_pcvar_num ( cvar_zombiepainfree )) return; default: return; } } } } else { switch( g_clase [ victim ]){ case SURVIVOR : if (! get_pcvar_num ( cvar_survpainfree )) return; case WESKER : if (! get_pcvar_num ( cvar_weskpainfree )) return; default: return; } }
Código PHP:
if ( g_modo == MODE_SYNAPSIS ) { remover_weapon_janusmk5 ( id ) remover_weapon_janusmk3 ( id ) //give_bubble(id) give_item ( id , "weapon_xm1014" ) give_item ( id , "weapon_m4a1" ) give_item ( id , "weapon_m3" ) } else if ( g_modo == MODE_ARMAGEDDON ) { set_task ( 1.0 , "mostrar_armas_survivor" , id ) give_item ( id , "weapon_m249" ) remover_weapon_janusmk5 ( id ) remover_weapon_janusmk3 ( id ) } else if ( g_modo == MODE_AVD ) { strip_user_weapons ( id ) give_item ( id , "weapon_knife" ) give_item ( id , "weapon_hegrenade" ) } else if ( g_modo == MODE_DEPREDADOR ) { give_weapon_janusmk7 ( id ) set_task ( 0.1 , "mostrar_armas_survivor_3" , id ) } else if ( g_modo == MODE_TERMINATOR ) { give_item ( id , "weapon_m3" ) } else if ( g_modo == MODE_INFINITY ) { set_task ( 0.1 , "SKULL1" , id ) set_task ( 0.1 , "mostrar_armas_survivor_3" , id ) } else if ( g_modo == MODE_INVASION ) { set_task ( 0.1 , "cmdNavy" , id ) } else if ( g_modo == MODE_NIGHTMARE ) set_task ( 0.1 , "SKULL1" , id ) else { g_has_droga [ id ] = 1 give_item ( id , "weapon_hegrenade" ) give_weapon_janus3 ( id ) set_task ( 0.1 , "mostrar_armas_survivor_3" , id ) } /////////////////////////////////////////////// switch ( g_modo ){ case MODE_SYNAPSIS :{ remover_weapon_janusmk5 ( id ) remover_weapon_janusmk3 ( id ) give_item ( id , "weapon_xm1014" ) give_item ( id , "weapon_m4a1" ) give_item ( id , "weapon_m3" ) } case MODE_ARMAGEDDON :{ set_task ( 1.0 , "mostrar_armas_survivor" , id ) give_item ( id , "weapon_m249" ) remover_weapon_janusmk5 ( id ) remover_weapon_janusmk3 ( id ) } case MODE_AVD :{ strip_user_weapons ( id ) give_item ( id , "weapon_knife" ) give_item ( id , "weapon_hegrenade" ) } case MODE_DEPREDADOR :{ give_weapon_janusmk7 ( id ) set_task ( 0.1 , "mostrar_armas_survivor_3" , id ) } case MODE_TERMINATOR : give_item ( id , "weapon_m3" ) case MODE_INFINITY :{ set_task ( 0.1 , "SKULL1" , id ) set_task ( 0.1 , "mostrar_armas_survivor_3" , id ) } case MODE_INVASION : set_task ( 0.1 , "cmdNavy" , id ) case MODE_NIGHTMARE : set_task ( 0.1 , "SKULL1" , id ) default:{ g_has_droga [ id ] = 1 give_item ( id , "weapon_hegrenade" ) give_weapon_janus3 ( id ) set_task ( 0.1 , "mostrar_armas_survivor_3" , id ) } }
Código PHP:
static iRand , flags flags = get_user_flags ( id ) if ( g_clase [ id ] == SURVIVOR ) { if ( g_modo == MODE_SYNAPSIS ) { iRand = random_num ( 0 , ArraySize ( model_helboy ) - 1 ) ArrayGetString ( model_helboy , iRand , g_playermodel [ id ], charsmax ( g_playermodel [])) } else if ( g_modo == MODE_INVASION ) { iRand = random_num ( 0 , ArraySize ( model_infinity ) - 1 ) ArrayGetString ( model_infinity , iRand , g_playermodel [ id ], charsmax ( g_playermodel [])) } else if ( g_modo == MODE_NIGHTMARE || g_modo == MODE_INFINITY ) { iRand = random_num ( 0 , ArraySize ( model_thunder ) - 1 ) ArrayGetString ( model_thunder , iRand , g_playermodel [ id ], charsmax ( g_playermodel [])) } else if ( g_modo == MODE_ARMAGEDDON ) { iRand = random_num ( 0 , ArraySize ( model_survivor2 ) - 1 ) ArrayGetString ( model_survivor2 , iRand , g_playermodel [ id ], charsmax ( g_playermodel [])) } else if ( g_modo == MODE_DEPREDADOR || g_modo == MODE_AVD ) { iRand = random_num ( 0 , ArraySize ( model_depredador ) - 1 ) ArrayGetString ( model_depredador , iRand , g_playermodel [ id ], charsmax ( g_playermodel [])) } else if ( g_modo == MODE_TERMINATOR ) { iRand = random_num ( 0 , ArraySize ( model_terminator ) - 1 ) ArrayGetString ( model_terminator , iRand , g_playermodel [ id ], charsmax ( g_playermodel [])) } else { iRand = random_num ( 0 , ArraySize ( model_survivor ) - 1 ) ArrayGetString ( model_survivor , iRand , g_playermodel [ id ], charsmax ( g_playermodel [])) } } else if ( g_clase [ id ] == WESKER ) { if ( g_modo == MODE_CRYSIS ) { iRand = random_num ( 0 , ArraySize ( model_dead_volcano ) - 1 ) ArrayGetString ( model_dead_volcano , iRand , g_playermodel [ id ], charsmax ( g_playermodel [])) } else if ( g_modo == MODE_APOCALYPSE ) { iRand = random_num ( 0 , ArraySize ( model_human_3 ) - 1 ) ArrayGetString ( model_human_3 , iRand , g_playermodel [ id ], charsmax ( g_playermodel [])) } else if ( g_modo == MODE_CRISYS ) { iRand = random_num ( 0 , ArraySize ( model_crisys ) - 1 ) ArrayGetString ( model_crisys , iRand , g_playermodel [ id ], charsmax ( g_playermodel [])) } else { iRand = random_num ( 0 , ArraySize ( model_thunder ) - 1 ) ArrayGetString ( model_thunder , iRand , g_playermodel [ id ], charsmax ( g_playermodel [])) } } else { if ( flags & ADMIN_LEVEL_F ) { iRand = random_num ( 0 , ArraySize ( model_admin_human ) - 1 ) ArrayGetString ( model_admin_human , iRand , g_playermodel [ id ], charsmax ( g_playermodel [])) } else if ( flags & ADMIN_LEVEL_D ) { iRand = random_num ( 0 , ArraySize ( model_warrior_human ) - 1 ) ArrayGetString ( model_warrior_human , iRand , g_playermodel [ id ], charsmax ( g_playermodel [])) } else if ( flags & ADMIN_LEVEL_E ) { iRand = random_num ( 0 , ArraySize ( model_vip_human ) - 1 ) ArrayGetString ( model_vip_human , iRand , g_playermodel [ id ], charsmax ( g_playermodel [])) } else { switch ( get_pcvar_num ( cvar_hclass_hp )) { case 0 : { iRand = random_num ( ArrayGetCell ( g_hclass_modelsstart , g_humanclass [ id ]), ArrayGetCell ( g_hclass_modelsend , g_humanclass [ id ]) - 1 ) ArrayGetString ( g_hclass_playermodel , iRand , g_playermodel [ id ], charsmax ( g_playermodel [])) } case 1 : { iRand = random_num ( 0 , ArraySize ( model_thunder ) - 1 ) ArrayGetString ( model_thunder , iRand , g_playermodel [ id ], charsmax ( g_playermodel [])) } case 2 : { iRand = random_num ( ArrayGetCell ( g_hclass_modelsstart , g_humanclass [ id ]), ArrayGetCell ( g_hclass_modelsend , g_humanclass [ id ]) - 1 ) ArrayGetString ( g_hclass_playermodel , iRand , g_playermodel [ id ], charsmax ( g_playermodel [])) } } } } ///////////////////////////////////////////// switch( g_clase [ id ]){ case SURVIVOR :{ switch( g_modo ){ case MODE_SYNAPSIS :{ iRand = random_num ( 0 , ArraySize ( model_helboy ) - 1 ) ArrayGetString ( model_helboy , iRand , g_playermodel [ id ], charsmax ( g_playermodel [])) } case MODE_INVASION :{ iRand = random_num ( 0 , ArraySize ( model_infinity ) - 1 ) ArrayGetString ( model_infinity , iRand , g_playermodel [ id ], charsmax ( g_playermodel [])) } case MODE_NIGHTMARE , MODE_INFINITY :{ iRand = random_num ( 0 , ArraySize ( model_thunder ) - 1 ) ArrayGetString ( model_thunder , iRand , g_playermodel [ id ], charsmax ( g_playermodel [])) } case MODE_ARMAGEDDON :{ iRand = random_num ( 0 , ArraySize ( model_survivor2 ) - 1 ) ArrayGetString ( model_survivor2 , iRand , g_playermodel [ id ], charsmax ( g_playermodel [])) } case MODE_DEPREDADOR , MODE_AVD :{ iRand = random_num ( 0 , ArraySize ( model_depredador ) - 1 ) ArrayGetString ( model_depredador , iRand , g_playermodel [ id ], charsmax ( g_playermodel [])) } case MODE_TERMINATOR :{ iRand = random_num ( 0 , ArraySize ( model_terminator ) - 1 ) ArrayGetString ( model_terminator , iRand , g_playermodel [ id ], charsmax ( g_playermodel [])) } default :{ iRand = random_num ( 0 , ArraySize ( model_survivor ) - 1 ) ArrayGetString ( model_survivor , iRand , g_playermodel [ id ], charsmax ( g_playermodel [])) } } } case WESKER :{ switch( g_modo ){ case MODE_CRYSIS :{ iRand = random_num ( 0 , ArraySize ( model_dead_volcano ) - 1 ) ArrayGetString ( model_dead_volcano , iRand , g_playermodel [ id ], charsmax ( g_playermodel [])) } case MODE_APOCALYPSE :{ iRand = random_num ( 0 , ArraySize ( model_human_3 ) - 1 ) ArrayGetString ( model_human_3 , iRand , g_playermodel [ id ], charsmax ( g_playermodel [])) } case MODE_CRISYS :{ iRand = random_num ( 0 , ArraySize ( model_crisys ) - 1 ) ArrayGetString ( model_crisys , iRand , g_playermodel [ id ], charsmax ( g_playermodel [])) } default:{ iRand = random_num ( 0 , ArraySize ( model_thunder ) - 1 ) ArrayGetString ( model_thunder , iRand , g_playermodel [ id ], charsmax ( g_playermodel [])) } } } default:{ if ( flags & ADMIN_LEVEL_F ){ iRand = random_num ( 0 , ArraySize ( model_admin_human ) - 1 ) ArrayGetString ( model_admin_human , iRand , g_playermodel [ id ], charsmax ( g_playermodel [])) } else if ( flags & ADMIN_LEVEL_D ) { iRand = random_num ( 0 , ArraySize ( model_warrior_human ) - 1 ) ArrayGetString ( model_warrior_human , iRand , g_playermodel [ id ], charsmax ( g_playermodel [])) } else if ( flags & ADMIN_LEVEL_E ) { iRand = random_num ( 0 , ArraySize ( model_vip_human ) - 1 ) ArrayGetString ( model_vip_human , iRand , g_playermodel [ id ], charsmax ( g_playermodel [])) } else { switch ( get_pcvar_num ( cvar_hclass_hp )) { case 0 : { iRand = random_num ( ArrayGetCell ( g_hclass_modelsstart , g_humanclass [ id ]), ArrayGetCell ( g_hclass_modelsend , g_humanclass [ id ]) - 1 ) ArrayGetString ( g_hclass_playermodel , iRand , g_playermodel [ id ], charsmax ( g_playermodel [])) } case 1 : { iRand = random_num ( 0 , ArraySize ( model_thunder ) - 1 ) ArrayGetString ( model_thunder , iRand , g_playermodel [ id ], charsmax ( g_playermodel [])) } case 2 : { iRand = random_num ( ArrayGetCell ( g_hclass_modelsstart , g_humanclass [ id ]), ArrayGetCell ( g_hclass_modelsend , g_humanclass [ id ]) - 1 ) ArrayGetString ( g_hclass_playermodel , iRand , g_playermodel [ id ], charsmax ( g_playermodel [])) } } } } }
Este último no estoy seguro como pasarlo a un switch:
Código PHP:
if ( flags & ADMIN_LEVEL_F ) { iRand = random_num ( 0 , ArraySize ( model_admin_human ) - 1 ) ArrayGetString ( model_admin_human , iRand , g_playermodel [ id ], charsmax ( g_playermodel [])) } else if ( flags & ADMIN_LEVEL_D ) { iRand = random_num ( 0 , ArraySize ( model_warrior_human ) - 1 ) ArrayGetString ( model_warrior_human , iRand , g_playermodel [ id ], charsmax ( g_playermodel [])) } else if ( flags & ADMIN_LEVEL_E ) { iRand = random_num ( 0 , ArraySize ( model_vip_human ) - 1 ) ArrayGetString ( model_vip_human , iRand , g_playermodel [ id ], charsmax ( g_playermodel [])) }
Hay mucho más código, pero tampoco me quiero volver loco jaja, espero que se entiendo, sino lo sumo como .sma
Mensajes: 4,247
Temas: 94
Registro en: Mar 2014
Reputación:
58
Se puede ahorrar más codigo en la parte donde seteas el model del jugador
Código PHP:
switch( g_clase [ victim ]) { case NEMESIS : { if(! get_pcvar_num ( cvar_nempainfree )) return; } case ALIEN : { if(! get_pcvar_num ( cvar_alipainfree )) return; } case LAST_ZOMBIE : { if(! get_pcvar_num ( cvar_zombiepainfree )) return; } case FIRST_ZOMBIE : { if(! get_pcvar_num ( cvar_zombiepainfree )) return; } case SURVIVOR : { if(! get_pcvar_num ( cvar_survpainfree )) return; } case WESKER : { if(! get_pcvar_num ( cvar_weskpainfree )) return; } default: { return; } } if( g_clase [ id ] == SURVIVOR ) { switch( g_modo ) { case MODE_SYNAPSIS : { iRand = random_num ( 0 , ArraySize ( model_helboy ) - 1 ) ArrayGetString ( model_helboy , iRand , g_playermodel [ id ], charsmax ( g_playermodel [])) } case MODE_INVASION : { iRand = random_num ( 0 , ArraySize ( model_infinity ) - 1 ) ArrayGetString ( model_infinity , iRand , g_playermodel [ id ], charsmax ( g_playermodel [])) } case MODE_NIGHTMARE , MODE_INFINITY : { iRand = random_num ( 0 , ArraySize ( model_thunder ) - 1 ) ArrayGetString ( model_thunder , iRand , g_playermodel [ id ], charsmax ( g_playermodel [])) } case MODE_ARMAGEDDON : { iRand = random_num ( 0 , ArraySize ( model_survivor2 ) - 1 ) ArrayGetString ( model_survivor2 , iRand , g_playermodel [ id ], charsmax ( g_playermodel [])) } case MODE_DEPREDADOR , MODE_AVD : { iRand = random_num ( 0 , ArraySize ( model_depredador ) - 1 ) ArrayGetString ( model_depredador , iRand , g_playermodel [ id ], charsmax ( g_playermodel [])) } case MODE_TERMINATOR : { iRand = random_num ( 0 , ArraySize ( model_terminator ) - 1 ) ArrayGetString ( model_terminator , iRand , g_playermodel [ id ], charsmax ( g_playermodel [])) } default: { iRand = random_num ( 0 , ArraySize ( model_survivor ) - 1 ) ArrayGetString ( model_survivor , iRand , g_playermodel [ id ], charsmax ( g_playermodel [])) } } } else if( g_clase [ id ] == WESKER ) { switch( g_modo ){ case MODE_CRYSIS :{ iRand = random_num ( 0 , ArraySize ( model_dead_volcano ) - 1 ) ArrayGetString ( model_dead_volcano , iRand , g_playermodel [ id ], charsmax ( g_playermodel [])) } case MODE_APOCALYPSE :{ iRand = random_num ( 0 , ArraySize ( model_human_3 ) - 1 ) ArrayGetString ( model_human_3 , iRand , g_playermodel [ id ], charsmax ( g_playermodel [])) } case MODE_CRISYS :{ iRand = random_num ( 0 , ArraySize ( model_crisys ) - 1 ) ArrayGetString ( model_crisys , iRand , g_playermodel [ id ], charsmax ( g_playermodel [])) } default:{ iRand = random_num ( 0 , ArraySize ( model_thunder ) - 1 ) ArrayGetString ( model_thunder , iRand , g_playermodel [ id ], charsmax ( g_playermodel [])) } } } else { switch( flags ) { case & ADMIN_LEVEL_F : { iRand = random_num ( 0 , ArraySize ( model_admin_human ) - 1 ) ArrayGetString ( model_admin_human , iRand , g_playermodel [ id ], charsmax ( g_playermodel [])) } case & ADMIN_LEVEL_D : { iRand = random_num ( 0 , ArraySize ( model_warrior_human ) - 1 ) ArrayGetString ( model_warrior_human , iRand , g_playermodel [ id ], charsmax ( g_playermodel [])) } case & ADMIN_LEVEL_E : { iRand = random_num ( 0 , ArraySize ( model_vip_human ) - 1 ) ArrayGetString ( model_vip_human , iRand , g_playermodel [ id ], charsmax ( g_playermodel [])) } default: { switch ( get_pcvar_num ( cvar_hclass_hp )) { case 0 : { iRand = random_num ( ArrayGetCell ( g_hclass_modelsstart , g_humanclass [ id ]), ArrayGetCell ( g_hclass_modelsend , g_humanclass [ id ]) - 1 ) ArrayGetString ( g_hclass_playermodel , iRand , g_playermodel [ id ], charsmax ( g_playermodel [])) } case 1 : { iRand = random_num ( 0 , ArraySize ( model_thunder ) - 1 ) ArrayGetString ( model_thunder , iRand , g_playermodel [ id ], charsmax ( g_playermodel [])) } case 2 : { iRand = random_num ( ArrayGetCell ( g_hclass_modelsstart , g_humanclass [ id ]), ArrayGetCell ( g_hclass_modelsend , g_humanclass [ id ]) - 1 ) ArrayGetString ( g_hclass_playermodel , iRand , g_playermodel [ id ], charsmax ( g_playermodel [])) } } } } }
Estudia siempre; el tiempo es oro, lo material se puede recuperar pero el tiempo no se puede recuperar.
(02/10/2016, 05:05 PM) meTaLiCroSS escribió: Siempre me gusta ayudar cuando alguien esta interesado realmente en ver que esta programando. (08/08/2019, 05:32 PM) meTaLiCroSS escribió: grax x el dato cr4ck
Mis aportes
PLUGINS MAPAS
Menú LANG
[SF] Sistema de Frags
Say System (Admin Prefix)
Mensajes: 546
Temas: 65
Registro en: Jan 2017
Reputación:
4
(05/10/2018, 06:48 AM) totopizza escribió: Se puede ahorrar más codigo en la parte donde seteas el model del jugador
Código PHP:
switch( g_clase [ victim ]) { case NEMESIS : { if(! get_pcvar_num ( cvar_nempainfree )) return; } case ALIEN : { if(! get_pcvar_num ( cvar_alipainfree )) return; } case LAST_ZOMBIE : { if(! get_pcvar_num ( cvar_zombiepainfree )) return; } case FIRST_ZOMBIE : { if(! get_pcvar_num ( cvar_zombiepainfree )) return; } case SURVIVOR : { if(! get_pcvar_num ( cvar_survpainfree )) return; } case WESKER : { if(! get_pcvar_num ( cvar_weskpainfree )) return; } default: { return; } } if( g_clase [ id ] == SURVIVOR ) { switch( g_modo ) { case MODE_SYNAPSIS : { iRand = random_num ( 0 , ArraySize ( model_helboy ) - 1 ) ArrayGetString ( model_helboy , iRand , g_playermodel [ id ], charsmax ( g_playermodel [])) } case MODE_INVASION : { iRand = random_num ( 0 , ArraySize ( model_infinity ) - 1 ) ArrayGetString ( model_infinity , iRand , g_playermodel [ id ], charsmax ( g_playermodel [])) } case MODE_NIGHTMARE , MODE_INFINITY : { iRand = random_num ( 0 , ArraySize ( model_thunder ) - 1 ) ArrayGetString ( model_thunder , iRand , g_playermodel [ id ], charsmax ( g_playermodel [])) } case MODE_ARMAGEDDON : { iRand = random_num ( 0 , ArraySize ( model_survivor2 ) - 1 ) ArrayGetString ( model_survivor2 , iRand , g_playermodel [ id ], charsmax ( g_playermodel [])) } case MODE_DEPREDADOR , MODE_AVD : { iRand = random_num ( 0 , ArraySize ( model_depredador ) - 1 ) ArrayGetString ( model_depredador , iRand , g_playermodel [ id ], charsmax ( g_playermodel [])) } case MODE_TERMINATOR : { iRand = random_num ( 0 , ArraySize ( model_terminator ) - 1 ) ArrayGetString ( model_terminator , iRand , g_playermodel [ id ], charsmax ( g_playermodel [])) } default: { iRand = random_num ( 0 , ArraySize ( model_survivor ) - 1 ) ArrayGetString ( model_survivor , iRand , g_playermodel [ id ], charsmax ( g_playermodel [])) } } } else if( g_clase [ id ] == WESKER ) { switch( g_modo ){ case MODE_CRYSIS :{ iRand = random_num ( 0 , ArraySize ( model_dead_volcano ) - 1 ) ArrayGetString ( model_dead_volcano , iRand , g_playermodel [ id ], charsmax ( g_playermodel [])) } case MODE_APOCALYPSE :{ iRand = random_num ( 0 , ArraySize ( model_human_3 ) - 1 ) ArrayGetString ( model_human_3 , iRand , g_playermodel [ id ], charsmax ( g_playermodel [])) } case MODE_CRISYS :{ iRand = random_num ( 0 , ArraySize ( model_crisys ) - 1 ) ArrayGetString ( model_crisys , iRand , g_playermodel [ id ], charsmax ( g_playermodel [])) } default:{ iRand = random_num ( 0 , ArraySize ( model_thunder ) - 1 ) ArrayGetString ( model_thunder , iRand , g_playermodel [ id ], charsmax ( g_playermodel [])) } } } else { switch( flags ) { case & ADMIN_LEVEL_F : { iRand = random_num ( 0 , ArraySize ( model_admin_human ) - 1 ) ArrayGetString ( model_admin_human , iRand , g_playermodel [ id ], charsmax ( g_playermodel [])) } case & ADMIN_LEVEL_D : { iRand = random_num ( 0 , ArraySize ( model_warrior_human ) - 1 ) ArrayGetString ( model_warrior_human , iRand , g_playermodel [ id ], charsmax ( g_playermodel [])) } case & ADMIN_LEVEL_E : { iRand = random_num ( 0 , ArraySize ( model_vip_human ) - 1 ) ArrayGetString ( model_vip_human , iRand , g_playermodel [ id ], charsmax ( g_playermodel [])) } default: { switch ( get_pcvar_num ( cvar_hclass_hp )) { case 0 : { iRand = random_num ( ArrayGetCell ( g_hclass_modelsstart , g_humanclass [ id ]), ArrayGetCell ( g_hclass_modelsend , g_humanclass [ id ]) - 1 ) ArrayGetString ( g_hclass_playermodel , iRand , g_playermodel [ id ], charsmax ( g_playermodel [])) } case 1 : { iRand = random_num ( 0 , ArraySize ( model_thunder ) - 1 ) ArrayGetString ( model_thunder , iRand , g_playermodel [ id ], charsmax ( g_playermodel [])) } case 2 : { iRand = random_num ( ArrayGetCell ( g_hclass_modelsstart , g_humanclass [ id ]), ArrayGetCell ( g_hclass_modelsend , g_humanclass [ id ]) - 1 ) ArrayGetString ( g_hclass_playermodel , iRand , g_playermodel [ id ], charsmax ( g_playermodel [])) } } } } }
Si lo dices por las clases humanas sin frags, es por algunos modos, pero ya que lo dices puedo usar el mismo precache de la forma de un nuevo zp que estoy terminando. Pero lo que nose si la razón de los bajones de fps es por el uso masivo de switch según la condición o se me paso por alto algun código ...
Aquella ves que lo hice lo deje con el switch de como lo pasaste con los frags, solo que yo no le puse el & en los cases del frags admin