Mensajes: 241
Temas: 48
Registro en: Oct 2013
Reputación:
0
17/10/2013, 04:32 PM
(Última modificación: 20/10/2013, 08:12 PM por Tig .)
Me ha surgido una duda, como puedo bloquear un nivel maximo? es decir tengo hasta 150 niveles, y quiero que la gente si itenta subir mas de 150 salga algun print y no le deje, porque si te pasa del nivel maximo que tienes de zombie y humanos se buguea el menu
Archivos adjuntos
Descargar AMXX / zombie_xp.sma (Tamaño: 70.62 KB / Descargas: 46)
No hay mejor maestro que la experiencia más amarga de uno mismo, todo parece imposible hasta que se hace.
Mensajes: 4,637
Temas: 73
Registro en: Oct 2013
Reputación:
44
Línea 1245:
Código PHP:
if ( userLevel [ id ] < 150 ){ if( getAmmoPacks ( id ) >= getNeededPacks ( id )) { setAmmoPacks ( id , getAmmoPacks ( id ) - getNeededPacks ( id )) userLevel [ id ] += 1 save_data ( id ) // Inform the user they leveled up zp_colored_print ( id , "^x04%s^x01 %L %d" , textHeader , id , "MENU_BUY_LEVEL" , userLevel [ id ]) ShowHUD ( id ) } else { zp_colored_print ( id , "^x04%s^x01 %L" , textHeader , id , "ERR_NOTENOUGHPACKS" ) } } else { zp_colored_print ( id , "^x04%s^x01 Maximo nivel alcanzado." , textHeader ) }
Mensajes: 241
Temas: 48
Registro en: Oct 2013
Reputación:
0
20/10/2013, 09:52 AM
(Última modificación: 20/10/2013, 10:03 AM por Tig .)
(20/10/2013, 12:40 AM) Neeeeeeeeeel.- escribió: Línea 1245:
Código PHP:
if ( userLevel [ id ] < 150 ){ if( getAmmoPacks ( id ) >= getNeededPacks ( id )) { setAmmoPacks ( id , getAmmoPacks ( id ) - getNeededPacks ( id )) userLevel [ id ] += 1 save_data ( id ) // Inform the user they leveled up zp_colored_print ( id , "^x04%s^x01 %L %d" , textHeader , id , "MENU_BUY_LEVEL" , userLevel [ id ]) ShowHUD ( id ) } else { zp_colored_print ( id , "^x04%s^x01 %L" , textHeader , id , "ERR_NOTENOUGHPACKS" ) } } else { zp_colored_print ( id , "^x04%s^x01 Maximo nivel alcanzado." , textHeader ) }
asi como me lo das tu lo puse desde la linea 1245 y me da error aki:
pero si al ultimo else le kito la llave copila con un warning
por
No hay mejor maestro que la experiencia más amarga de uno mismo, todo parece imposible hasta que se hace.
Mensajes: 4,637
Temas: 73
Registro en: Oct 2013
Reputación:
44
Haciendo solo c&p no te va a servir de nada, tenés que borrar el código anterior.
Mensajes: 241
Temas: 48
Registro en: Oct 2013
Reputación:
0
20/10/2013, 03:12 PM
(Última modificación: 20/10/2013, 03:22 PM por Tig .)
(20/10/2013, 01:43 PM) Neeeeeeeeeel.- escribió: Haciendo solo c&p no te va a servir de nada, tenés que borrar el código anterior.
El codigo anterrior lo borre, porque me da error esa llave?
Código PHP:
// Game Menu public menu_game ( id , key ) { if( get_pcvar_num ( cvar_removexp ) == 1 ) key ++; switch ( key ) { case 0 : // Buy a level up { if ( userLevel [ id ] < 150 ){ if( getAmmoPacks ( id ) >= getNeededPacks ( id )) { setAmmoPacks ( id , getAmmoPacks ( id ) - getNeededPacks ( id )) userLevel [ id ] += 1 save_data ( id ) // Inform the user they leveled up zp_colored_print ( id , "^x04%s^x01 %L %d" , textHeader , id , "MENU_BUY_LEVEL" , userLevel [ id ]) ShowHUD ( id ) } else { zp_colored_print ( id , "^x04%s^x01 %L" , textHeader , id , "ERR_NOTENOUGHPACKS" ) } } else { zp_colored_print ( id , "^x04%s^x01 Maximo nivel alcanzado." , textHeader ) } case 1 : // Human Classes { // Restrict it here if we wanted to show_menu_hclass ( id ) } case 2 : // Zombie Classes { if ( get_pcvar_num ( cvar_removezombie ) == 0 ) { // Restrict it here if we wanted to show_menu_zclass ( id ) } } } return PLUGIN_HANDLED ; }
No hay mejor maestro que la experiencia más amarga de uno mismo, todo parece imposible hasta que se hace.
Mensajes: 4,637
Temas: 73
Registro en: Oct 2013
Reputación:
44
Te falta cerrar una llave.
Mensajes: 241
Temas: 48
Registro en: Oct 2013
Reputación:
0
(20/10/2013, 03:42 PM) Neeeeeeeeeel.- escribió: Te falta cerrar una llave.
cerrandola me da error aqui
Código PHP:
zp_colored_print ( id , "^x04%s^x01 %L" , textHeader , id , "SAY_INFO_KEY" , strLetter )
No hay mejor maestro que la experiencia más amarga de uno mismo, todo parece imposible hasta que se hace.
Mensajes: 4,637
Temas: 73
Registro en: Oct 2013
Reputación:
44
Mensajes: 241
Temas: 48
Registro en: Oct 2013
Reputación:
0
(20/10/2013, 06:20 PM) Neeeeeeeeeel.- escribió: Que error te da?
Código PHP:
Welcome to the AMX Mod X 1.8.1 - 300 Compiler . Copyright ( c ) 1997 - 2006 ITB CompuPhase , AMX Mod X Team Error : Argument type mismatch ( argument 2 ) on line 388 Error : Argument type mismatch ( argument 2 ) on line 392 Error : Argument type mismatch ( argument 2 ) on line 398 Error : Argument type mismatch ( argument 2 ) on line 404 Error : Argument type mismatch ( argument 2 ) on line 486 Error : Argument type mismatch ( argument 2 ) on line 519 Error : Argument type mismatch ( argument 2 ) on line 540 Error : Argument type mismatch ( argument 2 ) on line 546 Error : Argument type mismatch ( argument 2 ) on line 552 Error : Argument type mismatch ( argument 2 ) on line 558 Error : Argument type mismatch ( argument 2 ) on line 580 Error : Argument type mismatch ( argument 2 ) on line 585 Error : Argument type mismatch ( argument 2 ) on line 592 Error : Argument type mismatch ( argument 2 ) on line 599 Error : Argument type mismatch ( argument 2 ) on line 606 Error : Argument type mismatch ( argument 2 ) on line 613 Error : Argument type mismatch ( argument 2 ) on line 632 Error : Argument type mismatch ( argument 2 ) on line 639 Error : Argument type mismatch ( argument 2 ) on line 646 Error : Argument type mismatch ( argument 2 ) on line 652 Error : Invalid function or declaration on line 1241 Error : Invalid function or declaration on line 1243 Error : Invalid function or declaration on line 1246 Error : Invalid function or declaration on line 1247 Error : Symbol already defined : "setAmmoPacks" on line 1249 Error : Expected token : ";" , but found ")" on line 1249 Compilation aborted . 26 Errors .
Alomejor cierro yo mal la llave, la cierro debajo de esto:
Código PHP:
if( get_pcvar_num ( cvar_removexp ) == 1 ) key ++;
No hay mejor maestro que la experiencia más amarga de uno mismo, todo parece imposible hasta que se hace.
Mensajes: 4,637
Temas: 73
Registro en: Oct 2013
Reputación:
44
La cerrás mal, ahí no va.
Mensajes: 241
Temas: 48
Registro en: Oct 2013
Reputación:
0
(20/10/2013, 07:59 PM) Neeeeeeeeeel.- escribió: La cerrás mal, ahí no va.
Aiva no mire que el public no estaba cerrado, perdona neel, ya va todo bien, puede generar algun bug cambiando esto ?
No hay mejor maestro que la experiencia más amarga de uno mismo, todo parece imposible hasta que se hace.
Mensajes: 4,637
Temas: 73
Registro en: Oct 2013
Reputación:
44
(20/10/2013, 08:11 PM) Tig escribió: (20/10/2013, 07:59 PM) Neeeeeeeeeel.- escribió: La cerrás mal, ahí no va.
Aiva no mire que el public no estaba cerrado, perdona neel, ya va todo bien, puede generar algun bug cambiando esto ?No creo...
Mensajes: 241
Temas: 48
Registro en: Oct 2013
Reputación:
0
(20/10/2013, 08:17 PM) Neeeeeeeeeel.- escribió: (20/10/2013, 08:11 PM) Tig escribió: (20/10/2013, 07:59 PM) Neeeeeeeeeel.- escribió: La cerrás mal, ahí no va.
Aiva no mire que el public no estaba cerrado, perdona neel, ya va todo bien, puede generar algun bug cambiando esto ? No creo...
Me pones en duda, el que no cres? xd, lo de que no havia visto eso ? o que no he cerrado bien
No hay mejor maestro que la experiencia más amarga de uno mismo, todo parece imposible hasta que se hace.