Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include < amxmodx >
- #include < cstrike >
- #include < fakemeta_util >
- #define HP 50
- #define HP_LIMIT 100
- new bool:oneround[33];
- new const MoneySound[ ] = "killingfloor/MoneyMoneyMoney.wav"
- public plugin_init( )
- {
- register_plugin( "Medic Kit", "1.0", "Akc3n7");
- register_clcmd("say /medic","call_medic");
- register_event("HLTV", "event_new_round", "a", "1=0", "2=0")
- }
- public plugin_precache( )
- engfunc( EngFunc_PrecacheSound, MoneySound );
- public event_new_round(id) {
- if(!oneround[id])
- oneround[id] = false
- }
- public call_medic(id)
- {
- if(!is_user_alive(id))
- return;
- if(oneround[id]) {
- print_color(id, "!v[MEDIC]!e Poti folosi comanda doar o data pe runda!");
- return;
- }
- new cost = cs_get_user_money(id);
- if(cs_get_user_money(id) > 200 )
- {
- cs_set_user_money(id, cs_get_user_money(id) - 200)
- fm_set_user_health(id, clamp((get_user_health(id) + HP), 1, HP_LIMIT));
- client_cmd(id, "spk ^"items/medshot4.wav");
- }
- else {
- new Money = 1000 - cost
- print_color(id, "!v[MEDIC]!e Nu ai suficienti bani, mai ai nevoie de !g%i$", Money);
- client_cmd(id, "spk ^"%s^"", MoneySound);
- }
- }
- stock print_color( const id, const input[ ], any:... )
- {
- new count = 1, players[ 32 ]
- static msg[ 191 ]
- vformat( msg, 190, input, 3 )
- replace_all( msg, 190, "!v", "^4" ) //- verde
- replace_all( msg, 190, "!g", "^1" ) //- galben
- replace_all( msg, 190, "!e", "^3" ) //- echipa
- replace_all( msg, 190, "!n", "^0" ) //- normal
- if( id ) players[ 0 ] = id; else get_players( players, count, "ch" )
- {
- for( new i = 0; i < count; i++ )
- {
- if( is_user_connected( players[ i ] ) )
- {
- message_begin( MSG_ONE_UNRELIABLE, get_user_msgid( "SayText" ), _, players[ i ] )
- write_byte( players[ i ] );
- write_string( msg );
- message_end( );
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement