Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <amxmodx>
- #include <amxmisc>
- #include <cstrike>
- #define TAG "Furien"
- new cvar_money
- public plugin_init()
- {
- register_plugin("T/CT Last Bonus", "1.5", "AMG");
- register_event("DeathMsg", "ev_DeathMsg", "a");
- cvar_money = register_cvar("last_money", "3000")
- }
- #if AMXX_VERSION_NUM >= 183
- public client_disconnected(id) {
- #else
- public client_disconnect(id) {
- #endif
- if(is_user_alive(id))
- set_task(0.5, "ev_DeathMsg");
- }
- public ev_DeathMsg() {
- new Players[32], inum, x;
- get_players(Players, inum, "a");
- if(inum <= 1 || inum >= 3) return;
- new id_last_ct, id_last_t;
- for(new i = 0; i < inum; i++) {
- x = Players[i];
- if(is_user_connected(x) && is_user_alive(x)) {
- if(get_user_team(x) == 1) id_last_t = x;
- else if (get_user_team(x) == 2) id_last_ct = x;
- if(id_last_ct != 0 && id_last_t != 0) break;
- }
- }
- if(id_last_ct != 0 && id_last_t != 0) {
- cs_set_user_money(id_last_ct, cs_get_user_money(id_last_ct) + get_pcvar_num(cvar_money))
- culoare(0, "!g[!t%s!g] !g%s !teste ultimul !gCT !tsi a primit un bonus de !g$%d.", TAG, user_name(id_last_ct) ,get_pcvar_num(cvar_money))
- cs_set_user_money(id_last_t, cs_get_user_money(id_last_t) + get_pcvar_num(cvar_money))
- culoare(0, "!g[!t%s!g] !g%s !teste ultimul !gT !tsi a primit un bonus de !g$%d.", TAG, user_name(id_last_t) ,get_pcvar_num(cvar_money))
- }
- }
- stock user_name(const id) {
- static Name[33];
- get_user_name(id, Name, sizeof(Name)-1);
- return Name;
- }
- stock culoare (const id, const input[], any:...)
- {
- new count = 1, players[ 32 ];
- static msg[ 191 ];
- vformat( msg, 190, input, 3 );
- replace_all( msg, 190, "!g", "^4" );
- replace_all( msg, 190, "!y", "^1" );
- replace_all( msg, 190, "!t2", "^2" );
- replace_all( msg, 190, "!t", "^3" );
- 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( );
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment