Mensajes: 72
Temas: 33
Registro en: Apr 2015
Reputación:
0
Hola Tengo este plugin que muestra el dinero del equipo ya sea CT o TT,
funciona bien, el unico detalle esq si un jugador compra un arma sigue mostrando el dinero que tenia cuando nacio y no cambia.
Espero me entiendan y ayuden
Codigo:
Código PHP:
#include <amxmodx> #include <cstrike> #include <hamsandwich> public plugin_init () { register_plugin ( NAME , VERSION , AUTHOR ) RegisterHam ( Ham_Spawn , "player" , "PUG_SpawnPost" , 1 ); } public PUG_SpawnPost ( id ) { set_task ( 0.1 , "PUG_MoneyTeam" , id ); } public PUG_MoneyTeam ( id ) { new szTeam [ 13 ]; get_user_team ( id , szTeam , charsmax ( szTeam )); new iPlayers [ 32 ], iNum , iPlayer ; get_players ( iPlayers , iNum , "aeh" , szTeam ); new szName [ 32 ], szHud [ 512 ], iMoney ; for(new i ; i < iNum ; i ++) { iPlayer = iPlayers [ i ]; iMoney = cs_get_user_money ( iPlayer ); get_user_name ( iPlayer , szName , charsmax ( szName )); format ( szHud , charsmax ( szHud ), "%s%s $ %d^n" , szHud , szName , iMoney ); } set_hudmessage ( 0 , 255 , 0 , 0.58 , 0.02 , 0 , 0.0 , 16.0 , 0.0 , 0.0 , 1 ); show_hudmessage ( id ,( szTeam [ 0 ] == 'C' ) ? "Anti-Terroristas:" : "Terroristas:" ); set_hudmessage ( 255 , 255 , 225 , 0.58 , 0.05 , 0 , 0.0 , 16.0 , 0.0 , 0.0 , 2 ); show_hudmessage ( id , szHud ); }
Mensajes: 1,933
Temas: 39
Registro en: Jul 2014
Reputación:
23
por que mejor no haces 2 task 1 tt y el otro ct en vez de 10 task
Mensajes: 876
Temas: 74
Registro en: Sep 2015
Reputación:
11
22/12/2016, 11:47 AM
(Última modificación: 22/12/2016, 12:00 PM por Web Controller .)
Código PHP:
///////////////////////////////////////////// #define VERSION "1.3.17" ///////////////////////////////////////////// #include < amxmodx > #include < cstrike > #include < hamsandwich > ///////////////////////////////////////////// enum _ : PLUGIN_DATA { PLUGIN [ 30 ], AUTOR [ 20 ], PREFIJO_CHAT [ 15 ] } ///////////////////////////////////////////// new const g_Informacion_Plugin [ _ : PLUGIN_DATA ] = { { "Show Team Money" }, { "K.K.Lv" }, { "!g[ AMXX ]!y" } } ///////////////////////////////////////////// new g_MaxPlayers , g_iSyncHud , bool : g_HudDinero [ 33 ]; ///////////////////////////////////////////// public plugin_init ( ) { register_plugin ( g_Informacion_Plugin [ PLUGIN ], VERSION , g_Informacion_Plugin [ AUTOR ] ) register_clcmd ( "say /dinero" , "Cmd_HudDinero" ); RegisterHam ( Ham_Spawn , "player" , "HAM_Spawn" , 1 ) g_MaxPlayers = get_maxplayers ( ) g_iSyncHud = CreateHudSyncObj ( ) } public client_disconnect ( id ) if( task_exists ( id ) ) remove_task ( id ) ///////////////////////////////////////////// public HAM_Spawn ( id ) { if( task_exists ( id ) ) remove_task ( id ) if( is_user_alive ( id ) ) set_task ( 2.0 , "HUD_Dinero" , id ) } public Cmd_HudDinero ( id ) { if( g_HudDinero [ id ] ) g_HudDinero [ id ] = false ; else g_HudDinero [ id ] = true ; Print_Color ( id , "%s Has %sactivado el !gHUD!y del dinero de tus !tcompañeros!y!" , g_Informacion_Plugin [ PREFIJO_CHAT ], g_HudDinero [ id ] ? "" : "des" ); } public HUD_Dinero ( id ) { static szMensaje [ 1024 ], szNombre [ 32 ]; new iDinero , i , iLen ; iLen = format ( szMensaje , charsmax ( szMensaje ), "Dinero de tus compañeros:^n" ); for( i = 1 ; i <= g_MaxPlayers ; i ++ ) { if( i != id && is_user_connected ( i ) && cs_get_user_team ( i ) == cs_get_user_team ( id ) ) { iDinero = cs_get_user_money ( i ); get_user_name ( i , szNombre , charsmax ( szNombre ) ); iLen += format ( szMensaje [ iLen ], charsmax ( szMensaje ) - iLen , "%-22.22s: %d^n" , szNombre , iDinero ); } } iLen += format ( szMensaje [ iLen ], charsmax ( szMensaje ) - iLen , "^n[ ! ] Tipea /dinero para desactivar esto!" ); set_hudmessage ( 100 , 200 , 0 , 0.05 , 0.35 , 0 , 0.02 , 5.0 , 0.1 , 0.2 , 2 ); ShowSyncHudMsg ( id , g_iSyncHud , szMensaje ); } ///////////////////////////////////////////// stock Print_Color ( id , const input [ ], any :... ) { static szMsg [ 191 ], msgSayText ; if ( ! msgSayText ) msgSayText = get_user_msgid ( "SayText" ); vformat ( szMsg , 190 , input , 3 ); replace_all ( szMsg , 190 , "!g" , "^4" ); replace_all ( szMsg , 190 , "!y" , "^1" ); replace_all ( szMsg , 190 , "!t" , "^3" ); message_begin ( id ? MSG_ONE_UNRELIABLE : MSG_BROADCAST , msgSayText , . player = id ); write_byte ( id ? id : 33 ); write_string ( szMsg ); message_end ( ); }
Mensajes: 72
Temas: 33
Registro en: Apr 2015
Reputación:
0
(22/12/2016, 11:47 AM) Web Controller escribió: Código PHP:
///////////////////////////////////////////// #define VERSION "1.3.17" ///////////////////////////////////////////// #include < amxmodx > #include < cstrike > #include < hamsandwich > ///////////////////////////////////////////// enum _ : PLUGIN_DATA { PLUGIN [ 30 ], AUTOR [ 20 ], PREFIJO_CHAT [ 15 ] } ///////////////////////////////////////////// new const g_Informacion_Plugin [ _ : PLUGIN_DATA ] = { { "Show Team Money" }, { "K.K.Lv" }, { "!g[ AMXX ]!y" } } ///////////////////////////////////////////// new g_MaxPlayers , g_iSyncHud , bool : g_HudDinero [ 33 ]; ///////////////////////////////////////////// public plugin_init ( ) { register_plugin ( g_Informacion_Plugin [ PLUGIN ], VERSION , g_Informacion_Plugin [ AUTOR ] ) register_clcmd ( "say /dinero" , "Cmd_HudDinero" ); RegisterHam ( Ham_Spawn , "player" , "HAM_Spawn" , 1 ) g_MaxPlayers = get_maxplayers ( ) g_iSyncHud = CreateHudSyncObj ( ) } public client_disconnect ( id ) if( task_exists ( id ) ) remove_task ( id ) ///////////////////////////////////////////// public HAM_Spawn ( id ) { if( task_exists ( id ) ) remove_task ( id ) if( is_user_alive ( id ) ) set_task ( 2.0 , "HUD_Dinero" , id ) } public Cmd_HudDinero ( id ) { if( g_HudDinero [ id ] ) g_HudDinero [ id ] = false ; else g_HudDinero [ id ] = true ; Print_Color ( id , "%s Has %sactivado el !gHUD!y del dinero de tus !tcompañeros!y!" , g_Informacion_Plugin [ PREFIJO_CHAT ], g_HudDinero [ id ] ? "" : "des" ); } public HUD_Dinero ( id ) { static szMensaje [ 1024 ], szNombre [ 32 ]; new iDinero , i , iLen ; iLen = format ( szMensaje , charsmax ( szMensaje ), "Dinero de tus compañeros:^n" ); for( i = 1 ; i <= g_MaxPlayers ; i ++ ) { if( i != id && is_user_connected ( i ) && cs_get_user_team ( i ) == cs_get_user_team ( id ) ) { iDinero = cs_get_user_money ( i ); get_user_name ( i , szNombre , charsmax ( szNombre ) ); iLen += format ( szMensaje [ iLen ], charsmax ( szMensaje ) - iLen , "%-22.22s: %d^n" , szNombre , iDinero ); } } iLen += format ( szMensaje [ iLen ], charsmax ( szMensaje ) - iLen , "^n[ ! ] Tipea /dinero para desactivar esto!" ); set_hudmessage ( 100 , 200 , 0 , 0.05 , 0.35 , 0 , 0.02 , 5.0 , 0.1 , 0.2 , 2 ); ShowSyncHudMsg ( id , g_iSyncHud , szMensaje ); } ///////////////////////////////////////////// stock Print_Color ( id , const input [ ], any :... ) { static szMsg [ 191 ], msgSayText ; if ( ! msgSayText ) msgSayText = get_user_msgid ( "SayText" ); vformat ( szMsg , 190 , input , 3 ); replace_all ( szMsg , 190 , "!g" , "^4" ); replace_all ( szMsg , 190 , "!y" , "^1" ); replace_all ( szMsg , 190 , "!t" , "^3" ); message_begin ( id ? MSG_ONE_UNRELIABLE : MSG_BROADCAST , msgSayText , . player = id ); write_byte ( id ? id : 33 ); write_string ( szMsg ); message_end ( ); }
Gracias amigo pero en tu plugin no sale mi dinero y al hacer una compra un amigo el dinero no se actualiza en el hud
Mensajes: 818
Temas: 71
Registro en: Sep 2014
Reputación:
12
22/12/2016, 07:52 PM
(Última modificación: 22/12/2016, 08:05 PM por PredatorFlys .)
Código PHP:
/* Plugin generated by AMXX-Studio */ /* Plugin generated by AMXX-Studio */ #include <amxmodx> #include <amxmisc> #include <cstrike> #include <hamsandwich> #define PLUGIN "New Plug-In" #define VERSION "1.0" #define AUTHOR "author" public plugin_init () { register_plugin ( PLUGIN , VERSION , AUTHOR ) RegisterHam ( Ham_Spawn , "player" , "PUG_MoneyTeam" , 1 ); } public PUG_MoneyTeam ( id ) { if(! is_user_connected ( id )) return; new szTeam [ 13 ]; get_user_team ( id , szTeam , charsmax ( szTeam )); new iPlayers [ 32 ], iNum , iPlayer ; get_players ( iPlayers , iNum , "aeh" , szTeam ); new szName [ 32 ], szHud [ 512 ], iMoney ; for(new i ; i < iNum ; i ++) { iPlayer = iPlayers [ i ]; iMoney = cs_get_user_money ( iPlayer ); get_user_name ( iPlayer , szName , charsmax ( szName )); format ( szHud , charsmax ( szHud ), "%s%s $ %d^n" , szHud , szName , iMoney ); } set_hudmessage ( 0 , 255 , 0 , 0.58 , 0.02 , 0 , 0.0 , 6.0 , 0.0 , 0.0 , 1 ); show_hudmessage ( id ,( szTeam [ 0 ] == 'C' ) ? "Contra-Terroristas:" : "Terroristas:" ); set_hudmessage ( 255 , 255 , 225 , 0.58 , 0.05 , 0 , 0.0 , 6.0 , 0.0 , 0.0 , 2 ); show_hudmessage ( id , szHud ); set_task ( 2.0 , "PUG_MoneyTeam" , 0 ); }
Revisa.
Mensajes: 72
Temas: 33
Registro en: Apr 2015
Reputación:
0
(22/12/2016, 07:52 PM) PredatorFlys escribió: Código PHP:
/* Plugin generated by AMXX-Studio */ /* Plugin generated by AMXX-Studio */ #include <amxmodx> #include <amxmisc> #include <cstrike> #include <hamsandwich> #define PLUGIN "New Plug-In" #define VERSION "1.0" #define AUTHOR "author" public plugin_init () { register_plugin ( PLUGIN , VERSION , AUTHOR ) RegisterHam ( Ham_Spawn , "player" , "PUG_MoneyTeam" , 1 ); } public PUG_MoneyTeam ( id ) { if(! is_user_connected ( id )) return; new szTeam [ 13 ]; get_user_team ( id , szTeam , charsmax ( szTeam )); new iPlayers [ 32 ], iNum , iPlayer ; get_players ( iPlayers , iNum , "aeh" , szTeam ); new szName [ 32 ], szHud [ 512 ], iMoney ; for(new i ; i < iNum ; i ++) { iPlayer = iPlayers [ i ]; iMoney = cs_get_user_money ( iPlayer ); get_user_name ( iPlayer , szName , charsmax ( szName )); format ( szHud , charsmax ( szHud ), "%s%s $ %d^n" , szHud , szName , iMoney ); } set_hudmessage ( 0 , 255 , 0 , 0.58 , 0.02 , 0 , 0.0 , 6.0 , 0.0 , 0.0 , 1 ); show_hudmessage ( id ,( szTeam [ 0 ] == 'C' ) ? "Contra-Terroristas:" : "Terroristas:" ); set_hudmessage ( 255 , 255 , 225 , 0.58 , 0.05 , 0 , 0.0 , 6.0 , 0.0 , 0.0 , 2 ); show_hudmessage ( id , szHud ); set_task ( 2.0 , "PUG_MoneyTeam" , 0 ); }
Revisa.
Sigue igual
Aqui si hace lo que quiero pero no se como hacer para que desaparesca luego q termine el freezetime
Codigo:
Código PHP:
#include <amxmodx> #include <amxmisc> #include <cstrike> #include <hamsandwich> public plugin_init () { register_plugin ( "HOLA" , "HOLA" , "HOLA" ) RegisterHam ( Ham_Spawn , "player" , "PUG_SpawnPost" , 1 ); } public PUG_SpawnPost ( id ) { set_task ( 0.1 , "PUG_MoneyTeam" , id , _ , _ , "b" ); } public PUG_MoneyTeam ( id ) { new szTeam [ 13 ]; get_user_team ( id , szTeam , charsmax ( szTeam )); new iPlayers [ 32 ], iNum , iPlayer ; get_players ( iPlayers , iNum , "aeh" , szTeam ); new szName [ 32 ], szHud [ 512 ], iMoney ; for(new i ; i < iNum ; i ++) { iPlayer = iPlayers [ i ]; iMoney = cs_get_user_money ( iPlayer ); get_user_name ( iPlayer , szName , charsmax ( szName )); format ( szHud , charsmax ( szHud ), "%s%s $ %d^n" , szHud , szName , iMoney ); } set_hudmessage ( 0 , 255 , 0 , 0.58 , 0.02 , 0 , 0.0 , 16.0 , 0.0 , 0.0 , 1 ); show_hudmessage ( id ,( szTeam [ 0 ] == 'C' ) ? "Anti-Terroristas:" : "Terroristas:" ); set_hudmessage ( 255 , 255 , 225 , 0.58 , 0.05 , 0 , 0.0 , 16.0 , 0.0 , 0.0 , 2 ); show_hudmessage ( id , szHud ); }
Mensajes: 818
Temas: 71
Registro en: Sep 2014
Reputación:
12
22/12/2016, 08:54 PM
(Última modificación: 22/12/2016, 08:54 PM por PredatorFlys .)
Código PHP:
#include <amxmodx> #include <amxmisc> #include <cstrike> #define PLUGIN "TeamMoney" #define VERSION "3.4" #define AUTHOR "Bachi" new cvar_enable ; public plugin_init () { register_plugin ( PLUGIN , VERSION , AUTHOR ); register_event ( "ResetHUD" , "nRonda" , "b" ) ; cvar_enable = register_cvar ( "show_teammoney" , "1" ); } public plugin_cfg () { if( is_plugin_loaded ( "Pause Plugins" ) != - 1 ) { server_cmd ( "amx_pausecfg add ^" TeamMoney ^ "" ) } } public nRonda ( id ) { if( get_pcvar_num ( cvar_enable ) == 0 ) return PLUGIN_CONTINUE ; show_money ( id , cs_get_user_team ( id )); return PLUGIN_CONTINUE ; } public show_money ( id , CsTeams : iTeam ) { new iplayers [ 32 ], pnum , players ; new money , name [ 32 ]; new hud [ 512 ]; get_players ( iplayers , pnum , "h" ); new Float : freezetime = get_cvar_float ( "mp_freezetime" ) for(new i ; i < pnum ; i ++) { players = iplayers [ i ]; if( iTeam == cs_get_user_team ( players )) { money = cs_get_user_money ( players ); get_user_name ( players , name , charsmax ( name )); formatex ( hud , charsmax ( hud ), "%s%s $ %d^n" , hud , name , money ); } } set_hudmessage ( 0 , 255 , 0 , 0.70 , 0.10 , 0 , _ , freezetime , _ , _ , 1 ) show_hudmessage ( id , "Dinero de mi equipo:^n" ) set_hudmessage ( 255 , 255 , 255 , 0.70 , 0.13 , 0 , _ , freezetime , _ , _ , 2 ) show_hudmessage ( id , hud ) set_task ( 2.0 , "show_money" , 0 ); }
ese a ver.
Mensajes: 876
Temas: 74
Registro en: Sep 2015
Reputación:
11
Código PHP:
///////////////////////////////////////////// #define VERSION "1.3.35" ///////////////////////////////////////////// #include < amxmodx > #include < cstrike > #include < hamsandwich > ///////////////////////////////////////////// enum _ : PLUGIN_DATA { PLUGIN [ 30 ], AUTOR [ 20 ], PREFIJO_CHAT [ 15 ] } ///////////////////////////////////////////// new const g_Informacion_Plugin [ _ : PLUGIN_DATA ] = { { "Show Team Money" }, { "K.K.Lv" }, { "!g[ AMXX ]!y" } } const TASK_HUD = 1337 ; ///////////////////////////////////////////// new g_MaxPlayers , g_iSyncHud , bool : g_HudDinero [ 33 ]; ///////////////////////////////////////////// public plugin_init ( ) { register_plugin ( g_Informacion_Plugin [ PLUGIN ], VERSION , g_Informacion_Plugin [ AUTOR ] ) register_clcmd ( "say /dinero" , "Cmd_HudDinero" ); register_logevent ( "Evento_Comienzo_Ronda" , 2 , "1=Round_Start" ) RegisterHam ( Ham_Spawn , "player" , "HAM_Spawn" , 1 ) g_MaxPlayers = get_maxplayers ( ) g_iSyncHud = CreateHudSyncObj ( ) } public client_putinserver ( id ) g_HudDinero [ id ] = true ; public client_disconnect ( id ) remove_task ( id + TASK_HUD ) ///////////////////////////////////////////// public Evento_Comienzo_Ronda ( ) { for( new i = 1 ; i <= g_MaxPlayers ; i ++ ) { if( is_user_connected ( i ) ) remove_task ( i + TASK_HUD ) } } public HAM_Spawn ( id ) { if( task_exists ( id ) ) remove_task ( id + TASK_HUD ) if( is_user_alive ( id ) ) set_task ( 1.0 , "HUD_Dinero" , id + TASK_HUD , . flags = "b" ) } public Cmd_HudDinero ( id ) { if( g_HudDinero [ id ] ) g_HudDinero [ id ] = false ; else g_HudDinero [ id ] = true ; Print_Color ( id , "%s Has %sactivado el !gHUD!y del dinero de tu !tequipo!y!" , g_Informacion_Plugin [ PREFIJO_CHAT ], g_HudDinero [ id ] ? "" : "des" ); return PLUGIN_HANDLED ; } public HUD_Dinero ( id ) { id -= TASK_HUD if( ! g_HudDinero [ id ] ) return; static szMensaje [ 1024 ], szNombre [ 32 ]; new iDinero , i , iLen ; iLen = format ( szMensaje , charsmax ( szMensaje ), "Dinero de tus compañeros:^n^n" ); for( i = 1 ; i <= g_MaxPlayers ; i ++ ) { if( is_user_connected ( i ) && cs_get_user_team ( i ) == cs_get_user_team ( id ) ) { iDinero = cs_get_user_money ( i ); get_user_name ( i , szNombre , charsmax ( szNombre ) ); iLen += format ( szMensaje [ iLen ], charsmax ( szMensaje ) - iLen , "- %s: $%d^n" , szNombre , iDinero ); } } iLen += format ( szMensaje [ iLen ], charsmax ( szMensaje ) - iLen , "^n^n[!] Tipea /dinero para desactivar esto!" ); set_hudmessage ( 0 , 100 , 255 , 0.05 , 0.35 , 0 , 0.02 , 1.0 , 0.1 , 0.2 , 2 ); ShowSyncHudMsg ( id , g_iSyncHud , szMensaje ); } ///////////////////////////////////////////// stock Print_Color ( id , const input [ ], any :... ) { static szMsg [ 191 ], msgSayText ; if ( ! msgSayText ) msgSayText = get_user_msgid ( "SayText" ); vformat ( szMsg , 190 , input , 3 ); replace_all ( szMsg , 190 , "!g" , "^4" ); replace_all ( szMsg , 190 , "!y" , "^1" ); replace_all ( szMsg , 190 , "!t" , "^3" ); message_begin ( id ? MSG_ONE_UNRELIABLE : MSG_BROADCAST , msgSayText , . player = id ); write_byte ( id ? id : 33 ); write_string ( szMsg ); message_end ( ); }
Ahi lo hice como queres. Lo probé y todo e.e
Mensajes: 818
Temas: 71
Registro en: Sep 2014
Reputación:
12
22/12/2016, 10:47 PM
(Última modificación: 22/12/2016, 10:50 PM por PredatorFlys .)
también edite este y lo comprobé, no se que tan optimo este, pero sirve.
Código PHP:
/* Plugin generated by AMXX-Studio */ #include <amxmodx> #include <amxmisc> #include <cstrike> #include <hamsandwich> #define PLUGIN "Dinero del Equipo" #define VERSION "1.0" #define AUTHOR "AMX" new limite ; public plugin_init () { register_plugin ( PLUGIN , VERSION , AUTHOR ) RegisterHam ( Ham_Spawn , "player" , "Freezetime" , 1 ); register_logevent ( "Evento_Comienzo_Ronda" , 2 , "1=Round_Start" ); } public Freezetime ( id ) { if(! is_user_connected ( id )) return; limite = true ; PUG_MoneyTeam ( id ); } public PUG_MoneyTeam ( id ) { if(! limite ) return; new szTeam [ 13 ]; get_user_team ( id , szTeam , charsmax ( szTeam )); new iPlayers [ 32 ], iNum , iPlayer ; get_players ( iPlayers , iNum , "aeh" , szTeam ); new szName [ 32 ], szHud [ 512 ], iMoney ; for(new i ; i < iNum ; i ++) { iPlayer = iPlayers [ i ]; iMoney = cs_get_user_money ( iPlayer ); get_user_name ( iPlayer , szName , charsmax ( szName )); format ( szHud , charsmax ( szHud ), "%s%s $ %d^n" , szHud , szName , iMoney ); } set_hudmessage ( 0 , 255 , 0 , 0.70 , 0.10 , 0 , _ , 1.0 , _ , _ , 1 ) show_hudmessage ( id ,( szTeam [ 0 ] == 'C' ) ? "Contra-Terroristas:" : "Terroristas:" ); set_hudmessage ( 255 , 255 , 255 , 0.70 , 0.13 , 0 , _ , 1.0 , _ , _ , 2 ) show_hudmessage ( id , szHud ); set_task ( 0.9 , "PUG_MoneyTeam" , iPlayer ); } public Evento_Comienzo_Ronda ( id ) { if( limite ) limite = false ; return PLUGIN_HANDLED ; }
Mensajes: 72
Temas: 33
Registro en: Apr 2015
Reputación:
0
22/12/2016, 11:39 PM
(Última modificación: 22/12/2016, 11:42 PM por jul .)
(22/12/2016, 10:47 PM) PredatorFlys escribió: también edite este y lo comprobé, no se que tan optimo este, pero sirve.
Código PHP:
/* Plugin generated by AMXX-Studio */ #include <amxmodx> #include <amxmisc> #include <cstrike> #include <hamsandwich> #define PLUGIN "Dinero del Equipo" #define VERSION "1.0" #define AUTHOR "AMX" new limite ; public plugin_init () { register_plugin ( PLUGIN , VERSION , AUTHOR ) RegisterHam ( Ham_Spawn , "player" , "Freezetime" , 1 ); register_logevent ( "Evento_Comienzo_Ronda" , 2 , "1=Round_Start" ); } public Freezetime ( id ) { if(! is_user_connected ( id )) return; limite = true ; PUG_MoneyTeam ( id ); } public PUG_MoneyTeam ( id ) { if(! limite ) return; new szTeam [ 13 ]; get_user_team ( id , szTeam , charsmax ( szTeam )); new iPlayers [ 32 ], iNum , iPlayer ; get_players ( iPlayers , iNum , "aeh" , szTeam ); new szName [ 32 ], szHud [ 512 ], iMoney ; for(new i ; i < iNum ; i ++) { iPlayer = iPlayers [ i ]; iMoney = cs_get_user_money ( iPlayer ); get_user_name ( iPlayer , szName , charsmax ( szName )); format ( szHud , charsmax ( szHud ), "%s%s $ %d^n" , szHud , szName , iMoney ); } set_hudmessage ( 0 , 255 , 0 , 0.70 , 0.10 , 0 , _ , 1.0 , _ , _ , 1 ) show_hudmessage ( id ,( szTeam [ 0 ] == 'C' ) ? "Contra-Terroristas:" : "Terroristas:" ); set_hudmessage ( 255 , 255 , 255 , 0.70 , 0.13 , 0 , _ , 1.0 , _ , _ , 2 ) show_hudmessage ( id , szHud ); set_task ( 0.9 , "PUG_MoneyTeam" , iPlayer ); } public Evento_Comienzo_Ronda ( id ) { if( limite ) limite = false ; return PLUGIN_HANDLED ; }
Este si es lo que buscaba le cambie unas cosas porq daba error asi quedo
Codigo:
Código PHP:
/* Plugin generated by AMXX-Studio */ #include <amxmodx> #include <amxmisc> #include <cstrike> #include <hamsandwich> #define PLUGIN "Dinero del Equipo" #define VERSION "1.0" #define AUTHOR "AMX" new limite ; public plugin_init () { register_plugin ( PLUGIN , VERSION , AUTHOR ) RegisterHam ( Ham_Spawn , "player" , "Freezetime" , 1 ); register_logevent ( "Evento_Comienzo_Ronda" , 2 , "1=Round_Start" ); } public Freezetime ( id ) { if(! is_user_connected ( id )) return; limite = true ; set_task ( 0.1 , "PUG_MoneyTeam" , id , . flags = "b" ); } public PUG_MoneyTeam ( id ) { if(! limite ) return; new szTeam [ 13 ]; get_user_team ( id , szTeam , charsmax ( szTeam )); new iPlayers [ 32 ], iNum , iPlayer ; get_players ( iPlayers , iNum , "aeh" , szTeam ); new szName [ 32 ], szHud [ 512 ], iMoney ; for(new i ; i < iNum ; i ++) { iPlayer = iPlayers [ i ]; iMoney = cs_get_user_money ( iPlayer ); get_user_name ( iPlayer , szName , charsmax ( szName )); format ( szHud , charsmax ( szHud ), "%s%s $ %d^n" , szHud , szName , iMoney ); } set_hudmessage ( 0 , 255 , 0 , 0.58 , 0.02 , 0 , 0.0 , 0.5 , 0.0 , 0.0 , 1 ); show_hudmessage ( id ,( szTeam [ 0 ] == 'C' ) ? "Anti-Terroristas:" : "Terroristas:" ); set_hudmessage ( 255 , 255 , 225 , 0.58 , 0.05 , 0 , 0.0 , 0.5 , 0.0 , 0.0 , 2 ); show_hudmessage ( id , szHud ); } public Evento_Comienzo_Ronda ( id ) { if( limite ) limite = false ; return PLUGIN_HANDLED ; }
Mensajes: 818
Temas: 71
Registro en: Sep 2014
Reputación:
12
23/12/2016, 12:12 AM
(Última modificación: 23/12/2016, 05:24 PM por PredatorFlys .)
no pensé en hacer un bucle en el task, poco manejo esa área, pero si funciona bien
EDIT: Tenia un bug, cuando alguien mas entraba luego del freezetime.
Código PHP:
#include <amxmodx> #include <amxmisc> #include <cstrike> #include <hamsandwich> #define PLUGIN "Dinero del Equipo" #define VERSION "1.0" #define AUTHOR "AMX" new limite ; public plugin_init () { register_plugin ( PLUGIN , VERSION , AUTHOR ) RegisterHam ( Ham_Spawn , "player" , "Freezetime" , 1 ); register_event ( "HLTV" , "event_new_round" , "a" , "1=0" , "2=0" ); register_logevent ( "Evento_Comienzo_Ronda" , 2 , "1=Round_Start" ); } public Freezetime ( id ) { if(! is_user_connected ( id )) return; set_task ( 0.2 , "PUG_MoneyTeam" , id , . flags = "b" ); } public event_new_round () { limite = true ; } public PUG_MoneyTeam ( id ) { if(! limite ) return; new szTeam [ 13 ]; get_user_team ( id , szTeam , charsmax ( szTeam )); new iPlayers [ 32 ], iNum , iPlayer ; get_players ( iPlayers , iNum , "aeh" , szTeam ); new szName [ 32 ], szHud [ 512 ], iMoney ; for(new i ; i < iNum ; i ++) { iPlayer = iPlayers [ i ]; iMoney = cs_get_user_money ( iPlayer ); get_user_name ( iPlayer , szName , charsmax ( szName )); format ( szHud , charsmax ( szHud ), "%s%s $ %d^n" , szHud , szName , iMoney ); } set_hudmessage ( 0 , 255 , 0 , 0.58 , 0.02 , 0 , 0.0 , 0.5 , 0.0 , 0.0 , 1 ); show_hudmessage ( id ,( szTeam [ 0 ] == 'C' ) ? "Contra-Terroristas:" : "Terroristas:" ); set_hudmessage ( 255 , 255 , 225 , 0.58 , 0.05 , 0 , 0.0 , 0.5 , 0.0 , 0.0 , 2 ); show_hudmessage ( id , szHud ); } public Evento_Comienzo_Ronda ( id ) { if( limite ) limite = false ; return PLUGIN_HANDLED ; }
Mensajes: 33
Temas: 15
Registro en: Oct 2016
Reputación:
0
Hola, ¿Es posible que cuando el player escriba diga cuando dinero tiene? Ejemplo : say_team "Juancito($16000): que onda?" pero con el include colorchat? Saludos y gracias!
Mensajes: 818
Temas: 71
Registro en: Sep 2014
Reputación:
12
es posible hay que hockear el say, y la verdad me parece innecesario hacer algo así para algo tan simple.
Mensajes: 876
Temas: 74
Registro en: Sep 2015
Reputación:
11
(23/12/2016, 11:45 AM) Dean2326 escribió: Hola, ¿Es posible que cuando el player escriba diga cuando dinero tiene? Ejemplo : say_team "Juancito($16000): que onda?" pero con el include colorchat? Saludos y gracias!
Código PHP:
///////////////////////////////////////////// #define VERSION "1.3.60" ///////////////////////////////////////////// #include < amxmodx > #include < cstrike > #include < hamsandwich > ///////////////////////////////////////////// enum _ : PLUGIN_DATA { PLUGIN [ 30 ], AUTOR [ 30 ], PREFIJO_CHAT [ 15 ] } ///////////////////////////////////////////// new const g_Informacion_Plugin [ _ : PLUGIN_DATA ] = { { "Show Team Money" }, { "K.K.Lv - Web C. Edit" }, { "!g[ AMXX ]!y" } } const TASK_HUD = 1337 ; ///////////////////////////////////////////// new g_MaxPlayers , g_iSyncHud , bool : g_HudDinero [ 33 ], bool : g_Hud_Permitido ; new g_MsgSayText , g_MsgTeamInfo ; ///////////////////////////////////////////// public plugin_init ( ) { register_plugin ( g_Informacion_Plugin [ PLUGIN ], VERSION , g_Informacion_Plugin [ AUTOR ] ) register_clcmd ( "say_team" , "Cmd_Say_Team" ); register_clcmd ( "say /off" , "Cmd_HudDinero" ); register_event ( "HLTV" , "Evento_Tiempo_Preparacion" , "a" , "1=0" , "2=0" ) register_logevent ( "Evento_Comienzo_Ronda" , 2 , "1=Round_Start" ) RegisterHam ( Ham_Spawn , "player" , "HAM_Spawn" , 1 ) g_MsgSayText = get_user_msgid ( "SayText" ); g_MsgTeamInfo = get_user_msgid ( "TeamInfo" ); g_MaxPlayers = get_maxplayers ( ) g_iSyncHud = CreateHudSyncObj ( ) } public client_putinserver ( id ) g_HudDinero [ id ] = true ; public client_disconnect ( id ) remove_task ( id + TASK_HUD ) ///////////////////////////////////////////// public Evento_Tiempo_Preparacion ( ) g_Hud_Permitido = true ; public Evento_Comienzo_Ronda ( ) { for( new i = 1 ; i <= g_MaxPlayers ; i ++ ) { if( is_user_connected ( i ) ) remove_task ( i + TASK_HUD ) } g_Hud_Permitido = false ; } public HAM_Spawn ( id ) { remove_task ( id + TASK_HUD ) if( ! is_user_alive ( id ) ) return; if( g_Hud_Permitido ) set_task ( 1.0 , "HUD_Dinero" , id + TASK_HUD , . flags = "b" ) } public Cmd_HudDinero ( id ) { if( g_HudDinero [ id ] ) g_HudDinero [ id ] = false ; else g_HudDinero [ id ] = true ; Print_Color ( id , "%s Has %sactivado el !gHUD!y del dinero de tu !tequipo!y!" , g_Informacion_Plugin [ PREFIJO_CHAT ], g_HudDinero [ id ] ? "" : "des" ); return PLUGIN_HANDLED ; } public HUD_Dinero ( id ) { id -= TASK_HUD if( ! g_HudDinero [ id ] ) return; static szMensaje [ 1024 ], szNombre [ 32 ]; new iDinero , i , iLen ; iLen = format ( szMensaje , charsmax ( szMensaje ), "Dinero de tus compañeros:^n^n" ); for( i = 1 ; i <= g_MaxPlayers ; i ++ ) { if( is_user_connected ( i ) && cs_get_user_team ( i ) == cs_get_user_team ( id ) ) { iDinero = cs_get_user_money ( i ); get_user_name ( i , szNombre , charsmax ( szNombre ) ); iLen += format ( szMensaje [ iLen ], charsmax ( szMensaje ) - iLen , "- %s: $%d^n" , szNombre , iDinero ); } } iLen += format ( szMensaje [ iLen ], charsmax ( szMensaje ) - iLen , "^n^n[!] Tipea /off para desactivar esto!" ); set_hudmessage ( 0 , 100 , 255 , 0.05 , 0.35 , 0 , 0.02 , 1.0 , 0.1 , 0.2 , 2 ); ShowSyncHudMsg ( id , g_iSyncHud , szMensaje ); } public Cmd_Say_Team ( id ) { static szTexto [ 191 ] read_args ( szTexto , charsmax ( szTexto ) ) remove_quotes ( szTexto ) if( containi ( szTexto , "%" ) != - 1 || containi ( szTexto , "#" ) != - 1 ) return PLUGIN_HANDLED ; if( ! Mensaje_Valido ( szTexto , 1 ) ) return PLUGIN_CONTINUE ; static iEquipoJugador , szNombreEquipo [ 25 ] iEquipoJugador = get_user_team ( id ) switch( iEquipoJugador ) { case 1 : copy ( szNombreEquipo , 10 , "Terrorista" ) case 2 : copy ( szNombreEquipo , 15 , "Anti-Terrorista" ) default: copy ( szNombreEquipo , 10 , "Espectador" ) } static iColor [ 11 ], szPrefijo [ 111 ] get_user_team ( id , iColor , charsmax ( iColor ) ) static szNombre [ 32 ]; get_user_name ( id , szNombre , charsmax ( szNombre ) ); formatex ( szPrefijo , charsmax ( szPrefijo ), "%s^x04[ ^x01%s ^x04]^x01 - ^x03%s ^x04($%d)" , is_user_alive ( id ) ? "^x01" : "^x01* MUERTO * - " , szNombreEquipo , szNombre , cs_get_user_money ( id ) ) format ( szTexto , charsmax ( szTexto ), "%s^x01 : %s" , szPrefijo , szTexto ) static i , iEquipo [ 11 ] for( i = 1 ; i <= g_MaxPlayers ; i ++ ) { if( ! is_user_connected ( i ) ) continue; if( get_user_team ( i ) == iEquipoJugador ) { if( is_user_alive ( id ) && is_user_alive ( i ) || ! is_user_alive ( id ) && ! is_user_alive ( i ) ) { get_user_team ( i , iEquipo , charsmax ( iEquipo ) ) Cambiar_Informacion_Equipo ( i , iColor ) Escribir_Mensaje ( i , szTexto ) Cambiar_Informacion_Equipo ( i , iEquipo ) } } } return PLUGIN_HANDLED_MAIN ; } public Cambiar_Informacion_Equipo ( id , szEquipo [ ] ) { message_begin ( MSG_ONE , g_MsgTeamInfo , _ , id ) write_byte ( id ) write_string ( szEquipo ) message_end ( ) } public Escribir_Mensaje ( id , szMensaje [ ] ) { if( ! is_user_connected ( id ) ) return; message_begin ( MSG_ONE , g_MsgSayText , { 0 , 0 , 0 }, id ) write_byte ( id ) write_string ( szMensaje ) message_end ( ) } ///////////////////////////////////////////// stock Mensaje_Valido ( szTexto [ ], iMaxCount ) { static iLen , i , iCount iLen = strlen ( szTexto ) iCount = 0 if( ! iLen ) return false ; for( i = 0 ; i < iLen ; i ++ ) { if( szTexto [ i ] != ' ' ) { iCount ++ if( iCount >= iMaxCount ) return true ; } } return false ; } stock Print_Color ( id , const input [ ], any :... ) { static szMsg [ 191 ], msgSayText ; if ( ! msgSayText ) msgSayText = get_user_msgid ( "SayText" ); vformat ( szMsg , 190 , input , 3 ); replace_all ( szMsg , 190 , "!g" , "^4" ); replace_all ( szMsg , 190 , "!y" , "^1" ); replace_all ( szMsg , 190 , "!t" , "^3" ); message_begin ( id ? MSG_ONE_UNRELIABLE : MSG_BROADCAST , msgSayText , . player = id ); write_byte ( id ? id : 33 ); write_string ( szMsg ); message_end ( ); }
Mensajes: 59
Temas: 15
Registro en: Dec 2016
Reputación:
1
A alguien tambien se le cayo el steam, o no les entra a la cuenta?
Solo soy un chico normal, comun y corriente
Mensajes: 72
Temas: 33
Registro en: Apr 2015
Reputación:
0
(23/12/2016, 12:12 AM) PredatorFlys escribió: no pensé en hacer un bucle en el task, poco manejo esa área, pero si funciona bien
EDIT: Tenia un bug, cuando alguien mas entraba luego del freezetime.
Código PHP:
#include <amxmodx> #include <amxmisc> #include <cstrike> #include <hamsandwich> #define PLUGIN "Dinero del Equipo" #define VERSION "1.0" #define AUTHOR "AMX" new limite ; public plugin_init () { register_plugin ( PLUGIN , VERSION , AUTHOR ) RegisterHam ( Ham_Spawn , "player" , "Freezetime" , 1 ); register_event ( "HLTV" , "event_new_round" , "a" , "1=0" , "2=0" ); register_logevent ( "Evento_Comienzo_Ronda" , 2 , "1=Round_Start" ); } public Freezetime ( id ) { if(! is_user_connected ( id )) return; set_task ( 0.2 , "PUG_MoneyTeam" , id , . flags = "b" ); } public event_new_round () { limite = true ; } public PUG_MoneyTeam ( id ) { if(! limite ) return; new szTeam [ 13 ]; get_user_team ( id , szTeam , charsmax ( szTeam )); new iPlayers [ 32 ], iNum , iPlayer ; get_players ( iPlayers , iNum , "aeh" , szTeam ); new szName [ 32 ], szHud [ 512 ], iMoney ; for(new i ; i < iNum ; i ++) { iPlayer = iPlayers [ i ]; iMoney = cs_get_user_money ( iPlayer ); get_user_name ( iPlayer , szName , charsmax ( szName )); format ( szHud , charsmax ( szHud ), "%s%s $ %d^n" , szHud , szName , iMoney ); } set_hudmessage ( 0 , 255 , 0 , 0.58 , 0.02 , 0 , 0.0 , 0.5 , 0.0 , 0.0 , 1 ); show_hudmessage ( id ,( szTeam [ 0 ] == 'C' ) ? "Contra-Terroristas:" : "Terroristas:" ); set_hudmessage ( 255 , 255 , 225 , 0.58 , 0.05 , 0 , 0.0 , 0.5 , 0.0 , 0.0 , 2 ); show_hudmessage ( id , szHud ); } public Evento_Comienzo_Ronda ( id ) { if( limite ) limite = false ; return PLUGIN_HANDLED ; }
Que hacia el bug
Mensajes: 818
Temas: 71
Registro en: Sep 2014
Reputación:
12
23/12/2016, 06:16 PM
(Última modificación: 23/12/2016, 06:19 PM por PredatorFlys .)
si alguien entraba luego del freezetime (o mejor dicho cuando respameaba) llamaba nuevamente a la función y reaparecía el HUD, ya lo probé en cbp pug y van finos.
Mensajes: 72
Temas: 33
Registro en: Apr 2015
Reputación:
0
23/12/2016, 06:22 PM
(Última modificación: 23/12/2016, 07:12 PM por jul .)
(23/12/2016, 06:16 PM) PredatorFlys escribió: si alguien entraba luego del freezetime (o mejor dicho cuando respameaba) llamaba nuevamente a la función y reaparecía el HUD, ya lo probé en cbp pug y van finos.
Ahh ok ami me seguia reapareciendo pero fue porq puse un hice una locura pero ya va fino
Mensajes: 141
Temas: 21
Registro en: Jan 2016
Reputación:
7
(23/12/2016, 03:14 PM) Web Controller escribió: (23/12/2016, 11:45 AM) Dean2326 escribió: Hola, ¿Es posible que cuando el player escriba diga cuando dinero tiene? Ejemplo : say_team "Juancito($16000): que onda?" pero con el include colorchat? Saludos y gracias!
Código PHP:
///////////////////////////////////////////// #define VERSION "1.3.60" ///////////////////////////////////////////// #include < amxmodx > #include < cstrike > #include < hamsandwich > ///////////////////////////////////////////// enum _ : PLUGIN_DATA { PLUGIN [ 30 ], AUTOR [ 30 ], PREFIJO_CHAT [ 15 ] } ///////////////////////////////////////////// new const g_Informacion_Plugin [ _ : PLUGIN_DATA ] = { { "Show Team Money" }, { "K.K.Lv - Web C. Edit" }, { "!g[ AMXX ]!y" } } const TASK_HUD = 1337 ; ///////////////////////////////////////////// new g_MaxPlayers , g_iSyncHud , bool : g_HudDinero [ 33 ], bool : g_Hud_Permitido ; new g_MsgSayText , g_MsgTeamInfo ; ///////////////////////////////////////////// public plugin_init ( ) { register_plugin ( g_Informacion_Plugin [ PLUGIN ], VERSION , g_Informacion_Plugin [ AUTOR ] ) register_clcmd ( "say_team" , "Cmd_Say_Team" ); register_clcmd ( "say /off" , "Cmd_HudDinero" ); register_event ( "HLTV" , "Evento_Tiempo_Preparacion" , "a" , "1=0" , "2=0" ) register_logevent ( "Evento_Comienzo_Ronda" , 2 , "1=Round_Start" ) RegisterHam ( Ham_Spawn , "player" , "HAM_Spawn" , 1 ) g_MsgSayText = get_user_msgid ( "SayText" ); g_MsgTeamInfo = get_user_msgid ( "TeamInfo" ); g_MaxPlayers = get_maxplayers ( ) g_iSyncHud = CreateHudSyncObj ( ) } public client_putinserver ( id ) g_HudDinero [ id ] = true ; public client_disconnect ( id ) remove_task ( id + TASK_HUD ) ///////////////////////////////////////////// public Evento_Tiempo_Preparacion ( ) g_Hud_Permitido = true ; public Evento_Comienzo_Ronda ( ) { for( new i = 1 ; i <= g_MaxPlayers ; i ++ ) { if( is_user_connected ( i ) ) remove_task ( i + TASK_HUD ) } g_Hud_Permitido = false ; } public HAM_Spawn ( id ) { remove_task ( id + TASK_HUD ) if( ! is_user_alive ( id ) ) return; if( g_Hud_Permitido ) set_task ( 1.0 , "HUD_Dinero" , id + TASK_HUD , . flags = "b" ) } public Cmd_HudDinero ( id ) { if( g_HudDinero [ id ] ) g_HudDinero [ id ] = false ; else g_HudDinero [ id ] = true ; Print_Color ( id , "%s Has %sactivado el !gHUD!y del dinero de tu !tequipo!y!" , g_Informacion_Plugin [ PREFIJO_CHAT ], g_HudDinero [ id ] ? "" : "des" ); return PLUGIN_HANDLED ; } public HUD_Dinero ( id ) { id -= TASK_HUD if( ! g_HudDinero [ id ] ) return; static szMensaje [ 1024 ], szNombre [ 32 ]; new iDinero , i , iLen ; iLen = format ( szMensaje , charsmax ( szMensaje ), "Dinero de tus compañeros:^n^n" ); for( i = 1 ; i <= g_MaxPlayers ; i ++ ) { if( is_user_connected ( i ) && cs_get_user_team ( i ) == cs_get_user_team ( id ) ) { iDinero = cs_get_user_money ( i ); get_user_name ( i , szNombre , charsmax ( szNombre ) ); iLen += format ( szMensaje [ iLen ], charsmax ( szMensaje ) - iLen , "- %s: $%d^n" , szNombre , iDinero ); } } iLen += format ( szMensaje [ iLen ], charsmax ( szMensaje ) - iLen , "^n^n[!] Tipea /off para desactivar esto!" ); set_hudmessage ( 0 , 100 , 255 , 0.05 , 0.35 , 0 , 0.02 , 1.0 , 0.1 , 0.2 , 2 ); ShowSyncHudMsg ( id , g_iSyncHud , szMensaje ); } public Cmd_Say_Team ( id ) { static szTexto [ 191 ] read_args ( szTexto , charsmax ( szTexto ) ) remove_quotes ( szTexto ) if( containi ( szTexto , "%" ) != - 1 || containi ( szTexto , "#" ) != - 1 ) return PLUGIN_HANDLED ; if( ! Mensaje_Valido ( szTexto , 1 ) ) return PLUGIN_CONTINUE ; static iEquipoJugador , szNombreEquipo [ 25 ] iEquipoJugador = get_user_team ( id ) switch( iEquipoJugador ) { case 1 : copy ( szNombreEquipo , 10 , "Terrorista" ) case 2 : copy ( szNombreEquipo , 15 , "Anti-Terrorista" ) default: copy ( szNombreEquipo , 10 , "Espectador" ) } static iColor [ 11 ], szPrefijo [ 111 ] get_user_team ( id , iColor , charsmax ( iColor ) ) static szNombre [ 32 ]; get_user_name ( id , szNombre , charsmax ( szNombre ) ); formatex ( szPrefijo , charsmax ( szPrefijo ), "%s^x04[ ^x01%s ^x04]^x01 - ^x03%s ^x04($%d)" , is_user_alive ( id ) ? "^x01" : "^x01* MUERTO * - " , szNombreEquipo , szNombre , cs_get_user_money ( id ) ) format ( szTexto , charsmax ( szTexto ), "%s^x01 : %s" , szPrefijo , szTexto ) static i , iEquipo [ 11 ] for( i = 1 ; i <= g_MaxPlayers ; i ++ ) { if( ! is_user_connected ( i ) ) continue; if( get_user_team ( i ) == iEquipoJugador ) { if( is_user_alive ( id ) && is_user_alive ( i ) || ! is_user_alive ( id ) && ! is_user_alive ( i ) ) { get_user_team ( i , iEquipo , charsmax ( iEquipo ) ) Cambiar_Informacion_Equipo ( i , iColor ) Escribir_Mensaje ( i , szTexto ) Cambiar_Informacion_Equipo ( i , iEquipo ) } } } return PLUGIN_HANDLED_MAIN ; } public Cambiar_Informacion_Equipo ( id , szEquipo [ ] ) { message_begin ( MSG_ONE , g_MsgTeamInfo , _ , id ) write_byte ( id ) write_string ( szEquipo ) message_end ( ) } public Escribir_Mensaje ( id , szMensaje [ ] ) { if( ! is_user_connected ( id ) ) return; message_begin ( MSG_ONE , g_MsgSayText , { 0 , 0 , 0 }, id ) write_byte ( id ) write_string ( szMensaje ) message_end ( ) } ///////////////////////////////////////////// stock Mensaje_Valido ( szTexto [ ], iMaxCount ) { static iLen , i , iCount iLen = strlen ( szTexto ) iCount = 0 if( ! iLen ) return false ; for( i = 0 ; i < iLen ; i ++ ) { if( szTexto [ i ] != ' ' ) { iCount ++ if( iCount >= iMaxCount ) return true ; } } return false ; } stock Print_Color ( id , const input [ ], any :... ) { static szMsg [ 191 ], msgSayText ; if ( ! msgSayText ) msgSayText = get_user_msgid ( "SayText" ); vformat ( szMsg , 190 , input , 3 ); replace_all ( szMsg , 190 , "!g" , "^4" ); replace_all ( szMsg , 190 , "!y" , "^1" ); replace_all ( szMsg , 190 , "!t" , "^3" ); message_begin ( id ? MSG_ONE_UNRELIABLE : MSG_BROADCAST , msgSayText , . player = id ); write_byte ( id ? id : 33 ); write_string ( szMsg ); message_end ( ); }
Al fin encontré uno wuacho (me facilitaste el trabajo en hacer uno)
Me estuve fijando el code y haría un pequeño fix
Código PHP:
public Cmd_HudDinero ( id ) { g_HudDinero [ id ] = !( g_HudDinero [ id ]); Print_Color ( id , "%s Has %sactivado el !gHUD!y del dinero de tu !tequipo!y!" , g_Informacion_Plugin [ PREFIJO_CHAT ], g_HudDinero [ id ] ? "" : "des" ); return PLUGIN_HANDLED ; }
Esto quiere decir que el valor nuevo sera el contrario del actual
EL QUE SABE SABE, EL QUE NO ES JEFE
Mensajes: 876
Temas: 74
Registro en: Sep 2015
Reputación:
11
(05/01/2017, 04:46 AM) Deev escribió: (23/12/2016, 03:14 PM) Web Controller escribió: (23/12/2016, 11:45 AM) Dean2326 escribió: Hola, ¿Es posible que cuando el player escriba diga cuando dinero tiene? Ejemplo : say_team "Juancito($16000): que onda?" pero con el include colorchat? Saludos y gracias!
Código PHP:
///////////////////////////////////////////// #define VERSION "1.3.60" ///////////////////////////////////////////// #include < amxmodx > #include < cstrike > #include < hamsandwich > ///////////////////////////////////////////// enum _ : PLUGIN_DATA { PLUGIN [ 30 ], AUTOR [ 30 ], PREFIJO_CHAT [ 15 ] } ///////////////////////////////////////////// new const g_Informacion_Plugin [ _ : PLUGIN_DATA ] = { { "Show Team Money" }, { "K.K.Lv - Web C. Edit" }, { "!g[ AMXX ]!y" } } const TASK_HUD = 1337 ; ///////////////////////////////////////////// new g_MaxPlayers , g_iSyncHud , bool : g_HudDinero [ 33 ], bool : g_Hud_Permitido ; new g_MsgSayText , g_MsgTeamInfo ; ///////////////////////////////////////////// public plugin_init ( ) { register_plugin ( g_Informacion_Plugin [ PLUGIN ], VERSION , g_Informacion_Plugin [ AUTOR ] ) register_clcmd ( "say_team" , "Cmd_Say_Team" ); register_clcmd ( "say /off" , "Cmd_HudDinero" ); register_event ( "HLTV" , "Evento_Tiempo_Preparacion" , "a" , "1=0" , "2=0" ) register_logevent ( "Evento_Comienzo_Ronda" , 2 , "1=Round_Start" ) RegisterHam ( Ham_Spawn , "player" , "HAM_Spawn" , 1 ) g_MsgSayText = get_user_msgid ( "SayText" ); g_MsgTeamInfo = get_user_msgid ( "TeamInfo" ); g_MaxPlayers = get_maxplayers ( ) g_iSyncHud = CreateHudSyncObj ( ) } public client_putinserver ( id ) g_HudDinero [ id ] = true ; public client_disconnect ( id ) remove_task ( id + TASK_HUD ) ///////////////////////////////////////////// public Evento_Tiempo_Preparacion ( ) g_Hud_Permitido = true ; public Evento_Comienzo_Ronda ( ) { for( new i = 1 ; i <= g_MaxPlayers ; i ++ ) { if( is_user_connected ( i ) ) remove_task ( i + TASK_HUD ) } g_Hud_Permitido = false ; } public HAM_Spawn ( id ) { remove_task ( id + TASK_HUD ) if( ! is_user_alive ( id ) ) return; if( g_Hud_Permitido ) set_task ( 1.0 , "HUD_Dinero" , id + TASK_HUD , . flags = "b" ) } public Cmd_HudDinero ( id ) { if( g_HudDinero [ id ] ) g_HudDinero [ id ] = false ; else g_HudDinero [ id ] = true ; Print_Color ( id , "%s Has %sactivado el !gHUD!y del dinero de tu !tequipo!y!" , g_Informacion_Plugin [ PREFIJO_CHAT ], g_HudDinero [ id ] ? "" : "des" ); return PLUGIN_HANDLED ; } public HUD_Dinero ( id ) { id -= TASK_HUD if( ! g_HudDinero [ id ] ) return; static szMensaje [ 1024 ], szNombre [ 32 ]; new iDinero , i , iLen ; iLen = format ( szMensaje , charsmax ( szMensaje ), "Dinero de tus compañeros:^n^n" ); for( i = 1 ; i <= g_MaxPlayers ; i ++ ) { if( is_user_connected ( i ) && cs_get_user_team ( i ) == cs_get_user_team ( id ) ) { iDinero = cs_get_user_money ( i ); get_user_name ( i , szNombre , charsmax ( szNombre ) ); iLen += format ( szMensaje [ iLen ], charsmax ( szMensaje ) - iLen , "- %s: $%d^n" , szNombre , iDinero ); } } iLen += format ( szMensaje [ iLen ], charsmax ( szMensaje ) - iLen , "^n^n[!] Tipea /off para desactivar esto!" ); set_hudmessage ( 0 , 100 , 255 , 0.05 , 0.35 , 0 , 0.02 , 1.0 , 0.1 , 0.2 , 2 ); ShowSyncHudMsg ( id , g_iSyncHud , szMensaje ); } public Cmd_Say_Team ( id ) { static szTexto [ 191 ] read_args ( szTexto , charsmax ( szTexto ) ) remove_quotes ( szTexto ) if( containi ( szTexto , "%" ) != - 1 || containi ( szTexto , "#" ) != - 1 ) return PLUGIN_HANDLED ; if( ! Mensaje_Valido ( szTexto , 1 ) ) return PLUGIN_CONTINUE ; static iEquipoJugador , szNombreEquipo [ 25 ] iEquipoJugador = get_user_team ( id ) switch( iEquipoJugador ) { case 1 : copy ( szNombreEquipo , 10 , "Terrorista" ) case 2 : copy ( szNombreEquipo , 15 , "Anti-Terrorista" ) default: copy ( szNombreEquipo , 10 , "Espectador" ) } static iColor [ 11 ], szPrefijo [ 111 ] get_user_team ( id , iColor , charsmax ( iColor ) ) static szNombre [ 32 ]; get_user_name ( id , szNombre , charsmax ( szNombre ) ); formatex ( szPrefijo , charsmax ( szPrefijo ), "%s^x04[ ^x01%s ^x04]^x01 - ^x03%s ^x04($%d)" , is_user_alive ( id ) ? "^x01" : "^x01* MUERTO * - " , szNombreEquipo , szNombre , cs_get_user_money ( id ) ) format ( szTexto , charsmax ( szTexto ), "%s^x01 : %s" , szPrefijo , szTexto ) static i , iEquipo [ 11 ] for( i = 1 ; i <= g_MaxPlayers ; i ++ ) { if( ! is_user_connected ( i ) ) continue; if( get_user_team ( i ) == iEquipoJugador ) { if( is_user_alive ( id ) && is_user_alive ( i ) || ! is_user_alive ( id ) && ! is_user_alive ( i ) ) { get_user_team ( i , iEquipo , charsmax ( iEquipo ) ) Cambiar_Informacion_Equipo ( i , iColor ) Escribir_Mensaje ( i , szTexto ) Cambiar_Informacion_Equipo ( i , iEquipo ) } } } return PLUGIN_HANDLED_MAIN ; } public Cambiar_Informacion_Equipo ( id , szEquipo [ ] ) { message_begin ( MSG_ONE , g_MsgTeamInfo , _ , id ) write_byte ( id ) write_string ( szEquipo ) message_end ( ) } public Escribir_Mensaje ( id , szMensaje [ ] ) { if( ! is_user_connected ( id ) ) return; message_begin ( MSG_ONE , g_MsgSayText , { 0 , 0 , 0 }, id ) write_byte ( id ) write_string ( szMensaje ) message_end ( ) } ///////////////////////////////////////////// stock Mensaje_Valido ( szTexto [ ], iMaxCount ) { static iLen , i , iCount iLen = strlen ( szTexto ) iCount = 0 if( ! iLen ) return false ; for( i = 0 ; i < iLen ; i ++ ) { if( szTexto [ i ] != ' ' ) { iCount ++ if( iCount >= iMaxCount ) return true ; } } return false ; } stock Print_Color ( id , const input [ ], any :... ) { static szMsg [ 191 ], msgSayText ; if ( ! msgSayText ) msgSayText = get_user_msgid ( "SayText" ); vformat ( szMsg , 190 , input , 3 ); replace_all ( szMsg , 190 , "!g" , "^4" ); replace_all ( szMsg , 190 , "!y" , "^1" ); replace_all ( szMsg , 190 , "!t" , "^3" ); message_begin ( id ? MSG_ONE_UNRELIABLE : MSG_BROADCAST , msgSayText , . player = id ); write_byte ( id ? id : 33 ); write_string ( szMsg ); message_end ( ); }
Al fin encontré uno wuacho (me facilitaste el trabajo en hacer uno)
Me estuve fijando el code y haría un pequeño fix
Código PHP:
public Cmd_HudDinero ( id ) { g_HudDinero [ id ] = !( g_HudDinero [ id ]); Print_Color ( id , "%s Has %sactivado el !gHUD!y del dinero de tu !tequipo!y!" , g_Informacion_Plugin [ PREFIJO_CHAT ], g_HudDinero [ id ] ? "" : "des" ); return PLUGIN_HANDLED ; }
Esto quiere decir que el valor nuevo sera el contrario del actual
Gracias, genioo
Mensajes: 31
Temas: 6
Registro en: Apr 2020
Reputación:
0
Chicos este plugin genera un bug .
Cuando esta el freezetime, las comunicaciones por voz salen todas cortadas y no se entiende nada. Pero cuando termina el freezetime, se normalizan.
Mensajes: 6
Temas: 2
Registro en: May 2020
Reputación:
0
(05/01/2017, 10:43 AM) Web Controller escribió: Gracias, genioo y Como Hago para descargar este pluguin no se q significa todo eso de CODIGO PHP
Mensajes: 5
Temas: 1
Registro en: Sep 2020
Reputación:
0
(23/12/2016, 12:12 AM) PredatorFlys escribió: no pensé en hacer un bucle en el task, poco manejo esa área, pero si funciona bien
EDIT: Tenia un bug, cuando alguien mas entraba luego del freezetime.
Código PHP:
#include <amxmodx> #include <amxmisc> #include <cstrike> #include <hamsandwich> #define PLUGIN "Dinero del Equipo" #define VERSION "1.0" #define AUTHOR "AMX" new limite ; public plugin_init () { register_plugin ( PLUGIN , VERSION , AUTHOR ) RegisterHam ( Ham_Spawn , "player" , "Freezetime" , 1 ); register_event ( "HLTV" , "event_new_round" , "a" , "1=0" , "2=0" ); register_logevent ( "Evento_Comienzo_Ronda" , 2 , "1=Round_Start" ); } public Freezetime ( id ) { if(! is_user_connected ( id )) return; set_task ( 0.2 , "PUG_MoneyTeam" , id , . flags = "b" ); } public event_new_round () { limite = true ; } public PUG_MoneyTeam ( id ) { if(! limite ) return; new szTeam [ 13 ]; get_user_team ( id , szTeam , charsmax ( szTeam )); new iPlayers [ 32 ], iNum , iPlayer ; get_players ( iPlayers , iNum , "aeh" , szTeam ); new szName [ 32 ], szHud [ 512 ], iMoney ; for(new i ; i < iNum ; i ++) { iPlayer = iPlayers [ i ]; iMoney = cs_get_user_money ( iPlayer ); get_user_name ( iPlayer , szName , charsmax ( szName )); format ( szHud , charsmax ( szHud ), "%s%s $ %d^n" , szHud , szName , iMoney ); } set_hudmessage ( 0 , 255 , 0 , 0.58 , 0.02 , 0 , 0.0 , 0.5 , 0.0 , 0.0 , 1 ); show_hudmessage ( id ,( szTeam [ 0 ] == 'C' ) ? "Contra-Terroristas:" : "Terroristas:" ); set_hudmessage ( 255 , 255 , 225 , 0.58 , 0.05 , 0 , 0.0 , 0.5 , 0.0 , 0.0 , 2 ); show_hudmessage ( id , szHud ); } public Evento_Comienzo_Ronda ( id ) { if( limite ) limite = false ; return PLUGIN_HANDLED ; }
Como puedo hacer que el HUD Del dinero del equipo, salga cuando se comienza el pug como tal, mas no que no salga en las rondas de calentamiento, osea lo qu quiero es que salga en el freezetime de cuando se comienza el pug y mas no salga en las rondas de calentamiento....
Mensajes: 196
Temas: 4
Registro en: Apr 2018
Reputación:
3
if (get_pcvar_num("ACA LA CVAR DEL MIX O PUG"))
Mensajes: 5
Temas: 1
Registro en: Sep 2020
Reputación:
0
(17/10/2020, 11:26 AM) alexiways escribió: if (get_pcvar_num("ACA LA CVAR DEL MIX O PUG"))
Con eso que puedo hacer?, disculpa la pregunta amigo en donde debo colocarlo