As dori ca primul care face frag sa primeasca 2 credite, dar sa se ia in considerare doar primul care face frag, indiferent de echipa.
- First kill | Afiseaza codul
#include < amxmodx > #include < cstrike > #define PLUGIN "FirstKill Bonuses" #define VERSION "1.0" enum { TERRO_KILL, CT_KILL, MAX_KILLS } new g_iFirstKillMoney[ MAX_KILLS ]; new bool:g_bFirstKillWasMade[ MAX_KILLS ]; new SyncHudMessage; new g_iMaxPlayers; public plugin_init( ) { register_plugin( PLUGIN, VERSION, "Askhanar" ); register_event( "HLTV", "ev_NewRound", "a", "1=0", "2=0" ); register_event( "DeathMsg", "ev_DeathMsg", "a" ); // --| Banii primiti pentru fiecare first kill. g_iFirstKillMoney[ TERRO_KILL ] = 2000; // --| FirstKill de la TERO g_iFirstKillMoney[ CT_KILL ] = 2000; // --| FirstKill de la CT g_bFirstKillWasMade[ TERRO_KILL ] = false; g_bFirstKillWasMade[ CT_KILL ] = false; SyncHudMessage = CreateHudSyncObj( ); g_iMaxPlayers = get_maxplayers( ); // Add your code here... } public ev_NewRound( ) { g_bFirstKillWasMade[ TERRO_KILL ] = false; g_bFirstKillWasMade[ CT_KILL ] = false; } public ev_DeathMsg( ) { static iKiller, iVictim; iKiller = read_data( 1 ); iVictim = read_data( 2 ); if( ( 1 <= iKiller <= g_iMaxPlayers ) && iKiller != iVictim ) { if( cs_get_user_team( iKiller ) == CS_TEAM_T && !g_bFirstKillWasMade[ TERRO_KILL ] ) { g_bFirstKillWasMade[ TERRO_KILL ] = true; cs_set_user_money( iKiller, clamp( cs_get_user_money( iKiller ) + g_iFirstKillMoney[ TERRO_KILL ], 0, 16000 ), 1 ); static szKillerName[ 32 ], szVictimName[ 32 ]; get_user_name( iKiller, szKillerName, sizeof ( szKillerName ) -1 ); get_user_name( iVictim, szVictimName, sizeof ( szVictimName ) -1 ); set_hudmessage( 0, 255, 255, -1.0, 0.30, 0, 0.0, 4.5, 0.0, 0.0, -1 ); ShowSyncHudMsg( 0, SyncHudMessage, "[T] %s a facut primul frag pe %s^n si a primit bonus %i$ !", szKillerName, szVictimName, g_iFirstKillMoney[ TERRO_KILL ] ); } else if( cs_get_user_team( iKiller ) == CS_TEAM_CT && !g_bFirstKillWasMade[ CT_KILL ] ) { g_bFirstKillWasMade[ CT_KILL ] = true; cs_set_user_money( iKiller, clamp( cs_get_user_money( iKiller ) + g_iFirstKillMoney[ CT_KILL ], 0, 16000 ), 1 ); static szKillerName[ 32 ], szVictimName[ 32 ]; get_user_name( iKiller, szKillerName, sizeof ( szKillerName ) -1 ); get_user_name( iVictim, szVictimName, sizeof ( szVictimName ) -1 ); set_hudmessage( 0, 255, 255, -1.0, 0.30, 0, 0.0, 4.5, 0.0, 0.0, -1 ); ShowSyncHudMsg( 0, SyncHudMessage, "[CT] %s a facut primul frag pe %s^n si a primit bonus %i$ !", szKillerName, szVictimName, g_iFirstKillMoney[ CT_KILL ] ); } } }
- fcs | Afiseaza codul
#if defined _fcs_included #endinput #endif #define _fcs_included /* * Returns a players credits * * @param client - The player index to get points of * * @return The credits client * */ native fcs_get_user_credits(client); /* * Sets <credits> to client * * @param client - The player index to set points to * @param credits - The amount of credits to set to client * * @return The credits of client * */ native fcs_set_user_credits(client, credits); /* * Adds <credits> points to client * * @param client - The player index to add points to * @param credits - The amount of credits to add to client * * @return The credits of client * */ stock fcs_add_user_credits(client, credits) { return fcs_set_user_credits(client, fcs_get_user_credits(client) + credits); } /* * Subtracts <credits> from client * * @param client - The player index to subtract points from * @param credits - The amount of credits to substract from client * * @return The credits of client * */ stock fcs_sub_user_credits(client, credits) { return fcs_set_user_credits(client, fcs_get_user_credits(client) - credits); }