Cerere modificare AIO

Categoria cu cereri de pluginuri si nu numai.

Moderators: Moderatori ajutatori, Moderatori

Forum rules
Accesează link-ul pentru a putea vedea regulile forumului

Daca doriti sa vi se modifice un plugin, va rugam postati aici .
Post Reply
User avatar
L E V I N
Scripter eXtreamCS
Scripter eXtreamCS
Posts: 2155
Joined: 24 Aug 2011, 11:24
Detinator Steam: Da
CS Status:
Detinator server CS: ☯∴
SteamID: riseofevo
Reputatie: Scripter eXtreamCS
Nume anterior: Adryyy
Location: ҳ̸Ҳ̸ҳ
Has thanked: 33 times
Been thanked: 349 times
Contact:

18 Aug 2013, 19:32

Am pluginul facut de Askhanar ( A.I.O ) si as dori in asa fel incat:
1. Cand cineva omoara pe altcineva ( kill reward inclus ) sa ii apara un mesaj ( lafel si la faza cand da hs )
2. Sa faci in asa fel incat cand cineva planteaza bomba, o dezamorseaza sau bomba explodeaza sa prieasca x credite :) ( sa aiba si mesaj ) te rog frumos

Uitati .SMA:
| Afiseaza codul
#include < amxmodx >
#include < amxmisc >
#include < cstrike >
#include < fun >
#include < engine >
#include < fakemeta >
#include < nvault >

#pragma semicolon 1

#define PLUGIN "BIG Systems"
#define VERSION "1.0"

#define TASK_pentru 06091993
#define FCS_TEAM_FURIEN CS_TEAM_T
#define FCS_TEAM_ANTIFURIEN CS_TEAM_CT

enum Color
{
	NORMAL = 1,
	GREEN,
	TEAM_COLOR,
	GREY,
	RED,
	BLUE,
};

new TeamName[  ][  ] = 
{
	"",
	"TERRORIST",
	"CT",
	"SPECTATOR"
};

new const g_szTag[ ] = "[iPlayCs System]";
new const g_szGiveCreditsFlag[ ] = "a";

new g_iCvarPTREnable;
new g_iCvarPTRMinutes;
new g_iCvarPTRCredits;

new g_iCvarKREnable;
new g_iCvarKRCredits;
new g_iCvarKRHSCredits;

new g_iCvarTSEnable;
new g_iCvarTSMaxCredits;

new g_iCvarWTREnable;
new g_iCvarWTRFurien;
new g_iCvarWTRAnti;

new g_szName[ 33 ][ 32 ];
new g_iUserCredits[ 33 ];
new g_iUserTime[ 33 ];

new iVault;
new g_iMaxPlayers;

public plugin_init( )
{
	register_plugin( PLUGIN, VERSION, "Askhanar" );

	g_iCvarPTREnable = register_cvar( "fcs_pentru_enable", "1" );
	g_iCvarPTRMinutes = register_cvar( "fcs_pentru_minutes", "7" );
	g_iCvarPTRCredits = register_cvar( "fcs_pentru_credits", "5" );

	g_iCvarKREnable = register_cvar( "fcs_kr_enable", "1" );
	g_iCvarKRCredits = register_cvar( "fcs_kr_credits", "4" );
	g_iCvarKRHSCredits = register_cvar( "fcs_kr_hscredits", "6" );

	g_iCvarTSEnable = register_cvar("fcs_transfer_enable", "1" );
	g_iCvarTSMaxCredits = register_cvar("fcs_transfer_maxcredits", "50" );

	g_iCvarWTREnable = register_cvar( "fcs_wtr_enable", "1" );
	g_iCvarWTRFurien = register_cvar( "fcs_wtr_furien", "3" );
	g_iCvarWTRAnti = register_cvar( "fcs_wtr_antifurien", "7" );

	register_clcmd( "say", "ClCmdSay" );
	register_clcmd( "say_team", "ClCmdSay" );

	register_clcmd( "say /depozit", "ClCmdSayDepozit" );
	register_clcmd( "say depozit", "ClCmdSayDepozit" );
	register_clcmd( "say_team /depozit", "ClCmdSayDepozit" );
	register_clcmd( "say_team depozit", "ClCmdSayDepozit" );

	register_clcmd( "say /retrage", "ClCmdSayRetrage" );
	register_clcmd( "say retrage", "ClCmdSayRetrage" );
	register_clcmd( "say_team /retrage", "ClCmdSayRetrage" );
	register_clcmd( "say_team retrage", "ClCmdSayRetrage" );

	register_clcmd( "fcs_credite", "ClCmdCredits" );
	register_clcmd( "fcs_credits", "ClCmdCredits" );

	register_clcmd( "donate", "ClCmdFcsDonate" );
	register_clcmd( "transfer", "ClCmdFcsDonate" );

	register_clcmd( "amx_give_credits", "ClCmdGiveCredits" );
	register_clcmd( "amx_take_credits", "ClCmdTakeCredits" );

	register_forward( FM_ClientUserInfoChanged, "Fwd_ClientUserInfoChanged" );
	register_event( "DeathMsg","ev_DeathMsg", "a" );
	register_event( "SendAudio", "ev_SendAudioTerWin", "a", "2=%!MRAD_terwin" );
	register_event( "SendAudio", "ev_SendAudioCtWin", "a", "2=%!MRAD_ctwin" );

	iVault  =  nvault_open( "iPlayCSCreditsSystem" );
	if(  iVault  ==  INVALID_HANDLE  )
		set_fail_state( "nValut returned invalid handle !" );

	set_task( 1.0, "task_PTRFunctions", TASK_pentru, _, _, "b", 0 );	
	g_iMaxPlayers = get_maxplayers( );
}

public plugin_natives()
{
	register_library( "fcs" );
	register_native( "fcs_get_user_credits", "_fcs_get_user_credits" );
	register_native( "fcs_set_user_credits", "_fcs_set_user_credits" );
}

public _fcs_get_user_credits( iPlugin, iParams )
{
	return g_iUserCredits[ get_param( 1 ) ];
}

public _fcs_set_user_credits( iPlugin, iParams )
{
	new id = get_param( 1 );
	g_iUserCredits[ id ] = max( 0, get_param( 2 ) );
	SaveCredits( id );
	return g_iUserCredits[ id ];
}

public client_authorized( id )
{
	if( is_user_bot( id ) )
		return PLUGIN_CONTINUE;

	get_user_name( id, g_szName[ id ], sizeof ( g_szName[] ) -1 );
	LoadCredits( id );

	g_iUserTime[ id ] = 0;
	return PLUGIN_CONTINUE;
}

public client_disconnect( id )
{
	if( is_user_bot( id ) )
		return PLUGIN_CONTINUE;

	SaveCredits( id );

	return PLUGIN_CONTINUE;
}

public ClCmdSay( id )
{
	static szArgs[192];
	read_args( szArgs, sizeof ( szArgs ) -1 );

	if( !szArgs[ 0 ] )
		return 0;

	new szCommand[ 15 ];
	remove_quotes( szArgs[ 0 ] );

	if( equal( szArgs, "/credite", strlen( "/credite" ) )
		|| equal( szArgs, "/credits", strlen( "/credits" ) ) )
	{
		replace( szArgs, sizeof ( szArgs ) -1, "/", "" );
		formatex( szCommand, sizeof ( szCommand ) -1, "fcs_%s", szArgs );
		client_cmd( id, szCommand );
		return 1;
	}
	else if( equal( szArgs,  "/transfer", strlen(  "/transfer" ) )
		|| equal( szArgs,  "/donate",  strlen(  "/donate" ) ) )
	{
		replace( szArgs, sizeof ( szArgs ) -1, "/", "" );
		formatex( szCommand, sizeof ( szCommand ) -1, "%s", szArgs );
		client_cmd( id, szCommand );
		return 1;
	}

	return 0;
}

public ClCmdCredits( id )
{
	if( !is_user_connected( id ) )
		return 1;

	new szArg[ 32 ];
    	read_argv( 1, szArg, sizeof ( szArg ) -1 );

	if( equal( szArg, "" ) ) 
	{
		
		ColorChat( id, RED, "^x04%s^x01 Ai^x03 %i^x01 credit(e) pana acuma !", g_szTag, g_iUserCredits[ id ] );
		return 1;
	}

    	new iPlayer = cmd_target( id, szArg, 8 );
    	if( !iPlayer || !is_user_connected( iPlayer ) )
	{
		ColorChat( id, RED,"^x04%s^x01 Jucatorul specificat nu a fost gasit !", g_szTag, szArg );
		return 1;
	}

	new szName[ 32 ];
	get_user_name( iPlayer, szName, sizeof ( szName ) -1 );
	ColorChat( id, RED,"^x04%s^x01 Jucatorul^x03 %s^x01 are^x04 %i^x01 credit%s", g_szTag, szName, g_iUserCredits[ iPlayer ], g_iUserCredits[ iPlayer ] == 1 ? "." : "e." );

	return 1;
}

