Sky^^ Publicado 17 de marzo del 2016 Denunciar Compartir Publicado 17 de marzo del 2016 Plugin: Rangos por Puntos Versión: 1.0 Creador/Autor: Skylar and KikizonPara revivir la sección esta, dejo este aporte, a algunos les servira.. Gracias y adiós. #include <amxmodx> new gRange[ 33 ], gPoints[ 33 ]; enum _:REQUIREDRANGES { NAME[32], PRICE }; new const RangesInfo[ ][ REQUIREDRANGES ] = { { "Rango 1", 100 }, { "Rango 2", 200 }, { "Rango 3", 300 }, { "Rango 4", 400 }, { "Rango 5", 500 } }; public plugin_init( ) { register_plugin( "RangesForPoints", "1.0", "Skylar and Kikizon" ); register_event( "DeathMsg", "event_Death", "a" ); register_clcmd( "say /rango", "CheckRange" ); register_clcmd( "say /puntos", "CheckPoints" ); } public event_Death( ) { new Attacker = read_data( 1 ); new Victim = read_data( 2 ); if( Victim == Attacker ) return; if( !is_user_alive( Attacker ) ) return; UpdateRange( Attacker, 2 ); } public CheckRange( id ) client_print( id, print_chat, "Eres rango %s.", RangesInfo[ gRange[ id ] ][ NAME ] ); public CheckPoints( id ) client_print( id, print_chat, "Tienes %d punto%s.", gPoints[ id ], gPoints[ id ] == 1 ? "" : "s" ); public UpdateRange( id, points ) { gPoints[ id ] += points; new Range = gRange[ id ]; while( gPoints[ id ] >= RangesInfo[ gRange[ id ] ][ PRICE ] ) ++gRange[ id ]; if( Range < gRange[ id ] ) client_print( id, print_chat, "Felicidades! Subiste al rango %s.", RangesInfo[ gRange[ id ] ][ NAME ] ); } Bartu y Alita de Mosca reaccionaron a esto 2 Enlace al comentario Compartir en otros sitios More sharing options...
Santjcs Publicado 19 de marzo del 2016 Denunciar Compartir Publicado 19 de marzo del 2016 Holis, Nunca vas a pasar los 2 puntos porque... gPoints[ id ] = points; UpdateRange( Attacker, 2 ); public UpdateRange( id, points ) { gPoints[ id ] = points; new Range = gRange[ id ]; while( gPoints[ id ] >= RangesInfo[ gRange[ id ] ][ PRICE ] ) ++gRange[ id ]; if( Range < gRange[ id ] ) client_print( id, print_chat, "Felicidades! Subiste al rango %s.", RangesInfo[ gRange[ id ] ][ NAME ] ); } Sky^^ y Alita de Mosca reaccionaron a esto 2 Enlace al comentario Compartir en otros sitios More sharing options...
Leire Publicado 20 de marzo del 2016 Denunciar Compartir Publicado 20 de marzo del 2016 Ojalá se tome muy en cuenta para la comu, ésto es hermoso, gracias! Sky^^ reaccionó a esto 1 Enlace al comentario Compartir en otros sitios More sharing options...
Sky^^ Publicado 20 de marzo del 2016 Autor Denunciar Compartir Publicado 20 de marzo del 2016 On 18/3/2016 22:54:13, Santjcs dijo: Holis, Nunca vas a pasar los 2 puntos porque... gPoints[ id ] = points; UpdateRange( Attacker, 2 ); public UpdateRange( id, points ) { gPoints[ id ] = points; new Range = gRange[ id ]; while( gPoints[ id ] >= RangesInfo[ gRange[ id ] ][ PRICE ] ) ++gRange[ id ]; if( Range < gRange[ id ] ) client_print( id, print_chat, "Felicidades! Subiste al rango %s.", RangesInfo[ gRange[ id ] ][ NAME ] ); } Se me escapó jaja. Gracias ^^ Enlace al comentario Compartir en otros sitios More sharing options...
Sky^^ Publicado 20 de marzo del 2016 Autor Denunciar Compartir Publicado 20 de marzo del 2016 hace 13 horas, SHERIFF dijo: Ojalá se tome muy en cuenta para la comu, ésto es hermoso, gracias! Gracias ^^ Enlace al comentario Compartir en otros sitios More sharing options...
Posts recomendados