public ClCmdSayDepozit( id )
{
	if( !is_user_connected( id ) )
		return 1;

	new iTeam = get_user_team( id );

	if( 1 <= iTeam <= 2 )
	{
		new iMoney = cs_get_user_money( id );
		if( iMoney >= 16000 )
		{
			ColorChat( id, RED, "^x04%s^x01 Ai depozitat^x03 16000$^x01 si ai primit^x04 1^x01 credit", g_szTag );
			cs_set_user_money( id, iMoney - 16000 );
			g_iUserCredits[ id ] += 1;

			SaveCredits( id );
			return 1;
		}
		else
		{
			ColorChat( id, RED, "^x04%s^x01 Iti trebuie^x03 16000$^x01 pentru a putea depozita", g_szTag );
			return 1;
		}
	}
	
	return 1;
}

public ClCmdSayRetrage( id )
{
	new iTeam = get_user_team( id );

	if( 1 <= iTeam <= 2 )
	{
		if( g_iUserCredits[ id ] > 0 )
		{
			new iMoney = cs_get_user_money( id );

			ColorChat( id, RED, "^x04%s^x01 Ai retras^x03 1^x01 credit si, ai primi^x04 16000$", g_szTag );
			cs_set_user_money( id, iMoney + 16000 );

			g_iUserCredits[ id ] -=1;
			SaveCredits( id );

			if( ( iMoney + 16000 ) > 16000 )
			{
				ColorChat( id, RED, "^x04%s^x01 ATENTIE^x01, ai^x03 %i$^x01 !", g_szTag, iMoney + 16000 );
				ColorChat( id, RED, "^x04%s^x01 La spawn, vei pierde tot ce depaseste suma de^x03 16000$", g_szTag );
				return 1;
			}
		}
		else
		{
			ColorChat(id, RED, "^x04%s ^x01NU ai ce sa retragi, ai^x03 0^x01 credit(e)", g_szTag );
			return 1;
		}
	}

	return 1;
}

public ClCmdGiveCredits( id )
{
	if( !( get_user_flags( id ) & read_flags( g_szGiveCreditsFlag ) ) )
	{
		client_cmd( id, "echo NU ai acces la aceasta comanda !" );
		return 1;
	}

	new szFirstArg[ 32 ], szSecondArg[ 10 ];
	read_argv( 1, szFirstArg, sizeof ( szFirstArg ) -1 );
	read_argv( 2, szSecondArg, sizeof ( szSecondArg ) -1 );

	if( equal( szFirstArg, "" ) || equal( szSecondArg, "" ) )
	{
		client_cmd( id, "echo amx_give_credits < nume/ @ALL/ @T/ @CT > < credit(e) >" );
		return 1;
	}

	new iPlayers[ 32 ];
	new iPlayersNum;

	new iCredits = str_to_num( szSecondArg );
	if( iCredits <= 0 )
	{
		client_cmd( id, "echo Valoare creditelor trebuie sa fie mai mare decat 0 !" );
		return 1;
	}

	if( szFirstArg[ 0 ] == '@' )
	{
		switch ( szFirstArg[ 1 ] )
		{
			case 'A':
			{
				if( equal( szFirstArg, "@ALL" ) )
				{
					get_players( iPlayers, iPlayersNum, "ch" );
					for( new i = 0; i < iPlayersNum ; i++ )
						g_iUserCredits[ iPlayers[ i ] ] += iCredits;

					new szName[ 32 ];
					get_user_name( id, szName, sizeof ( szName ) -1 );
					ColorChat( 0, NORMAL, "[^x04 ADM!N ^x01] ^x03%s^x01: le-a dat^x04 %i^x01 credit(e) tuturor ^x03Jucatorilor^x01 !", szName, iCredits );
					return 1;
				}
			}

			case 'T':
			{
				if( equal( szFirstArg, "@T" ) )
				{
					get_players( iPlayers, iPlayersNum, "ceh", "TERRORIST" );
					if( iPlayersNum == 0 )
					{
						client_cmd( id, "echo NU se afla niciun jucator in aceasta echipa !" );
						return 1;
					}
					for( new i = 0; i < iPlayersNum ; i++ )
						g_iUserCredits[ iPlayers[ i ] ] += iCredits;

					new szName[ 32 ];
					get_user_name( id, szName, sizeof ( szName ) -1 );
					ColorChat( 0, NORMAL, "[^x04 ADM!N ^x01] ^x03%s^x01: le-a dat^x04 %i^x01 credit(e) jucatorilor de la^x03 TERO ^x01!", szName, iCredits );
					return 1;
				}
			}

			case 'C':
			{
				if( equal( szFirstArg, "@CT" ) )
				{
					get_players( iPlayers, iPlayersNum, "ceh", "CT" );
					if( iPlayersNum == 0 )
					{
						client_cmd( id, "echo NU se afla niciun jucator in aceasta echipa !" );
						return 1;
					}
					for( new i = 0; i < iPlayersNum ; i++ )
						g_iUserCredits[ iPlayers[ i ] ] += iCredits;

					new szName[ 32 ];
					get_user_name( id, szName, sizeof ( szName ) -1 );
					ColorChat( 0, NORMAL, "[^x04 ADM!N ^x01] ^x03%s^x01: le-a dat^x04 %i^x01 credit(e) jucatorilor de la^x03 CT ^x01!", szName, iCredits );
					return 1;
				}
			}
		}
	}

	new iPlayer = cmd_target( id, szFirstArg, 8 );
	if( !iPlayer )
	{
		client_cmd( id, "echo Jucatorul %s nu a fost gasit !", szFirstArg );
		return 1;
	}

	g_iUserCredits[ iPlayer ] += iCredits;

	new szName[ 32 ], _szName[ 32 ];
	get_user_name( id, szName, sizeof ( szName ) -1 );
	get_user_name( iPlayer, _szName, sizeof ( _szName ) -1 );

	ColorChat( 0, NORMAL, "[^x04 ADM!N ^x01] ^x03%s^x01: i-a dat^x04 %i^x01 credit(e) lui^x03 %s", szName, iCredits, _szName );

	return 1;
}

public ClCmdTakeCredits( id )
{
	if( !( get_user_flags( id ) & read_flags( g_szGiveCreditsFlag ) ) )
	{
		client_cmd( id, "echo NU ai acces la aceasta comanda !" );
		return 1;
	}

	new szFirstArg[ 32 ], szSecondArg[ 10 ];

	read_argv( 1, szFirstArg, sizeof ( szFirstArg ) -1 );
	read_argv( 2, szSecondArg, sizeof ( szSecondArg ) -1 );

	if( equal( szFirstArg, "" ) || equal( szSecondArg, "" ) )
	{
		client_cmd( id, "echo amx_take_credits < nume > < credit(e) >" );
		return 1;
	}

	new iCredits = str_to_num( szSecondArg );
	if( iCredits <= 0 )
	{
		client_cmd( id, "echo Valoare creditelor trebuie sa fie mai mare decat 0 !" );
		return 1;
	}

	new iPlayer = cmd_target( id, szFirstArg, 8 );
	if( !iPlayer )
	{
		client_cmd( id, "echo Jucatorul %s nu a fost gasit !", szFirstArg );
		return 1;
	}

	if( g_iUserCredits[ iPlayer ] < iCredits )
	{
		client_cmd( id, "echo Jucatorul %s nu are atatea credit(e) ! Are doar %i", szFirstArg, g_iUserCredits[ iPlayer ] );
		return 1;
	}

	g_iUserCredits[ iPlayer ] -= iCredits;

	new szName[ 32 ], _szName[ 32 ];
	get_user_name( id, szName, sizeof ( szName ) -1 );
	get_user_name( iPlayer, _szName, sizeof ( _szName ) -1 );

	ColorChat( 0, NORMAL, "[^x04 ADM!N ^x01] ^x03%s^x01: i-a sters^x04 %i^x01 credit(e) lui^x03 %s", szName, iCredits, _szName );

	return 1;
}

public ClCmdFcsDonate( id )
{
	if( get_pcvar_num(  g_iCvarTSEnable  )  !=  1 )
	{
		ColorChat( id, RED, "^x04%s^x01 Comanda dezactivata de catre server !",  g_szTag  );
		return PLUGIN_HANDLED;
	}

	new szFirstArg[ 32 ], szSecondArg[ 10 ];

    	read_argv( 1, szFirstArg, sizeof ( szFirstArg ) -1 );
	read_argv( 2, szSecondArg, sizeof ( szSecondArg ) -1 );

	if( equal( szFirstArg, "" ) || equal( szSecondArg, "" ) )
	{
		ColorChat( id, RED, "^x04%s^x01 Folosire:^x03 /transfer^x01 sau^x04 /donate^x01 <^x03 nume^x01 > <^x04 credit(e)^x01 >", g_szTag );
		return 1;
	}

	new iPlayer = cmd_target( id, szFirstArg, 8 );

	if( !iPlayer )
	{
		ColorChat( id, RED, "^x04%s^x01 Acel jucator nu a fost gasit", g_szTag );
		return PLUGIN_HANDLED;
	}

	//if( iPlayer == id )
	//{
	//	ColorChat( id,  RED, "^x04%s^x01 Nu-ti poti transfera credit(e)", g_szTag );
	//	return PLUGIN_HANDLED;
	//}

	new iCredits;
	iCredits = str_to_num( szSecondArg );

	if( iCredits <= 0 )
	{
		ColorChat( id, RED, "^x04%s^x01 Trebuie sa introduci o valoare mai mare de^x03 0", g_szTag );
		return PLUGIN_HANDLED;
	}

	new iMaxCredits = get_pcvar_num( g_iCvarTSMaxCredits );
	if( iCredits > iMaxCredits )
	{
		ColorChat( id, RED, "^x04%s^x01 Poti transfera maxim^x03 %i^x01 credit%s o data !", g_szTag, iMaxCredits, iMaxCredits == 1 ? "" : "e" );
		return PLUGIN_HANDLED;
	}

	if( g_iUserCredits[ id ] <  iCredits )
	{
		ColorChat( id, RED, "^x04%s^x01 Nu ai destule credit(e), ai doar^x03 %i credit%s",  g_szTag, g_iUserCredits[ id ], g_iUserCredits[ id ] == 1 ? "" : "e"  );
		return 1;
	}

	g_iUserCredits[ id ] -= iCredits;
	g_iUserCredits[ iPlayer ] += iCredits;

	SaveCredits( id );
	SaveCredits( iPlayer );

	new szFirstName[ 32 ], szSecondName[ 32 ];

	get_user_name( id, szFirstName, sizeof ( szFirstName )  -1 );
	get_user_name( iPlayer, szSecondName, sizeof ( szSecondName )  -1 );

	ColorChat( 0, RED, "^x04%s^x03 %s^x01 i-a transferat^04 %i credit%s^x01 lui^x03 %s^x01", g_szTag, szFirstName, iCredits, iCredits == 1 ? "" : "e", szSecondName );
	return PLUGIN_HANDLED;
}

public Fwd_ClientUserInfoChanged( id, szBuffer )
{
	if ( !is_user_connected( id ) ) 
		return FMRES_IGNORED;

	static szNewName[ 32 ];

	engfunc( EngFunc_InfoKeyValue, szBuffer, "name", szNewName, sizeof ( szNewName ) -1 );

	if ( equal( szNewName, g_szName[ id ] ) )
		return FMRES_IGNORED;

	SaveCredits( id );

	ColorChat( id, RED, "^x04%s^x01 Tocmai ti-ai schimbat numele din^x03 %s^x01 in^x04 %s^x01 !", g_szTag, g_szName[ id ], szNewName );
	ColorChat( id, RED, "^x04%s^x01 Am salvat^x03 %i^x01 credit(e) pe numele^x04 %s^x01 !", g_szTag, g_iUserCredits[ id ], g_szName[ id ] );

	copy( g_szName[ id ], sizeof ( g_szName[] ) -1, szNewName );
	LoadCredits( id );

	ColorChat( id, RED, "^x04%s^x01 Am incarcat^x03 %i^x01 credit(e) de pe noul nume (^x04 %s^x01 ) !", g_szTag, g_iUserCredits[ id ], g_szName[ id ] );

	return FMRES_IGNORED;
}

public LoadCredits( id )
{
	static szData[ 256 ],  iTimestamp;

	if(  nvault_lookup( iVault, g_szName[ id ], szData, sizeof ( szData ) -1, iTimestamp ) )
	{
		static szCredits[ 15 ];
		parse( szData, szCredits, sizeof ( szCredits ) -1 );
		g_iUserCredits[ id ] = str_to_num( szCredits );
		return;
	}
	else
	{
		g_iUserCredits[ id ] = 0;
	}
}

public SaveCredits( id )
{
	static szData[ 256 ];
	formatex( szData, sizeof ( szData ) -1, "%i", g_iUserCredits[ id ] );

	nvault_set( iVault, g_szName[ id ], szData );
}

public task_PTRFunctions( )
{
	if( get_pcvar_num( g_iCvarPTREnable ) != 1 )
		return;

	static iPlayers[ 32 ];
	static iPlayersNum;

	get_players( iPlayers, iPlayersNum, "ch" );
	if( !iPlayersNum )
		return;

	static id, i;
	for( i = 0; i < iPlayersNum; i++ )
	{
		id = iPlayers[ i ];

		g_iUserTime[ id ]++;
		static iTime;
		iTime = get_pcvar_num( g_iCvarPTRMinutes ) ;

		if( g_iUserTime[ id ] >= iTime * 60 )
		{
			g_iUserTime[ id ] -= iTime * 60;

			static iCredits;
			iCredits = get_pcvar_num( g_iCvarPTRCredits );

			g_iUserCredits[ id ] += iCredits;
		        ColorChat( id, RED, "^x01[^x04 iPlayCs ^x01] Ai primit^x03 %i^x01 credit pentru ca ai jucat^x04 %i^x01 minute pe^x03 iPlayCs ^x01!", iCredits, iTime );
		        ColorChat( id, RED, "^x01[^x04 iPlayCs ^x01] Joaca in^x03 continuare ^x01si vei primi dinou !" );

			SaveCredits( id );	
		}
	}
}

public ev_DeathMsg( )
{
	if( get_pcvar_num( g_iCvarKREnable ) != 1 )
		return;

	new iKiller = read_data( 1 );
	if( iKiller == read_data( 2 ) )
		return;

	new iCredits = get_pcvar_num( g_iCvarKRCredits );

	if( read_data( 3 ) )
		iCredits += get_pcvar_num( g_iCvarKRHSCredits );

	g_iUserCredits[ iKiller ] += iCredits;
	SaveCredits( iKiller );
}

public ev_SendAudioTerWin( )
{
	static iCvarEnable, iCvarFurienReward;
	iCvarEnable = get_pcvar_num( g_iCvarWTREnable );
	iCvarFurienReward = get_pcvar_num( g_iCvarWTRFurien );

	if( iCvarEnable != 1 || iCvarFurienReward == 0 )
		return;

	GiveTeamReward( FCS_TEAM_FURIEN, iCvarFurienReward );
}

public ev_SendAudioCtWin( )
{
	static iCvarEnable, iCvarAntiReward;
	iCvarEnable = get_pcvar_num( g_iCvarWTREnable );
	iCvarAntiReward = get_pcvar_num( g_iCvarWTRAnti );

	if( iCvarEnable != 1 || iCvarAntiReward == 0 )
		return;

	GiveTeamReward( FCS_TEAM_ANTIFURIEN, iCvarAntiReward );
}

public GiveTeamReward( const CsTeams:iTeam, iCredits )
{
	for( new id = 1; id <= g_iMaxPlayers; id++ )
	{
		if( is_user_connected( id ) && cs_get_user_team( id ) == iTeam )
		{
			ColorChat( id, RED, "^x04%s^x01 Ai primit^x03 %i^x01 credit%s pentru castigarea rundei !", g_szTag, iCredits, iCredits == 1 ? "" : "e" );
			g_iUserCredits[ id ] += iCredits;
			SaveCredits( id );
		}
	}
}

public plugin_end( )
{
	nvault_close( iVault );
}

ColorChat( id, Color:iType, const msg[  ], { Float, Sql, Result, _}:... )
{
	if( !get_playersnum( ) ) return;

	new szMessage[ 256 ];

	switch( iType )
	{
		case NORMAL:	szMessage[ 0 ] = 0x01;

		case GREEN:	szMessage[ 0 ] = 0x04;

		default: 	szMessage[ 0 ] = 0x03;
	}

	vformat( szMessage[ 1 ], 251, msg, 4 );

	szMessage[ 192 ] = '^0';

	new iTeam, iColorChange, iPlayerIndex, MSG_Type;

	if( id )
	{
		MSG_Type  =  MSG_ONE_UNRELIABLE;
		iPlayerIndex  =  id;
	}
	else
	{
		iPlayerIndex  =  CC_FindPlayer( );
		MSG_Type = MSG_ALL;
	}

	iTeam  =  get_user_team( iPlayerIndex );
	iColorChange  =  CC_ColorSelection(  iPlayerIndex,  MSG_Type, iType);

	CC_ShowColorMessage( iPlayerIndex, MSG_Type, szMessage );

	if( iColorChange )	CC_Team_Info( iPlayerIndex, MSG_Type,  TeamName[ iTeam ] );
}

CC_ShowColorMessage( id, const iType, const szMessage[ ] )
{
	static bool:bSayTextUsed;
	static iMsgSayText;

	if( !bSayTextUsed )
	{
		iMsgSayText  =  get_user_msgid( "SayText" );
		bSayTextUsed  =  true;
	}

	message_begin( iType, iMsgSayText, _, id  );
	write_byte(  id  );		
	write_string(  szMessage  );
	message_end( );
}

CC_Team_Info( id, const iType, const szTeam[  ] )
{
	static bool:bTeamInfoUsed;
	static iMsgTeamInfo;
	if(  !bTeamInfoUsed  )
	{
		iMsgTeamInfo  =  get_user_msgid( "TeamInfo" );
		bTeamInfoUsed  =  true;
	}

	message_begin( iType, iMsgTeamInfo, _, id  );
	write_byte( id );
	write_string( szTeam );
	message_end( );

	return 1;
}

CC_ColorSelection( id, const iType, Color:iColorType )
{
	switch( iColorType )
	{
		case RED:	return CC_Team_Info( id, iType, TeamName[ 1 ] );
		case BLUE:	return CC_Team_Info( id, iType, TeamName[ 2 ] );
		case GREY:	return CC_Team_Info( id, iType, TeamName[ 0 ] );
	}

	return 0;
}

CC_FindPlayer( )
{
	new iMaxPlayers  =  get_maxplayers( );

	for( new i = 1; i <= iMaxPlayers; i++ )
		if( is_user_connected( i ) )
			return i;

	return -1;
}
Nu fac nimic contra cost! Faceți cerere bine detaliată aici, pe forum. Nu-mi mai dați add pe Steam doar pentru a mă avea în lista de prieteni.
Am cont și activez doar aici! Aveți grijă la cei ce încearcă să mă copieze..Puteți lua legătura cu mine dacă aveți o problemă/nelămurire în acest caz.
* Inactiv momentan.
IG-BOOST.org - Instagram Followers Best, Cheap, Reliable
User avatar
Ulquiorra
Scripter eXtreamCS
Scripter eXtreamCS
Posts: 2088
Joined: 25 Jul 2010, 16:29
Detinator Steam: Da
CS Status: A mai trecut o zi asteptand una mai buna
Detinator server CS: Retras.
SteamID: STEAM_0:1:318247XX
Reputatie: Scripter eXtreamCS
Nick anterior: sPuf ?, a^ml), Loca Tapioca, Askhanar
Fost Moderator ajutator
Location: Braila, Romania.
Has thanked: 214 times
Been thanked: 1140 times
Contact:

18 Aug 2013, 20:28

1. inlocuieste in plugin:

Code: Select all

public ev_DeathMsg( )
{
	if( get_pcvar_num( g_iCvarKREnable ) != 1 )
		return;

	new iKiller = read_data( 1 );
	if( iKiller == read_data( 2 ) )
		return;

	new iCredits = get_pcvar_num( g_iCvarKRCredits );

	if( read_data( 3 ) )
		iCredits += get_pcvar_num( g_iCvarKRHSCredits );

	g_iUserCredits[ iKiller ] += iCredits;
	SaveCredits( iKiller );
}
cu

Code: Select all

public ev_DeathMsg( )
{
	if( get_pcvar_num( g_iCvarKREnable ) != 1 )
		return;

	new iKiller = read_data( 1 );
	if( iKiller == read_data( 2 ) )
		return;

	new iCredits = get_pcvar_num( g_iCvarKRCredits );
	new szName[ 32 ];
	get_user_name( iVictim, szName, sizeof( szName ) -1 );
	
	ColorChat( iKiller, RED, "^x04%s^x01 You earned^x03 %i^x01 credits for killing^x03 %s^x01 !", g_szTag, iCredits, szName );
	if( read_data( 3 ) )
	{
		new iHS = get_pcvar_num( g_iCvarKRHSCredits );
		iCredits += iHS;
		ColorChat( iKiller, RED, "^x04%s^x01 You earned another^x03 %i^x01 credits ( HS bonus ) !", g_szTag, iHS );
	}

	g_iUserCredits[ iKiller ] += iCredits;
	SaveCredits( iKiller );
}
2. am sa fac un plugin FCS Bomb Events.. dar nu acum.
""Copilarie, iarta-ma c-am vrut sa fiu om mare.. ""
User avatar
L E V I N
Scripter eXtreamCS
Scripter eXtreamCS
Posts: 2155
Joined: 24 Aug 2011, 11:24
Detinator Steam: Da
CS Status:
Detinator server CS: ☯∴
SteamID: riseofevo
Reputatie: Scripter eXtreamCS
Nume anterior: Adryyy
Location: ҳ̸Ҳ̸ҳ
Has thanked: 33 times
Been thanked: 349 times
Contact:

18 Aug 2013, 20:36

Askhanar wrote:1. inlocuieste in plugin:

Code: Select all

public ev_DeathMsg( )
{
	if( get_pcvar_num( g_iCvarKREnable ) != 1 )
		return;

	new iKiller = read_data( 1 );
	if( iKiller == read_data( 2 ) )
		return;

	new iCredits = get_pcvar_num( g_iCvarKRCredits );

	if( read_data( 3 ) )
		iCredits += get_pcvar_num( g_iCvarKRHSCredits );

	g_iUserCredits[ iKiller ] += iCredits;
	SaveCredits( iKiller );
}
cu

Code: Select all

public ev_DeathMsg( )
{
	if( get_pcvar_num( g_iCvarKREnable ) != 1 )
		return;

	new iKiller = read_data( 1 );
	if( iKiller == read_data( 2 ) )
		return;

	new iCredits = get_pcvar_num( g_iCvarKRCredits );
	new szName[ 32 ];
	get_user_name( iVictim, szName, sizeof( szName ) -1 );
	
	ColorChat( iKiller, RED, "^x04%s^x01 You earned^x03 %i^x01 credits for killing^x03 %s^x01 !", g_szTag, iCredits, szName );
	if( read_data( 3 ) )
	{
		new iHS = get_pcvar_num( g_iCvarKRHSCredits );
		iCredits += iHS;
		ColorChat( iKiller, RED, "^x04%s^x01 You earned another^x03 %i^x01 credits ( HS bonus ) !", g_szTag, iHS );
	}

	g_iUserCredits[ iKiller ] += iCredits;
	SaveCredits( iKiller );
}
2. am sa fac un plugin FCS Bomb Events.. dar nu acum.
Nu merge da eroare la compilate X_x
P.S: astept si plg de la 2...
Nu fac nimic contra cost! Faceți cerere bine detaliată aici, pe forum. Nu-mi mai dați add pe Steam doar pentru a mă avea în lista de prieteni.
Am cont și activez doar aici! Aveți grijă la cei ce încearcă să mă copieze..Puteți lua legătura cu mine dacă aveți o problemă/nelămurire în acest caz.
* Inactiv momentan.
User avatar
Ulquiorra
Scripter eXtreamCS
Scripter eXtreamCS
Posts: 2088
Joined: 25 Jul 2010, 16:29
Detinator Steam: Da
CS Status: A mai trecut o zi asteptand una mai buna
Detinator server CS: Retras.
SteamID: STEAM_0:1:318247XX
Reputatie: Scripter eXtreamCS
Nick anterior: sPuf ?, a^ml), Loca Tapioca, Askhanar
Fost Moderator ajutator
Location: Braila, Romania.
Has thanked: 214 times
Been thanked: 1140 times
Contact:

18 Aug 2013, 21:12

ups, my bad
| Afiseaza codul
#include < amxmodx >
#include < amxmisc >
#include < cstrike >
#include < fun >
#include < engine >
#include < fakemeta >
#include < nvault >

#pragma semicolon 1

#define PLUGIN "BIG Systems"
#define VERSION "1.0"

#define TASK_pentru 06091993
#define FCS_TEAM_FURIEN CS_TEAM_T
#define FCS_TEAM_ANTIFURIEN CS_TEAM_CT

enum Color
{
	NORMAL = 1,
	GREEN,
	TEAM_COLOR,
	GREY,
	RED,
	BLUE,
};

new TeamName[  ][  ] = 
{
	"",
	"TERRORIST",
	"CT",
	"SPECTATOR"
};

new const g_szTag[ ] = "[iPlayCs System]";
new const g_szGiveCreditsFlag[ ] = "a";

new g_iCvarPTREnable;
new g_iCvarPTRMinutes;
new g_iCvarPTRCredits;

new g_iCvarKREnable;
new g_iCvarKRCredits;
new g_iCvarKRHSCredits;

new g_iCvarTSEnable;
new g_iCvarTSMaxCredits;

new g_iCvarWTREnable;
new g_iCvarWTRFurien;
new g_iCvarWTRAnti;

new g_szName[ 33 ][ 32 ];
new g_iUserCredits[ 33 ];
new g_iUserTime[ 33 ];

new iVault;
new g_iMaxPlayers;

public plugin_init( )
{
	register_plugin( PLUGIN, VERSION, "Askhanar" );

	g_iCvarPTREnable = register_cvar( "fcs_pentru_enable", "1" );
	g_iCvarPTRMinutes = register_cvar( "fcs_pentru_minutes", "7" );
	g_iCvarPTRCredits = register_cvar( "fcs_pentru_credits", "5" );

	g_iCvarKREnable = register_cvar( "fcs_kr_enable", "1" );
	g_iCvarKRCredits = register_cvar( "fcs_kr_credits", "4" );
	g_iCvarKRHSCredits = register_cvar( "fcs_kr_hscredits", "6" );

	g_iCvarTSEnable = register_cvar("fcs_transfer_enable", "1" );
	g_iCvarTSMaxCredits = register_cvar("fcs_transfer_maxcredits", "50" );

	g_iCvarWTREnable = register_cvar( "fcs_wtr_enable", "1" );
	g_iCvarWTRFurien = register_cvar( "fcs_wtr_furien", "3" );
	g_iCvarWTRAnti = register_cvar( "fcs_wtr_antifurien", "7" );

	register_clcmd( "say", "ClCmdSay" );
	register_clcmd( "say_team", "ClCmdSay" );

	register_clcmd( "say /depozit", "ClCmdSayDepozit" );
	register_clcmd( "say depozit", "ClCmdSayDepozit" );
	register_clcmd( "say_team /depozit", "ClCmdSayDepozit" );
	register_clcmd( "say_team depozit", "ClCmdSayDepozit" );

	register_clcmd( "say /retrage", "ClCmdSayRetrage" );
	register_clcmd( "say retrage", "ClCmdSayRetrage" );
	register_clcmd( "say_team /retrage", "ClCmdSayRetrage" );
	register_clcmd( "say_team retrage", "ClCmdSayRetrage" );

	register_clcmd( "fcs_credite", "ClCmdCredits" );
	register_clcmd( "fcs_credits", "ClCmdCredits" );

	register_clcmd( "donate", "ClCmdFcsDonate" );
	register_clcmd( "transfer", "ClCmdFcsDonate" );

	register_clcmd( "amx_give_credits", "ClCmdGiveCredits" );
	register_clcmd( "amx_take_credits", "ClCmdTakeCredits" );

	register_forward( FM_ClientUserInfoChanged, "Fwd_ClientUserInfoChanged" );
	register_event( "DeathMsg","ev_DeathMsg", "a" );
	register_event( "SendAudio", "ev_SendAudioTerWin", "a", "2=%!MRAD_terwin" );
	register_event( "SendAudio", "ev_SendAudioCtWin", "a", "2=%!MRAD_ctwin" );

	iVault  =  nvault_open( "iPlayCSCreditsSystem" );
	if(  iVault  ==  INVALID_HANDLE  )
		set_fail_state( "nValut returned invalid handle !" );

	set_task( 1.0, "task_PTRFunctions", TASK_pentru, _, _, "b", 0 );	
	g_iMaxPlayers = get_maxplayers( );
}

public plugin_natives()
{
	register_library( "fcs" );
	register_native( "fcs_get_user_credits", "_fcs_get_user_credits" );
	register_native( "fcs_set_user_credits", "_fcs_set_user_credits" );
}

public _fcs_get_user_credits( iPlugin, iParams )
{
	return g_iUserCredits[ get_param( 1 ) ];
}

public _fcs_set_user_credits( iPlugin, iParams )
{
	new id = get_param( 1 );
	g_iUserCredits[ id ] = max( 0, get_param( 2 ) );
	SaveCredits( id );
	return g_iUserCredits[ id ];
}

public client_authorized( id )
{
	if( is_user_bot( id ) )
		return PLUGIN_CONTINUE;

	get_user_name( id, g_szName[ id ], sizeof ( g_szName[] ) -1 );
	LoadCredits( id );

	g_iUserTime[ id ] = 0;
	return PLUGIN_CONTINUE;
}

public client_disconnect( id )
{
	if( is_user_bot( id ) )
		return PLUGIN_CONTINUE;

	SaveCredits( id );

	return PLUGIN_CONTINUE;
}

public ClCmdSay( id )
{
	static szArgs[192];
	read_args( szArgs, sizeof ( szArgs ) -1 );

	if( !szArgs[ 0 ] )
		return 0;

	new szCommand[ 15 ];
	remove_quotes( szArgs[ 0 ] );

	if( equal( szArgs, "/credite", strlen( "/credite" ) )
		|| equal( szArgs, "/credits", strlen( "/credits" ) ) )
	{
		replace( szArgs, sizeof ( szArgs ) -1, "/", "" );
		formatex( szCommand, sizeof ( szCommand ) -1, "fcs_%s", szArgs );
		client_cmd( id, szCommand );
		return 1;
	}
	else if( equal( szArgs,  "/transfer", strlen(  "/transfer" ) )
		|| equal( szArgs,  "/donate",  strlen(  "/donate" ) ) )
	{
		replace( szArgs, sizeof ( szArgs ) -1, "/", "" );
		formatex( szCommand, sizeof ( szCommand ) -1, "%s", szArgs );
		client_cmd( id, szCommand );
		return 1;
	}

	return 0;
}

public ClCmdCredits( id )
{
	if( !is_user_connected( id ) )
		return 1;

	new szArg[ 32 ];
    	read_argv( 1, szArg, sizeof ( szArg ) -1 );

	if( equal( szArg, "" ) ) 
	{
		
		ColorChat( id, RED, "^x04%s^x01 Ai^x03 %i^x01 credit(e) pana acuma !", g_szTag, g_iUserCredits[ id ] );
		return 1;
	}

    	new iPlayer = cmd_target( id, szArg, 8 );
    	if( !iPlayer || !is_user_connected( iPlayer ) )
	{
		ColorChat( id, RED,"^x04%s^x01 Jucatorul specificat nu a fost gasit !", g_szTag, szArg );
		return 1;
	}

	new szName[ 32 ];
	get_user_name( iPlayer, szName, sizeof ( szName ) -1 );
	ColorChat( id, RED,"^x04%s^x01 Jucatorul^x03 %s^x01 are^x04 %i^x01 credit%s", g_szTag, szName, g_iUserCredits[ iPlayer ], g_iUserCredits[ iPlayer ] == 1 ? "." : "e." );

	return 1;
}

public ClCmdSayDepozit( id )
{
	if( !is_user_connected( id ) )
		return 1;

	new iTeam = get_user_team( id );

	if( 1 <= iTeam <= 2 )
	{
		new iMoney = cs_get_user_money( id );
		if( iMoney >= 16000 )
		{
			ColorChat( id, RED, "^x04%s^x01 Ai depozitat^x03 16000$^x01 si ai primit^x04 1^x01 credit", g_szTag );
			cs_set_user_money( id, iMoney - 16000 );
			g_iUserCredits[ id ] += 1;

			SaveCredits( id );
			return 1;
		}
		else
		{
			ColorChat( id, RED, "^x04%s^x01 Iti trebuie^x03 16000$^x01 pentru a putea depozita", g_szTag );
			return 1;
		}
	}
	
	return 1;
}

public ClCmdSayRetrage( id )
{
	new iTeam = get_user_team( id );

	if( 1 <= iTeam <= 2 )
	{
		if( g_iUserCredits[ id ] > 0 )
		{
			new iMoney = cs_get_user_money( id );

			ColorChat( id, RED, "^x04%s^x01 Ai retras^x03 1^x01 credit si, ai primi^x04 16000$", g_szTag );
			cs_set_user_money( id, iMoney + 16000 );

			g_iUserCredits[ id ] -=1;
			SaveCredits( id );

			if( ( iMoney + 16000 ) > 16000 )
			{
				ColorChat( id, RED, "^x04%s^x01 ATENTIE^x01, ai^x03 %i$^x01 !", g_szTag, iMoney + 16000 );
				ColorChat( id, RED, "^x04%s^x01 La spawn, vei pierde tot ce depaseste suma de^x03 16000$", g_szTag );
				return 1;
			}
		}
		else
		{
			ColorChat(id, RED, "^x04%s ^x01NU ai ce sa retragi, ai^x03 0^x01 credit(e)", g_szTag );
			return 1;
		}
	}

	return 1;
}

public ClCmdGiveCredits( id )
{
	if( !( get_user_flags( id ) & read_flags( g_szGiveCreditsFlag ) ) )
	{
		client_cmd( id, "echo NU ai acces la aceasta comanda !" );
		return 1;
	}

	new szFirstArg[ 32 ], szSecondArg[ 10 ];
	read_argv( 1, szFirstArg, sizeof ( szFirstArg ) -1 );
	read_argv( 2, szSecondArg, sizeof ( szSecondArg ) -1 );

	if( equal( szFirstArg, "" ) || equal( szSecondArg, "" ) )
	{
		client_cmd( id, "echo amx_give_credits < nume/ @ALL/ @T/ @CT > < credit(e) >" );
		return 1;
	}

	new iPlayers[ 32 ];
	new iPlayersNum;

	new iCredits = str_to_num( szSecondArg );
	if( iCredits <= 0 )
	{
		client_cmd( id, "echo Valoare creditelor trebuie sa fie mai mare decat 0 !" );
		return 1;
	}

	if( szFirstArg[ 0 ] == '@' )
	{
		switch ( szFirstArg[ 1 ] )
		{
			case 'A':
			{
				if( equal( szFirstArg, "@ALL" ) )
				{
					get_players( iPlayers, iPlayersNum, "ch" );
					for( new i = 0; i < iPlayersNum ; i++ )
						g_iUserCredits[ iPlayers[ i ] ] += iCredits;

					new szName[ 32 ];
					get_user_name( id, szName, sizeof ( szName ) -1 );
					ColorChat( 0, NORMAL, "[^x04 ADM!N ^x01] ^x03%s^x01: le-a dat^x04 %i^x01 credit(e) tuturor ^x03Jucatorilor^x01 !", szName, iCredits );
					return 1;
				}
			}

			case 'T':
			{
				if( equal( szFirstArg, "@T" ) )
				{
					get_players( iPlayers, iPlayersNum, "ceh", "TERRORIST" );
					if( iPlayersNum == 0 )
					{
						client_cmd( id, "echo NU se afla niciun jucator in aceasta echipa !" );
						return 1;
					}
					for( new i = 0; i < iPlayersNum ; i++ )
						g_iUserCredits[ iPlayers[ i ] ] += iCredits;

					new szName[ 32 ];
					get_user_name( id, szName, sizeof ( szName ) -1 );
					ColorChat( 0, NORMAL, "[^x04 ADM!N ^x01] ^x03%s^x01: le-a dat^x04 %i^x01 credit(e) jucatorilor de la^x03 TERO ^x01!", szName, iCredits );
					return 1;
				}
			}

			case 'C':
			{
				if( equal( szFirstArg, "@CT" ) )
				{
					get_players( iPlayers, iPlayersNum, "ceh", "CT" );
					if( iPlayersNum == 0 )
					{
						client_cmd( id, "echo NU se afla niciun jucator in aceasta echipa !" );
						return 1;
					}
					for( new i = 0; i < iPlayersNum ; i++ )
						g_iUserCredits[ iPlayers[ i ] ] += iCredits;

					new szName[ 32 ];
					get_user_name( id, szName, sizeof ( szName ) -1 );
					ColorChat( 0, NORMAL, "[^x04 ADM!N ^x01] ^x03%s^x01: le-a dat^x04 %i^x01 credit(e) jucatorilor de la^x03 CT ^x01!", szName, iCredits );
					return 1;
				}
			}
		}
	}

	new iPlayer = cmd_target( id, szFirstArg, 8 );
	if( !iPlayer )
	{
		client_cmd( id, "echo Jucatorul %s nu a fost gasit !", szFirstArg );
		return 1;
	}

	g_iUserCredits[ iPlayer ] += iCredits;

	new szName[ 32 ], _szName[ 32 ];
	get_user_name( id, szName, sizeof ( szName ) -1 );
	get_user_name( iPlayer, _szName, sizeof ( _szName ) -1 );

	ColorChat( 0, NORMAL, "[^x04 ADM!N ^x01] ^x03%s^x01: i-a dat^x04 %i^x01 credit(e) lui^x03 %s", szName, iCredits, _szName );

	return 1;
}

public ClCmdTakeCredits( id )
{
	if( !( get_user_flags( id ) & read_flags( g_szGiveCreditsFlag ) ) )
	{
		client_cmd( id, "echo NU ai acces la aceasta comanda !" );
		return 1;
	}

	new szFirstArg[ 32 ], szSecondArg[ 10 ];

	read_argv( 1, szFirstArg, sizeof ( szFirstArg ) -1 );
	read_argv( 2, szSecondArg, sizeof ( szSecondArg ) -1 );

	if( equal( szFirstArg, "" ) || equal( szSecondArg, "" ) )
	{
		client_cmd( id, "echo amx_take_credits < nume > < credit(e) >" );
		return 1;
	}

	new iCredits = str_to_num( szSecondArg );
	if( iCredits <= 0 )
	{
		client_cmd( id, "echo Valoare creditelor trebuie sa fie mai mare decat 0 !" );
		return 1;
	}

	new iPlayer = cmd_target( id, szFirstArg, 8 );
	if( !iPlayer )
	{
		client_cmd( id, "echo Jucatorul %s nu a fost gasit !", szFirstArg );
		return 1;
	}

	if( g_iUserCredits[ iPlayer ] < iCredits )
	{
		client_cmd( id, "echo Jucatorul %s nu are atatea credit(e) ! Are doar %i", szFirstArg, g_iUserCredits[ iPlayer ] );
		return 1;
	}

	g_iUserCredits[ iPlayer ] -= iCredits;

	new szName[ 32 ], _szName[ 32 ];
	get_user_name( id, szName, sizeof ( szName ) -1 );
	get_user_name( iPlayer, _szName, sizeof ( _szName ) -1 );

	ColorChat( 0, NORMAL, "[^x04 ADM!N ^x01] ^x03%s^x01: i-a sters^x04 %i^x01 credit(e) lui^x03 %s", szName, iCredits, _szName );

	return 1;
}

public ClCmdFcsDonate( id )
{
	if( get_pcvar_num(  g_iCvarTSEnable  )  !=  1 )
	{
		ColorChat( id, RED, "^x04%s^x01 Comanda dezactivata de catre server !",  g_szTag  );
		return PLUGIN_HANDLED;
	}

	new szFirstArg[ 32 ], szSecondArg[ 10 ];

    	read_argv( 1, szFirstArg, sizeof ( szFirstArg ) -1 );
	read_argv( 2, szSecondArg, sizeof ( szSecondArg ) -1 );

	if( equal( szFirstArg, "" ) || equal( szSecondArg, "" ) )
	{
		ColorChat( id, RED, "^x04%s^x01 Folosire:^x03 /transfer^x01 sau^x04 /donate^x01 <^x03 nume^x01 > <^x04 credit(e)^x01 >", g_szTag );
		return 1;
	}

	new iPlayer = cmd_target( id, szFirstArg, 8 );

	if( !iPlayer )
	{
		ColorChat( id, RED, "^x04%s^x01 Acel jucator nu a fost gasit", g_szTag );
		return PLUGIN_HANDLED;
	}

	//if( iPlayer == id )
	//{
	//	ColorChat( id,  RED, "^x04%s^x01 Nu-ti poti transfera credit(e)", g_szTag );
	//	return PLUGIN_HANDLED;
	//}

	new iCredits;
	iCredits = str_to_num( szSecondArg );

	if( iCredits <= 0 )
	{
		ColorChat( id, RED, "^x04%s^x01 Trebuie sa introduci o valoare mai mare de^x03 0", g_szTag );
		return PLUGIN_HANDLED;
	}

	new iMaxCredits = get_pcvar_num( g_iCvarTSMaxCredits );
	if( iCredits > iMaxCredits )
	{
		ColorChat( id, RED, "^x04%s^x01 Poti transfera maxim^x03 %i^x01 credit%s o data !", g_szTag, iMaxCredits, iMaxCredits == 1 ? "" : "e" );
		return PLUGIN_HANDLED;
	}

	if( g_iUserCredits[ id ] <  iCredits )
	{
		ColorChat( id, RED, "^x04%s^x01 Nu ai destule credit(e), ai doar^x03 %i credit%s",  g_szTag, g_iUserCredits[ id ], g_iUserCredits[ id ] == 1 ? "" : "e"  );
		return 1;
	}

	g_iUserCredits[ id ] -= iCredits;
	g_iUserCredits[ iPlayer ] += iCredits;

	SaveCredits( id );
	SaveCredits( iPlayer );

	new szFirstName[ 32 ], szSecondName[ 32 ];

	get_user_name( id, szFirstName, sizeof ( szFirstName )  -1 );
	get_user_name( iPlayer, szSecondName, sizeof ( szSecondName )  -1 );

	ColorChat( 0, RED, "^x04%s^x03 %s^x01 i-a transferat^04 %i credit%s^x01 lui^x03 %s^x01", g_szTag, szFirstName, iCredits, iCredits == 1 ? "" : "e", szSecondName );
	return PLUGIN_HANDLED;
}

public Fwd_ClientUserInfoChanged( id, szBuffer )
{
	if ( !is_user_connected( id ) ) 
		return FMRES_IGNORED;

	static szNewName[ 32 ];

	engfunc( EngFunc_InfoKeyValue, szBuffer, "name", szNewName, sizeof ( szNewName ) -1 );

	if ( equal( szNewName, g_szName[ id ] ) )
		return FMRES_IGNORED;

	SaveCredits( id );

	ColorChat( id, RED, "^x04%s^x01 Tocmai ti-ai schimbat numele din^x03 %s^x01 in^x04 %s^x01 !", g_szTag, g_szName[ id ], szNewName );
	ColorChat( id, RED, "^x04%s^x01 Am salvat^x03 %i^x01 credit(e) pe numele^x04 %s^x01 !", g_szTag, g_iUserCredits[ id ], g_szName[ id ] );

	copy( g_szName[ id ], sizeof ( g_szName[] ) -1, szNewName );
	LoadCredits( id );

	ColorChat( id, RED, "^x04%s^x01 Am incarcat^x03 %i^x01 credit(e) de pe noul nume (^x04 %s^x01 ) !", g_szTag, g_iUserCredits[ id ], g_szName[ id ] );

	return FMRES_IGNORED;
}

public LoadCredits( id )
{
	static szData[ 256 ],  iTimestamp;

	if(  nvault_lookup( iVault, g_szName[ id ], szData, sizeof ( szData ) -1, iTimestamp ) )
	{
		static szCredits[ 15 ];
		parse( szData, szCredits, sizeof ( szCredits ) -1 );
		g_iUserCredits[ id ] = str_to_num( szCredits );
		return;
	}
	else
	{
		g_iUserCredits[ id ] = 0;
	}
}

public SaveCredits( id )
{
	static szData[ 256 ];
	formatex( szData, sizeof ( szData ) -1, "%i", g_iUserCredits[ id ] );

	nvault_set( iVault, g_szName[ id ], szData );
}

public task_PTRFunctions( )
{
	if( get_pcvar_num( g_iCvarPTREnable ) != 1 )
		return;

	static iPlayers[ 32 ];
	static iPlayersNum;

	get_players( iPlayers, iPlayersNum, "ch" );
	if( !iPlayersNum )
		return;

	static id, i;
	for( i = 0; i < iPlayersNum; i++ )
	{
		id = iPlayers[ i ];

		g_iUserTime[ id ]++;
		static iTime;
		iTime = get_pcvar_num( g_iCvarPTRMinutes ) ;

		if( g_iUserTime[ id ] >= iTime * 60 )
		{
			g_iUserTime[ id ] -= iTime * 60;

			static iCredits;
			iCredits = get_pcvar_num( g_iCvarPTRCredits );

			g_iUserCredits[ id ] += iCredits;
		        ColorChat( id, RED, "^x01[^x04 iPlayCs ^x01] Ai primit^x03 %i^x01 credit pentru ca ai jucat^x04 %i^x01 minute pe^x03 iPlayCs ^x01!", iCredits, iTime );
		        ColorChat( id, RED, "^x01[^x04 iPlayCs ^x01] Joaca in^x03 continuare ^x01si vei primi dinou !" );

			SaveCredits( id );	
		}
	}
}

public ev_DeathMsg( )
{
	if( get_pcvar_num( g_iCvarKREnable ) != 1 )
		return;
	
	new iKiller = read_data( 1 );
	new iVictim = read_data( 2 );
	if( iKiller == iVictim )
		return;
	
	new iCredits = get_pcvar_num( g_iCvarKRCredits );
	new szName[ 32 ];
	get_user_name( iVictim, szName, sizeof( szName ) -1 );
	
	ColorChat( iKiller, RED, "^x04%s^x01 You earned^x03 %i^x01 credits for killing^x03 %s^x01 !", g_szTag, iCredits, szName );
	if( read_data( 3 ) )
	{
		new iHS = get_pcvar_num( g_iCvarKRHSCredits );
		iCredits += iHS;
		ColorChat( iKiller, RED, "^x04%s^x01 You earned another^x03 %i^x01 credits ( HS bonus ) !", g_szTag, iHS );
	}
	
	g_iUserCredits[ iKiller ] += iCredits;
	SaveCredits( iKiller );
}

public ev_SendAudioTerWin( )
{
	static iCvarEnable, iCvarFurienReward;
	iCvarEnable = get_pcvar_num( g_iCvarWTREnable );
	iCvarFurienReward = get_pcvar_num( g_iCvarWTRFurien );

	if( iCvarEnable != 1 || iCvarFurienReward == 0 )
		return;

	GiveTeamReward( FCS_TEAM_FURIEN, iCvarFurienReward );
}

public ev_SendAudioCtWin( )
{
	static iCvarEnable, iCvarAntiReward;
	iCvarEnable = get_pcvar_num( g_iCvarWTREnable );
	iCvarAntiReward = get_pcvar_num( g_iCvarWTRAnti );

	if( iCvarEnable != 1 || iCvarAntiReward == 0 )
		return;

	GiveTeamReward( FCS_TEAM_ANTIFURIEN, iCvarAntiReward );
}

public GiveTeamReward( const CsTeams:iTeam, iCredits )
{
	for( new id = 1; id <= g_iMaxPlayers; id++ )
	{
		if( is_user_connected( id ) && cs_get_user_team( id ) == iTeam )
		{
			ColorChat( id, RED, "^x04%s^x01 Ai primit^x03 %i^x01 credit%s pentru castigarea rundei !", g_szTag, iCredits, iCredits == 1 ? "" : "e" );
			g_iUserCredits[ id ] += iCredits;
			SaveCredits( id );
		}
	}
}

public plugin_end( )
{
	nvault_close( iVault );
}

ColorChat( id, Color:iType, const msg[  ], { Float, Sql, Result, _}:... )
{
	if( !get_playersnum( ) ) return;

	new szMessage[ 256 ];

	switch( iType )
	{
		case NORMAL:	szMessage[ 0 ] = 0x01;

		case GREEN:	szMessage[ 0 ] = 0x04;

		default: 	szMessage[ 0 ] = 0x03;
	}

	vformat( szMessage[ 1 ], 251, msg, 4 );

	szMessage[ 192 ] = '^0';

	new iTeam, iColorChange, iPlayerIndex, MSG_Type;

	if( id )
	{
		MSG_Type  =  MSG_ONE_UNRELIABLE;
		iPlayerIndex  =  id;
	}
	else
	{
		iPlayerIndex  =  CC_FindPlayer( );
		MSG_Type = MSG_ALL;
	}

	iTeam  =  get_user_team( iPlayerIndex );
	iColorChange  =  CC_ColorSelection(  iPlayerIndex,  MSG_Type, iType);

	CC_ShowColorMessage( iPlayerIndex, MSG_Type, szMessage );

	if( iColorChange )	CC_Team_Info( iPlayerIndex, MSG_Type,  TeamName[ iTeam ] );
}

CC_ShowColorMessage( id, const iType, const szMessage[ ] )
{
	static bool:bSayTextUsed;
	static iMsgSayText;

	if( !bSayTextUsed )
	{
		iMsgSayText  =  get_user_msgid( "SayText" );
		bSayTextUsed  =  true;
	}

	message_begin( iType, iMsgSayText, _, id  );
	write_byte(  id  );		
	write_string(  szMessage  );
	message_end( );
}

CC_Team_Info( id, const iType, const szTeam[  ] )
{
	static bool:bTeamInfoUsed;
	static iMsgTeamInfo;
	if(  !bTeamInfoUsed  )
	{
		iMsgTeamInfo  =  get_user_msgid( "TeamInfo" );
		bTeamInfoUsed  =  true;
	}

	message_begin( iType, iMsgTeamInfo, _, id  );
	write_byte( id );
	write_string( szTeam );
	message_end( );

	return 1;
}

CC_ColorSelection( id, const iType, Color:iColorType )
{
	switch( iColorType )
	{
		case RED:	return CC_Team_Info( id, iType, TeamName[ 1 ] );
		case BLUE:	return CC_Team_Info( id, iType, TeamName[ 2 ] );
		case GREY:	return CC_Team_Info( id, iType, TeamName[ 0 ] );
	}

	return 0;
}

CC_FindPlayer( )
{
	new iMaxPlayers  =  get_maxplayers( );

	for( new i = 1; i <= iMaxPlayers; i++ )
		if( is_user_connected( i ) )
			return i;

	return -1;
}
""Copilarie, iarta-ma c-am vrut sa fiu om mare.. ""
User avatar
L E V I N
Scripter eXtreamCS
Scripter eXtreamCS
Posts: 2155
Joined: 24 Aug 2011, 11:24
Detinator Steam: Da
CS Status:
Detinator server CS: ☯∴
SteamID: riseofevo
Reputatie: Scripter eXtreamCS
Nume anterior: Adryyy
Location: ҳ̸Ҳ̸ҳ
Has thanked: 33 times
Been thanked: 349 times
Contact:

18 Aug 2013, 21:19

O sa il testez :)

Astept si Eventul :>
Nu fac nimic contra cost! Faceți cerere bine detaliată aici, pe forum. Nu-mi mai dați add pe Steam doar pentru a mă avea în lista de prieteni.
Am cont și activez doar aici! Aveți grijă la cei ce încearcă să mă copieze..Puteți lua legătura cu mine dacă aveți o problemă/nelămurire în acest caz.
* Inactiv momentan.
Rony
Utilizator neserios (tepar)
Utilizator neserios (tepar)
Posts: 1150
Joined: 11 Mar 2013, 11:43
Detinator Steam: Da
CS Status: CO-FOUNDER BETANO
Detinator server CS: CS1.6 , CS:GO
SteamID: 31r1
Reputatie: Membru Club eXtreamCS (1 luna)
Membru Club eXtreamCs (28 Feb)
Utilizator neserios (tepar)
Location: NAPOLI
Has thanked: 187 times
Been thanked: 66 times
Contact:

18 Aug 2013, 21:32

Adryyy wrote:O sa il testez :)

Astept si Eventul :>
sa-mi spui si mie daca merge,daca omori pe cineva primesti 1 credit si daca dai hs primesti 3 nu?
User avatar
L E V I N
Scripter eXtreamCS
Scripter eXtreamCS
Posts: 2155
Joined: 24 Aug 2011, 11:24
Detinator Steam: Da
CS Status:
Detinator server CS: ☯∴
SteamID: riseofevo
Reputatie: Scripter eXtreamCS
Nume anterior: Adryyy
Location: ҳ̸Ҳ̸ҳ
Has thanked: 33 times
Been thanked: 349 times
Contact:

18 Aug 2013, 21:43

Rony wrote:
Adryyy wrote:O sa il testez :)

Astept si Eventul :>
sa-mi spui si mie daca merge,daca omori pe cineva primesti 1 credit si daca dai hs primesti 3 nu?
Merge bos :) poti modifica cate credite sa primeasca la orice cvar :)) eu am pus asa dupa placu meu
Nu fac nimic contra cost! Faceți cerere bine detaliată aici, pe forum. Nu-mi mai dați add pe Steam doar pentru a mă avea în lista de prieteni.
Am cont și activez doar aici! Aveți grijă la cei ce încearcă să mă copieze..Puteți lua legătura cu mine dacă aveți o problemă/nelămurire în acest caz.
* Inactiv momentan.
User avatar
L E V I N
Scripter eXtreamCS
Scripter eXtreamCS
Posts: 2155
Joined: 24 Aug 2011, 11:24
Detinator Steam: Da
CS Status:
Detinator server CS: ☯∴
SteamID: riseofevo
Reputatie: Scripter eXtreamCS
Nume anterior: Adryyy
Location: ҳ̸Ҳ̸ҳ
Has thanked: 33 times
Been thanked: 349 times
Contact:

19 Aug 2013, 17:52

24H Astept sa faci si Bomb Eventul Askhanar
Nu fac nimic contra cost! Faceți cerere bine detaliată aici, pe forum. Nu-mi mai dați add pe Steam doar pentru a mă avea în lista de prieteni.
Am cont și activez doar aici! Aveți grijă la cei ce încearcă să mă copieze..Puteți lua legătura cu mine dacă aveți o problemă/nelămurire în acest caz.
* Inactiv momentan.
User avatar
L E V I N
Scripter eXtreamCS
Scripter eXtreamCS
Posts: 2155
Joined: 24 Aug 2011, 11:24
Detinator Steam: Da
CS Status:
Detinator server CS: ☯∴
SteamID: riseofevo
Reputatie: Scripter eXtreamCS
Nume anterior: Adryyy
Location: ҳ̸Ҳ̸ҳ
Has thanked: 33 times
Been thanked: 349 times
Contact:

21 Aug 2013, 12:42

// 24 H //
Askhanar wrote:@paqus4s daca nu stii ce faci nu te pune sa dai sfaturi..
linia aia nu face decat sa le dea voie doar la cei din echipa ct si t sa depuna.. iar dupa ce ai modificat`o tu.. le da voie si la spectatori.

pluginul functioneaza si la cei morti si la cei vii. ( ma rog.. comenzile ).
vezi sa nu ai vreun plugin care se leaga de chat.. si opreste comanda in el.
Astept eventu si o idee.Cum ai facut tu cu mesajele la hs si kill sa poti pune si bonus daca il ia cu cutitul sau cu grenada :o3
Ma gandeam si asa...daca ii da hs sa ii dea bonusul atat fara kill-ul normal.La omor normal creditele lui la knife knife la grenanda grenada...adica sa fie fiecare ale lui...
Nu fac nimic contra cost! Faceți cerere bine detaliată aici, pe forum. Nu-mi mai dați add pe Steam doar pentru a mă avea în lista de prieteni.
Am cont și activez doar aici! Aveți grijă la cei ce încearcă să mă copieze..Puteți lua legătura cu mine dacă aveți o problemă/nelămurire în acest caz.
* Inactiv momentan.
User avatar
Ulquiorra
Scripter eXtreamCS
Scripter eXtreamCS
Posts: 2088
Joined: 25 Jul 2010, 16:29
Detinator Steam: Da
CS Status: A mai trecut o zi asteptand una mai buna
Detinator server CS: Retras.
SteamID: STEAM_0:1:318247XX
Reputatie: Scripter eXtreamCS
Nick anterior: sPuf ?, a^ml), Loca Tapioca, Askhanar
Fost Moderator ajutator
Location: Braila, Romania.
Has thanked: 214 times
Been thanked: 1140 times
Contact:

21 Aug 2013, 15:02

am adaugat pluginul acum 30 min in postul 2 din Furien Credits System.
""Copilarie, iarta-ma c-am vrut sa fiu om mare.. ""
User avatar
L E V I N
Scripter eXtreamCS
Scripter eXtreamCS
Posts: 2155
Joined: 24 Aug 2011, 11:24
Detinator Steam: Da
CS Status:
Detinator server CS: ☯∴
SteamID: riseofevo
Reputatie: Scripter eXtreamCS
Nume anterior: Adryyy
Location: ҳ̸Ҳ̸ҳ
Has thanked: 33 times
Been thanked: 349 times
Contact:

21 Aug 2013, 15:51

Ti-am lasat un pm....:o3 ( am vzt ca ai pus e eventu )
Nu fac nimic contra cost! Faceți cerere bine detaliată aici, pe forum. Nu-mi mai dați add pe Steam doar pentru a mă avea în lista de prieteni.
Am cont și activez doar aici! Aveți grijă la cei ce încearcă să mă copieze..Puteți lua legătura cu mine dacă aveți o problemă/nelămurire în acest caz.
* Inactiv momentan.
Post Reply

Return to “Cereri”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 10 guests