Furien Credits System [ update 05/04/16 v1.4.6 ]

Pluginuri pentru modul AmxModX.

Moderators: Moderatori ajutatori, Moderatori

Post Reply
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:

01 Jul 2013, 00:06

Descriere: Acesta este un plugin de credite pentru modul furien.
Deasemenea poate fi folosit si in alte moduri.
In ce consta acest plugin? Ei bine, cand ai 16000$, prin simpla comanda, /deposit, iti transformi banii in 1 credit.
Nu exista limita de credite.
Creditele se salveaza pe nume.

Plugin-ul are si native, cu care poti afla/modifica creditele unui jucator, din alte plugine.


Descarcare:
Furien Credits System 1.4.6 | Afiseaza codul
#include < amxmodx >
#include < amxmisc >
#include < cstrike >
#include < fakemeta >
#include < hamsandwich >
#include < nvault >
//#include < CC_ColorChat >

#pragma semicolon 1


#define PLUGIN "Furien Credits System"
#define VERSION "1.4.6" // Sper sa nu mai fie buguri.

#define	ONE_DAY_IN_SECONDS	86400

// |-- CC_ColorChat --|

enum Color
{
	NORMAL = 1, 		// Culoarea care o are jucatorul setata in cvar-ul scr_concolor.
	GREEN, 			// Culoare Verde.
	TEAM_COLOR, 		// Culoare Rosu, Albastru, Gri.
	GREY, 			// Culoarea Gri.
	RED, 			// Culoarea Rosu.
	BLUE, 			// Culoarea Albastru.
};

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

// |-- CC_ColorChat --|

new const g_szTag[ ] = "[Furien Credits]";

new const g_szGiveCreditsFlag[ ] = "a";

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

new g_iCvarPruneDays;
new g_iCvarEntry;
new g_iCvarRetire;
new iVault;

public plugin_init( )
{
	register_plugin( PLUGIN, VERSION, "Askhanar" );
	register_cvar( "fcs_version", VERSION, FCVAR_SERVER | FCVAR_SPONLY ); 

	g_iCvarPruneDays = register_cvar( "fcs_prunedays", "15" );
	g_iCvarEntry = register_cvar( "fcs_entry_credits", "300" );
	g_iCvarRetire = register_cvar( "fcs_maxretrieve", "0" );
	
	register_clcmd( "say", "ClCmdSay" );
	register_clcmd( "say_team", "ClCmdSay" );
	
	register_clcmd( "say /depozit", "ClCmdSayDepozit" );
	register_clcmd( "say /deposit", "ClCmdSayDepozit" );
	register_clcmd( "say_team /depozit", "ClCmdSayDepozit" );
	register_clcmd( "say_team /deposit", "ClCmdSayDepozit" );
	
	register_clcmd( "say /retrage", "ClCmdSayRetrage" );
	register_clcmd( "say /withdraw", "ClCmdSayRetrage" );
	register_clcmd( "say_team /retrage", "ClCmdSayRetrage" );
	register_clcmd( "say_team /withdraw", "ClCmdSayRetrage" );
	
	register_clcmd( "fcs_credite", "ClCmdCredits" );
	register_clcmd( "fcs_credits", "ClCmdCredits" );
	
	register_clcmd( "amx_give_credits", "ClCmdGiveCredits" );
	register_clcmd( "amx_take_credits", "ClCmdTakeCredits" );
	
	RegisterHam( Ham_Spawn, "player", "ham_SpawnPlayerPost", true );
	register_forward( FM_ClientUserInfoChanged, "Fwd_ClientUserInfoChanged" );

}

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;
	
	g_iUserRetired[ id ] = 0;
	get_user_name( id, g_szName[ id ], sizeof ( g_szName[] ) -1 );
	LoadCredits( id );
	
	return PLUGIN_CONTINUE;
	
}

public client_disconnect( id )
{
	if( is_user_bot( id ) )
		return PLUGIN_CONTINUE;
		
	g_iUserRetired[ id ] = 0;
	SaveCredits( id );
	
	return PLUGIN_CONTINUE;
	
}

public ClCmdSay( id )
{
	static szArgs[192];
	read_args( szArgs, sizeof ( szArgs ) -1 );
	
	if( !szArgs[ 0 ] )
		return PLUGIN_CONTINUE;
	
	new szCommand[ 15 ];
	remove_quotes( szArgs );
	
	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 PLUGIN_HANDLED;
	}
	
	return PLUGIN_CONTINUE;
}

public ClCmdCredits( id )
{
	if( !is_user_connected( id ) )
		return PLUGIN_HANDLED;
		
	new szArg[ 32 ];
    	read_argv( 1, szArg, sizeof ( szArg ) -1 );

	if( equal( szArg, "" ) ) 
	{
		
		ColorChat( id, RED, "^x04%s^x01 Ai^x03 %i^x01 credite.", g_szTag, g_iUserCredits[ id ] );
		return PLUGIN_HANDLED;
	}
	
    	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 PLUGIN_HANDLED;
	}

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

public ClCmdSayDepozit( id)
{
	
	if( !is_user_connected( id ) )
		return PLUGIN_HANDLED;
		
	new CsTeams:iTeam = cs_get_user_team( id );
	
	if( CS_TEAM_T <= iTeam <= CS_TEAM_CT )
	{
		new iMoney = cs_get_user_money( id );
		if( iMoney >= 16000 )
		{
			
			ColorChat( id, RED, "^x04%s^x01 Ai depozitat^x03 16000$^x01 si ai primit^x03 1^x01 credit.", g_szTag );
			cs_set_user_money( id, 0 );
			g_iUserCredits[ id ] += 1;
			
			SaveCredits( id );
			return PLUGIN_HANDLED;
		}
		else
		{
			ColorChat( id, RED, "^x04%s^x01 Iti trebuie^x03 16000$^x01 pentru a putea depozita.", g_szTag );
			return PLUGIN_HANDLED;
		}
	}
	
	return PLUGIN_HANDLED;

}

public ClCmdSayRetrage( id)
{
	
	new CsTeams:iTeam = cs_get_user_team( id );
	
	if( CS_TEAM_T <= iTeam <= CS_TEAM_CT )
	{
		
		if( g_iUserCredits[ id ] > 0 )
		{
			new iMaxRetrieve = get_pcvar_num( g_iCvarRetire );
			if( iMaxRetrieve > 0 )
			{
				if( g_iUserRetired[ id ] >= iMaxRetrieve )
				{
					ColorChat( id, RED, "^x04%s^x01 Ai retras deja^x03 %i^x01 credit%s runda asta^x01.", g_szTag, iMaxRetrieve, iMaxRetrieve == 1 ? "" : "e" );
					return PLUGIN_HANDLED;
				}
			}
			
			new iMoney = cs_get_user_money( id );
			
			ColorChat( id, RED, "^x04%s^x01 Ai retras^x03 1^x01 credit si, ai primi^x03 16000$^x01.", g_szTag );
			cs_set_user_money( id, iMoney + 16000 );
			
			g_iUserCredits[ id ] -=1;
			g_iUserRetired[ id ]++;
			
			SaveCredits( id );
			
			if( ( iMoney + 16000 ) > 16000 )
			{
				ColorChat( id, RED, "^x04%s^x03 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$^x01.", g_szTag );
				return PLUGIN_HANDLED;
			}
		}
		else
		{
			ColorChat(id, RED, "^x04%s^x03 NU^x01 ai ce sa retragi, ai^x03 0^x01 credite.", g_szTag );
			return PLUGIN_HANDLED;
		}
		
	}
	
	return PLUGIN_HANDLED;

}

public ClCmdGiveCredits( id )
{
	
	if( !( get_user_flags( id ) & read_flags( g_szGiveCreditsFlag ) ) )
	{
		client_cmd( id, "echo NU ai acces la aceasta comanda!" );
		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, "" ) )
	{
		client_cmd( id, "echo amx_give_credits < nume/ @ALL/ @T/ @CT > < credite >" );
		return PLUGIN_HANDLED;
	}
	
	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 PLUGIN_HANDLED;
	}
	
	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, RED, "^x04^%s^x01 Adminul^x03 %s^x01 le-a dat^x03 %i^x01 credite tuturor jucatorilor!", g_szTag, szName, iCredits );
					return PLUGIN_HANDLED;
				}
			}
			
			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 PLUGIN_HANDLED;
					}
					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, RED, "^x04^%s^x01 Adminul^x03 %s^x01 le-a dat^x03 %i^x01 credite jucatorilor de la^x03 TERO^x01!", g_szTag, szName, iCredits );
					return PLUGIN_HANDLED;
				}
			}
			
			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 PLUGIN_HANDLED;
					}
					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, RED, "^x04^%s^x01 Adminul^x03 %s^x01 le-a dat^x03 %i^x01 credite jucatorilor de la^x03 CT^x01!", g_szTag, szName, iCredits );
					return PLUGIN_HANDLED;
				}
			}
		}
	}
		
	new iPlayer = cmd_target( id, szFirstArg, 8 );
	if( !iPlayer )
	{
		client_cmd( id, "echo Jucatorul %s nu a fost gasit!", szFirstArg );
		return PLUGIN_HANDLED;
	}
	
	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, RED, "^x04%s^x01 Adminul^x03 %s^x01 i-a dat^x03 %i^x01 credite lui^x03 %s^x01.", g_szTag, szName, iCredits, _szName );
	
	return PLUGIN_HANDLED;
	
	
}

public ClCmdTakeCredits( id )
{
	
	if( !( get_user_flags( id ) & read_flags( g_szGiveCreditsFlag ) ) )
	{
		client_cmd( id, "echo NU ai acces la aceasta comanda!" );
		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, "" ) )
	{
		client_cmd( id, "echo amx_take_credits < nume > < credite >" );
		return PLUGIN_HANDLED;
	}
	
	new iCredits = str_to_num( szSecondArg );
	if( iCredits <= 0 )
	{
		client_cmd( id, "echo Valoarea creditelor trebuie sa fie mai mare decat 0!" );
		return PLUGIN_HANDLED;
	}
			
	new iPlayer = cmd_target( id, szFirstArg, 8 );
	if( !iPlayer )
	{
		client_cmd( id, "echo Jucatorul %s nu a fost gasit!", szFirstArg );
		return PLUGIN_HANDLED;
	}
	
	if( g_iUserCredits[ iPlayer ] < iCredits )
	{
		client_cmd( id, "echo Jucatorul %s nu are atatea credite!Are doar %i", szFirstArg, g_iUserCredits[ iPlayer ] );
		return PLUGIN_HANDLED;
	}
	
	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, RED, "^x04%s^x01 Adminul^x03 %s^x01 i-a sters^x03 %i^x01 credite lui^x03 %s^x01.", g_szTag, szName, iCredits, _szName );
	
	return PLUGIN_HANDLED;
	
	
}

public ham_SpawnPlayerPost( id )
{
	if( !is_user_alive( id ) )
		return;
		
	g_iUserRetired[ id ] = 0;
}

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^x03 %s^x01 !", g_szTag, g_szName[ id ], szNewName );
	ColorChat( id, RED, "^x04%s^x01 Am salvat^x03 %i^x01 credite pe numele^x03 %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 credite de pe noul nume (^x03 %s^x01 ) !", g_szTag, g_iUserCredits[ id ], g_szName[ id ] );
	
	return FMRES_IGNORED;
}


public LoadCredits( id )
{
	iVault  =  nvault_open(  "FurienCreditsSystem"  );
	
	if(  iVault  ==  INVALID_HANDLE  )
	{
		set_fail_state(  "nValut returned invalid handle!"  );
	}
	
	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 ] = get_pcvar_num( g_iCvarEntry );
	}
	
	nvault_close( iVault );
	
}


public SaveCredits(  id  )
{
	iVault  =  nvault_open(  "FurienCreditsSystem"  );
	
	if(  iVault  ==  INVALID_HANDLE  )
	{
		set_fail_state(  "nValut returned invalid handle!"  );
	}
	
	static szData[ 256 ];
	formatex( szData, sizeof ( szData ) -1, "%i", g_iUserCredits[ id ] );
	
	nvault_set( iVault, g_szName[ id ], szData );
	nvault_close( iVault );
}

public plugin_end( )
{
	iVault  =  nvault_open(  "FurienCreditsSystem"  );
	
	if(  iVault  ==  INVALID_HANDLE  )
	{
		set_fail_state(  "nValut returned invalid handle!"  );
	}
	
	new iDays = get_pcvar_num( g_iCvarPruneDays );
	if( iDays > 0 )
	{
		nvault_prune( iVault, 0, get_systime( ) - ( iDays * ONE_DAY_IN_SECONDS ) );
	}
	
	nvault_close( iVault );
}

// |-- CC_ColorChat --|

ColorChat(  id, Color:iType, const msg[  ], { Float, Sql, Result, _}:...  )
{
	
	// Daca nu se afla nici un jucator pe server oprim TOT. Altfel dam de erori..
	if( !get_playersnum( ) ) return;
	
	new szMessage[ 256 ];

	switch( iType )
	{
		 // Culoarea care o are jucatorul setata in cvar-ul scr_concolor.
		case NORMAL:	szMessage[ 0 ] = 0x01;
		
		// Culoare Verde.
		case GREEN:	szMessage[ 0 ] = 0x04;
		
		// Alb, Rosu, Albastru.
		default: 	szMessage[ 0 ] = 0x03;
	}

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

	// Ne asiguram ca mesajul nu este mai lung de 192 de caractere.Altfel pica server-ul.
	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 PLUGIN_HANDLED;
}

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 PLUGIN_CONTINUE;
}

CC_FindPlayer(  )
{
	new iMaxPlayers  =  get_maxplayers(  );
	
	for( new i = 1; i <= iMaxPlayers; i++ )
		if(  is_user_connected( i )  )
			return i;
	
	return -1;
}

// |-- CC_ColorChat --|
Nume: Furien Credits System
Versiune: v0.4.6
Link oficial: http://www.extreamcs.com/forum

Instalare:
1. Fisierul FurienCreditsSystem.sma il puneti in addons/amxmodx/scripting
2. Fisierul FurienCreditsSystem.amxx il puneti in addons/amxmodx/plugins
3. Intrati in fisierul addons/amxmodx/configs/plugins.ini si adaugati la urma:

Code: Select all

FurienCreditsSystem.amxx
4. Alti pasi necesari....

Modificati in fisierul sursa:

Code: Select all

new const g_szGiveCreditsFlag[ ] = "a";
in loc de "a" puneti flagul pentru comenzize de mai jos.

NEW!
Cvar-uri (se adauga in fisierul amxmodx\configs\amxx.cfg):
  • fcs_prunedays "15" - sterge toate inregistrarile din nvault care nu au intrat pe server de x zile ( la fiecare sfarsit de mapa ) | setati valoarea 0 pentru a dezactiva functia.
    NEW!fcs_entry_credits "300" - cate credite primesc cand intra pentru prima data pe server.
    NEW! [ 20.03.2014 ]fcs_maxretrieve "0" - nr maxim de credite pe care il pot retrage intr-o runda. ( 0 fara limita de retragere )

Comenzi administrative (se tasteaza in consola si trebuie sa fiti administrator):
  • amx_give_credits < nume/ @ALL/ @CT/ @T > < credite > - dai credite cuiva.
    amx_take_credits < nume > - ii stergi din credite cuiva.

    Comenzi publice (se tasteaza in joc prin apasarea tastei Y):
    • /credits - aflii cate credite ai
      /credits < nume > - aflii cate credite are jucatorul respectiv
      /deposit sau /depozit - depozitezi 16000$ si primesti un credit
      /retrage sau /withdraw - retragi un credit si premesti 16000$
Module necesare (se sterge ; din fata modulului de mai jos; acestea le gasiti in fisierul amxmodx\configs\modules.ini):
- cstrike
- fakemeta
- nvault
Imagini | Afiseaza codul
Image

LE:

Image

Pentru scripteri sau cei ce se pricep cat de cat:
fcs.inc | 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);
}

Exemplu de folosire:
FCS Example | Afiseaza codul
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <fcs>

#define PLUGIN "FCS Example"
#define VERSION "1.0"


public plugin_init( )
{
	register_plugin( PLUGIN, VERSION, "Askhanar" );
	
	register_clcmd( "say /test", "say_Credite" );
	register_clcmd( "say /test2", "say_FreeCredits" );
	// Add your code here...
}

public say_Credite( id )
{
	new iCredits = fcs_get_user_credits( id );
	client_print( id, print_chat, "[FCS TEST]: Ai %i credite!", iCredits );
}

public say_FreeCredits( id )
{
	new iCredits = fcs_get_user_credits( id );
	new iNewCredits = fcs_set_user_credits( id, iCredits + 5 );
	client_print( id, print_chat, "[FCS TEST]: Ai primit %i credite, si acum ai in total %i !", iCredits, iNewCredits );
}
Changelog:

Code: Select all

[ --.--.---- ]
- urmeaza sa completez.

Acum puteti vedea ce servere folosesc acest plugin. Click


Ii rog pe toti cei ce-l vor folosi sa-mi dea macar un Multumesc.

Alte Informatii:
WinNk. # wrote:
Ulquiorra wrote:cei ce le pica serverul, incercati sa stergeti din vault. FurienCreditsSystem.vault si sa instalati pluginul cu serverul oprit.
tot cu serverul oprit sa stergeti si fisierul respectiv in caz ca el exista.
daca tot nu merge.. incercati sa puneti pluginul de credite in diferite 'pozitii' in plugins.ini ( adica mai inainte de x plugine mai la urma mai la mijloc.. )

A functionat, mersi :*

NEW [ 05.04.2016 ] Imbunatatiri aduse in noua versiune

Dupa cum am promis, am avut ceva timp liber si am citit toate paginile topicului ( al dracu' de multe pagini ) si am incercat sa fixec cam ce era de fixat si desigur ce a mers fixat!
Toate sursele modificate inclusiv AIO ( fara shop ).

- toate versiunile au fost modificate in 1.x.x .
- unele static au fost facute new .
- fisierul .vault nu mai ramane deschis toata durata hartii .
- am modificat salvarea/incarcare si fisierul .vault este deschis si inchis la fiecare interogare .
( sper sa nu mai pice serverul si sa nu mai fie necesara stergerea fisierului .vault inainte de instalarea pluginului )
- adaugate/scoase/imbunatatite unele verificari.
Last edited by Ulquiorra on 05 Apr 2016, 20:32, edited 22 times in total.
""Copilarie, iarta-ma c-am vrut sa fiu om mare.. ""
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:

01 Jul 2013, 00:31

la cererea unui user( Adryyy ), am creat o serie de plugin-uri ce ruleaza impreuna cu pluginul de credite.

NEW [ 05.04.2016 ] Imbunatatiri aduse in noua versiune

Dupa cum am promis, am avut ceva timp liber si am citit toate paginile topicului ( al dracu' de multe pagini ) si am incercat sa fixec cam ce era de fixat si desigur ce a mers fixat!
Toate sursele modificate inclusiv AIO ( fara shop ).

- toate versiunile au fost modificate in 1.x.x
- unele static au fost facute new .
- fisierul .vault nu mai ramane deschis toata durata hartii .
- am modificat salvarea/incarcare si fisierul .vault este deschis si inchis la fiecare interogare .
( sper sa nu mai pice serverul si sa nu mai fie necesara stergerea fisierului .vault inainte de instalarea pluginului )
- adaugate/scoase/imbunatatite unele verificari.

FCS Played Time Reward
FCS PlayedTime Reward 1.2.0 | Afiseaza codul
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
//#include <CC_ColorChat>
//#include <fcs>

#define PLUGIN "FCS PlayedTime Reward"
#define VERSION "1.2.0"  // 1.x.x  noi verificari/imbunatatiri

#define TASK_pentru	06091993

enum Color
{
	NORMAL = 1, 		// Culoarea care o are jucatorul setata in cvar-ul scr_concolor.
	GREEN, 			// Culoare Verde.
	TEAM_COLOR, 		// Culoare Rosu, Albastru, Gri.
	GREY, 			// Culoarea Gri.
	RED, 			// Culoarea Rosu.
	BLUE, 			// Culoarea Albastru.
}

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





//--| Furien Credits System .inc file
/*
 * 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);
}

//--| End of Furien Credits System .inc file


new const g_szTag[ ] = "[Furien Credits]";

new g_iCvarPTREnable;
new g_iCvarPTRMinutes;
new g_iCvarPTRCredits;

new g_iUserTime[ 33 ];

public plugin_init( )
{
	register_plugin( PLUGIN, VERSION, "Askhanar" );
	
	g_iCvarPTREnable = register_cvar( "fcs_pentru_enable", "1" );
	g_iCvarPTRMinutes = register_cvar( "fcs_pentru_minutes", "5" );
	g_iCvarPTRCredits = register_cvar( "fcs_pentru_credits", "15" );
	
	set_task( 1.0, "task_Time", TASK_pentru, _, _, "b", 0 );
	// Add your code here...
}



public client_putinserver( id )
{
	if( is_user_bot( id ) || is_user_hltv( id ) )
		return PLUGIN_CONTINUE;
	
	g_iUserTime[ id ] = 0;
	
	return PLUGIN_CONTINUE;
}

public client_disconnect( id )
{
	if( is_user_bot( id ) || is_user_hltv( id ) )
		return PLUGIN_CONTINUE;
		
	g_iUserTime[ id ] = 0;
	
	return PLUGIN_CONTINUE;
}

public task_PTRFunction( )
{
	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 ]++;
		
		new iTime;
		iTime = get_pcvar_num( g_iCvarPTRMinutes ) ;
		
		if( g_iUserTime[ id ] >= iTime * 60 )
		{
			g_iUserTime[ id ] -= iTime * 60;
			
			new iCredits = get_pcvar_num( g_iCvarPTRCredits );
			
			fcs_add_user_credits( id, iCredits );
			ColorChat( id, RED, "^x04%s^x01 Ai primit^x03 %i^x01 credite pentru^x03 %i^x01 minute jucate!",
				g_szTag, iCredits, iTime );
				
		}
	}
	
}


ColorChat(  id, Color:iType, const msg[  ], { Float, Sql, Result, _}:...  )
{
	
	// Daca nu se afla nici un jucator pe server oprim TOT. Altfel dam de erori..
	if( !get_playersnum( ) ) return;
	
	new szMessage[ 256 ];

	switch( iType )
	{
		 // Culoarea care o are jucatorul setata in cvar-ul scr_concolor.
		case NORMAL:	szMessage[ 0 ] = 0x01;
		
		// Culoare Verde.
		case GREEN:	szMessage[ 0 ] = 0x04;
		
		// Alb, Rosu, Albastru.
		default: 	szMessage[ 0 ] = 0x03;
	}

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

	// Ne asiguram ca mesajul nu este mai lung de 192 de caractere.Altfel pica server-ul.
	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;
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ ansicpg1252\\ deff0{\\ fonttbl{\\ f0\\ froman\\ fcharset0 Times New Roman;}}\n{\\ colortbl ;\\ red0\\ green0\\ blue0;}\n\\ viewkind4\\ uc1\\ pard\\ cf1\\ lang11274\\ f0\\ fs24 \n\\ par }
*/
Cvar-uri (se adauga in fisierul amxmodx\configs\amxx.cfg):
  • fcs_pentru_enable 1 - activeaza/dezactiveaza pluginul
    fcs_pentru_minutes 5 - minutele jucate ca sa primeasca y credite. ( din x in x minute )
    fcs_pentru_credits 15 - creditele care le primeste din in x in x minute.


FCS Kill Reward
FCS Kill Reward 1.1.5 | Afiseaza codul
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
//include <fcs>

#define PLUGIN "FCS Kill Reward"
#define VERSION "1.1.5"   // 1.x.x  noi verificari/imbunatatiri


//--| Furien Credits System .inc file
/*
 * 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);
}

//--| End of Furien Credits System .inc file

new g_iCvarEnable;
new g_iCvarCredits;
new g_iCvarHSCredits;

public plugin_init( )
{
	register_plugin( PLUGIN, VERSION, "Askhanar" );
	
	g_iCvarEnable = register_cvar( "fcs_kr_enable", "1" );
	g_iCvarCredits = register_cvar( "fcs_kr_credits", "7" );
	g_iCvarHSCredits = register_cvar( "fcs_kr_hscredits", "3" );//( bonus, fcs_kr_credits + fcs_kr_hscredits )
	
	register_event( "DeathMsg","ev_DeathMsg", "a")
	
}

public ev_DeathMsg()
{
	if( get_pcvar_num( g_iCvarEnable ) != 1 )
		return;
		
	new iKiller = read_data( 1 );
	if( iKiller == read_data( 2 ) )
		return;
		
	new iCredits = get_pcvar_num( g_iCvarCredits );
	
	if( read_data( 3 ) )
		iCredits += get_pcvar_num( g_iCvarHSCredits );
		
	fcs_add_user_credits( iKiller, iCredits );
	
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ froman\\ fcharset0 Times New Roman;}}\n{\\ colortbl ;\\ red0\\ green0\\ blue0;}\n\\ viewkind4\\ uc1\\ pard\\ cf1\\ lang11274\\ f0\\ fs24 \n\\ par }
*/

Cvar-uri (se adauga in fisierul amxmodx\configs\amxx.cfg):
  • fcs_kr_enable 1 - activeaza/dezactiveaza plugin-ul.
    fcs_kr_credits 7 - cate credite primeste la fiecare kill.
    fcs_kr_hscredits 3 - cate credite primeste bonus daca a dat HeadShot ( => 7 + 3 = 10 )



FCS Transfer System
FCS Transfer System 1.1.0 | Afiseaza codul
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
//#include <CC_ColorChat>
//#include <fcs>

#define PLUGIN "FCS Transfer System"
#define VERSION "1.1.0"  // 1.x.x  noi verificari/imbunatatiri

enum Color
{
	NORMAL = 1, 		// Culoarea care o are jucatorul setata in cvar-ul scr_concolor.
	GREEN, 			// Culoare Verde.
	TEAM_COLOR, 		// Culoare Rosu, Albastru, Gri.
	GREY, 			// Culoarea Gri.
	RED, 			// Culoarea Rosu.
	BLUE, 			// Culoarea Albastru.
}

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





//--| Furien Credits System .inc file
/*
 * 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);
}

//--| End of Furien Credits System .inc file

new const g_szTag[ ] = "[Furien Credits]";

new g_iCvarEnable;
new g_iCvarMaxCredits;

public plugin_init( )
{
	register_plugin( PLUGIN, VERSION, "Askhanar" );
	
	register_clcmd( "say", "HookClCmdSayOrSayTeam" );
	register_clcmd( "say_team", "HookClCmdSayOrSayTeam" );
	
	register_clcmd( "fcs_donate", "ClCmdFcsDonate" );
	register_clcmd( "fcs_transfer", "ClCmdFcsDonate" );
	
	g_iCvarEnable = register_cvar("fcs_transfer_enable", "1" );
	g_iCvarMaxCredits = register_cvar("fcs_transfer_maxcredits", "50" );
}

	

public HookClCmdSayOrSayTeam( id )
{
	static szArgs[ 192 ], szCommand[ 192 ];
	read_args( szArgs, sizeof ( szArgs ) -1 );
	
	if( !szArgs[ 0 ] )
		return PLUGIN_CONTINUE;
	
	remove_quotes( szArgs );
	
	if( equal( szArgs,  "/transfer", strlen(  "/transfer" ) )
		|| equal( szArgs,  "/donate",  strlen(  "/donate" ) ) )
	{
		replace( szArgs, sizeof ( szArgs ) -1, "/", ""  );
		formatex( szCommand, sizeof ( szCommand ) -1, "fcs_%s", szArgs );
		client_cmd( id, szCommand );
		return PLUGIN_HANDLED;
	}
	
	return PLUGIN_CONTINUE;
}

public ClCmdFcsDonate( id )
{
	if(  get_pcvar_num(  g_iCvarEnable  )  !=  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 ( szFirstArg ) -1 );
	
	if( !szFirstArg[ 0 ] || !szSecondArg[ 0 ] )
	{
		ColorChat( id, RED, "^x04%s^x01 Folosire:^x03 /transfer^x01 sau^x03 /donate^x01 <^x03 nume^x01 > <^x03 xp^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 credite.", 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 0.", g_szTag );
		return PLUGIN_HANDLED;
	}
	
	new iMaxCredits = get_pcvar_num( g_iCvarMaxCredits );
	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;
	}
	new iUserCredits = fcs_get_user_credits( id );
	
	if( iUserCredits <  iCredits  )
	{
		ColorChat(  id,  RED, "^x04%s^x01 Nu ai destule credite, ai doar^x03 %i credit%s^x01.",  g_szTag, iUserCredits, iUserCredits == 1 ? "" : "e"  );
		return 1;
	}
	
	fcs_sub_user_credits( id, iCredits );
	fcs_add_user_credits( iPlayer, iCredits );
	
	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^03 %i credit%s^x01 lui^x03 %s^x01 .", g_szTag, szFirstName, iCredits, iCredits == 1 ? "" : "e", szSecondName );
	return PLUGIN_HANDLED;
}

ColorChat(  id, Color:iType, const msg[  ], { Float, Sql, Result, _}:...  )
{
	
	// Daca nu se afla nici un jucator pe server oprim TOT. Altfel dam de erori..
	if( !get_playersnum( ) ) return;
	
	new szMessage[ 256 ];

	switch( iType )
	{
		 // Culoarea care o are jucatorul setata in cvar-ul scr_concolor.
		case NORMAL:	szMessage[ 0 ] = 0x01;
		
		// Culoare Verde.
		case GREEN:	szMessage[ 0 ] = 0x04;
		
		// Alb, Rosu, Albastru.
		default: 	szMessage[ 0 ] = 0x03;
	}

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

	// Ne asiguram ca mesajul nu este mai lung de 192 de caractere.Altfel pica server-ul.
	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;
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ froman\\ fcharset0 Times New Roman;}}\n{\\ colortbl ;\\ red0\\ green0\\ blue0;}\n\\ viewkind4\\ uc1\\ pard\\ cf1\\ lang11274\\ f0\\ fs24 \n\\ par }
*/
Cvar-uri (se adauga in fisierul amxmodx\configs\amxx.cfg):
  • fcs_transfer_enable 1 - activeaza / dezactiveaza transferul de credite.
    fcs_transfer_maxcredits 50 - cantitatea maxima de credite pe care o poti transfera o data.
Comenzi publice (se tasteaza in joc prin apasarea tastei Y):
  • /transfer <nume> <credite> - transferi x credite jucatorului specificat.
    • /donate <nume> <credite> - transferi x credite jucatorului specificat.


FCS WinTeam Rewards
FCS WinTeam Rewards 1.1.0 | Afiseaza codul
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <cstrike>
//#include <CC_ColorChat>
//#include <fcs>

#define PLUGIN "FCS Winteam Rewards"
#define VERSION "1.1.0"  // 1.x.x  noi verificari/imbunatatiri

#define FCS_TEAM_FURIEN 	CS_TEAM_T
#define FCS_TEAM_ANTIFURIEN	CS_TEAM_CT


enum Color
{
	NORMAL = 1, 		// Culoarea care o are jucatorul setata in cvar-ul scr_concolor.
	GREEN, 			// Culoare Verde.
	TEAM_COLOR, 		// Culoare Rosu, Albastru, Gri.
	GREY, 			// Culoarea Gri.
	RED, 			// Culoarea Rosu.
	BLUE, 			// Culoarea Albastru.
}

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





//--| Furien Credits System .inc file
/*
 * 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);
}

//--| End of Furien Credits System .inc file

new const g_szTag[ ] = "[Furien Credits]";

new g_iCvarEnable;
new g_iCvarWinteamFurien;
new g_iCvarWinteamAnti;

public plugin_init( )
{
	register_plugin( PLUGIN, VERSION, "Askhanar" );
	
	g_iCvarEnable = register_cvar( "fcs_wtr_enable", "1" );
	g_iCvarWinteamFurien = register_cvar( "fcs_wtr_furien", "12" );
	g_iCvarWinteamAnti = register_cvar( "fcs_wtr_antifurien", "20" );
	
	register_event( "SendAudio", "ev_SendAudioTerWin", "a", "2=%!MRAD_terwin" );
	register_event( "SendAudio", "ev_SendAudioCtWin", "a", "2=%!MRAD_ctwin" );
	
	// Add your code here...
}



public ev_SendAudioTerWin( )
{
	static iCvarEnable, iCvarFurienReward;
	iCvarEnable = get_pcvar_num( g_iCvarEnable );
	iCvarFurienReward = get_pcvar_num( g_iCvarWinteamFurien );
	
	if( iCvarEnable != 1 || iCvarFurienReward == 0 )
		return;
		
	GiveTeamReward( FCS_TEAM_FURIEN, iCvarFurienReward );
	
}


public ev_SendAudioCtWin( )
{
	
	static iCvarEnable, iCvarAntiReward;
	iCvarEnable = get_pcvar_num( g_iCvarEnable );
	iCvarAntiReward = get_pcvar_num( g_iCvarWinteamAnti );
	
	if( iCvarEnable != 1 || iCvarAntiReward == 0 )
		return;
		
	GiveTeamReward( FCS_TEAM_ANTIFURIEN, iCvarAntiReward );
}

public GiveTeamReward( const CsTeams:iTeam, iCredits )
{
	
	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 ];
		if( 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" );
			fcs_add_user_credits( id, iCredits );
		}
	}
}

ColorChat(  id, Color:iType, const msg[  ], { Float, Sql, Result, _}:...  )
{
	
	// Daca nu se afla nici un jucator pe server oprim TOT. Altfel dam de erori..
	if( !get_playersnum( ) ) return;
	
	new szMessage[ 256 ];

	switch( iType )
	{
		 // Culoarea care o are jucatorul setata in cvar-ul scr_concolor.
		case NORMAL:	szMessage[ 0 ] = 0x01;
		
		// Culoare Verde.
		case GREEN:	szMessage[ 0 ] = 0x04;
		
		// Alb, Rosu, Albastru.
		default: 	szMessage[ 0 ] = 0x03;
	}

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

	// Ne asiguram ca mesajul nu este mai lung de 192 de caractere.Altfel pica server-ul.
	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;
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ ansicpg1252\\ deff0{\\ fonttbl{\\ f0\\ froman\\ fcharset0 Times New Roman;}}\n{\\ colortbl ;\\ red0\\ green0\\ blue0;}\n\\ viewkind4\\ uc1\\ pard\\ cf1\\ lang11274\\ f0\\ fs24 \n\\ par }
*/
Cvar-uri (se adauga in fisierul amxmodx\configs\amxx.cfg):
  • fcs_wtr_enable 1 - activeaza/dezactiveaza pluginul.
    fcs_wtr_furien 3 - cate credite primesc furienii daca au castigat runda. ( 0, dezactiveaza reward-ul pentru echipa furien )
    fcs_wtr_anti 5 - cate credite primesc antifurienii daca au castigat runda. ( 0, dezactiveaza reward-ul pentru echipa antifurien )


FCS Bomb Events
FCS Bomb Events 1.1.5 | Afiseaza codul
/* Plugin generated by AMXX-Studio */

#include < amxmodx >
#include < csx >
//#include < fcs >
//#include < CC_ColorChat >

#define PLUGIN "FCS Bomb Events"
#define VERSION "1.1.5"		// 1.x.x  noi verificari/imbunatatiri


enum Color
{
	NORMAL = 1, 		// Culoarea care o are jucatorul setata in cvar-ul scr_concolor.
	GREEN, 			// Culoare Verde.
	TEAM_COLOR, 		// Culoare Rosu, Albastru, Gri.
	GREY, 			// Culoarea Gri.
	RED, 			// Culoarea Rosu.
	BLUE, 			// Culoarea Albastru.
}

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





//--| Furien Credits System .inc file
/*
 * 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);
}

//--| End of Furien Credits System .inc file

new const g_szTag[ ] = "[Furien Credits]";

new g_iCvarEnableBE;
new g_iCvarPlanted;
new g_iCvarExplode;
new g_iCvarDefused;

public plugin_init( )
{
	register_plugin( PLUGIN, VERSION, "Askhanar" );
	
	g_iCvarEnableBE = register_cvar( "fcs_be_enable", "1" );
	g_iCvarPlanted = register_cvar( "fcs_be_planted", "5" );
	g_iCvarExplode = register_cvar( "fcs_be_explode", "10" );
	g_iCvarDefused = register_cvar( "fcs_be_defused", "15" );
	
	
	// Add your code here...
}


public bomb_planted( iPlanter )
{
	
	if( get_pcvar_num( g_iCvarEnableBE ) == 0 )
		return PLUGIN_CONTINUE;
		
	new iPlanted = get_pcvar_num( g_iCvarPlanted );
	
	if( iPlanted == 0 || !is_user_connected( iPlanter ) )
		return PLUGIN_CONTINUE;
		
	fcs_add_user_credits( iPlanter, iPlanted );
	ColorChat( iPlanter, RED, "^x04%s^x01 You earned^x03 %i^x01 credits for planting the bomb!", g_szTag, iPlanted );
	
	return PLUGIN_CONTINUE;
	
}

public bomb_explode( iPlanter, iDefuser )
{
	
	if( get_pcvar_num( g_iCvarEnableBE ) == 0 )
		return PLUGIN_CONTINUE;
		
	new iExplode = get_pcvar_num( g_iCvarExplode );
	
	if( iExplode == 0 || !is_user_connected( iPlanter ) )
		return PLUGIN_CONTINUE;
		
	fcs_add_user_credits( iPlanter, iExplode );
	ColorChat( iPlanter, RED, "^x04%s^x01 You earned^x03 %i^x01 credits for bomb exploding!", g_szTag, iExplode );
	
	return PLUGIN_CONTINUE;
	
}

public bomb_defused( iDefuser )
{
	
	if( get_pcvar_num( g_iCvarEnableBE ) == 0 )
		return PLUGIN_CONTINUE;
		
	new iDefused = get_pcvar_num( g_iCvarDefused );
	
	if( iDefused == 0 || !is_user_connected( iDefuser ) )
		return PLUGIN_CONTINUE;
		
	fcs_add_user_credits( iDefuser, iDefused );
	ColorChat( iDefuser, RED, "^x04%s^x01 You earned^x03 %i^x01 credits for defusing the bomb!", g_szTag, iDefused );
	
	return PLUGIN_CONTINUE;
	
}


ColorChat(  id, Color:iType, const msg[  ], { Float, Sql, Result, _}:...  )
{
	
	// Daca nu se afla nici un jucator pe server oprim TOT. Altfel dam de erori..
	if( !get_playersnum( ) ) return;
	
	new szMessage[ 256 ];

	switch( iType )
	{
		 // Culoarea care o are jucatorul setata in cvar-ul scr_concolor.
		case NORMAL:	szMessage[ 0 ] = 0x01;
		
		// Culoare Verde.
		case GREEN:	szMessage[ 0 ] = 0x04;
		
		// Alb, Rosu, Albastru.
		default: 	szMessage[ 0 ] = 0x03;
	}

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

	// Ne asiguram ca mesajul nu este mai lung de 192 de caractere.Altfel pica server-ul.
	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;
}
Cvar-uri (se adauga in fisierul amxmodx\configs\amxx.cfg):
  • fcs_be_enable 1 - activeaza/dezactiveaza pluginul.
    fcs_be_planted 5 - cate credite primeste cel ce planteaza bomba. ( 0, dezactiveaza reward-ul )
    fcs_be_explode 10 - cate credite primeste cel ce a plantat bomba, cand 'ea' explodeaza. ( 0, dezactiveaza reward-ul )
    fcs_be_defused 15 - cate credite primeste cel ce a dezamorsat bomba. ( 0, dezactiveaza reward-ul )

Module necesare (se sterge ; din fata modulului de mai jos; acestea le gasiti in fisierul amxmodx\configs\modules.ini):
- csx

Furien Credits Sistem SHOP
FCS Shop | Afiseaza codul
/* Plugin generated by AMXX-Studio */

#include < amxmodx >
#include < cstrike >
#include < fakemeta >
#include < hamsandwich >
#include < fun >
//#include < fcs >
//#include < CC_ColorChat >

#define PLUGIN "FCS Credits Shop"
#define VERSION "1.0.2"

/*
 * 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 set 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 set to 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);
}

enum Color
{
	NORMAL = 1, 		// Culoarea care o are jucatorul setata in cvar-ul scr_concolor.
	GREEN, 			// Culoare Verde.
	TEAM_COLOR, 		// Culoare Rosu, Albastru, Gri.
	GREY, 			// Culoarea Gri.
	RED, 			// Culoarea Rosu.
	BLUE, 			// Culoarea Albastru.
}

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

new const g_szTag[ ] = "[FCS Shop]";
new g_szMenuName[ ] = "\rFCS\y SHOP";

enum _:iCvars
{
	ENABLE,
	
	NADES_PRICE,
	NADES_TO,
	
	HP_PRICE,
	HP_AMOUNT,
	HP_TO,
	
	AP_PRICE,
	AP_AMOUNT,
	AP_TO,
	
	DEAGLE_PRICE,
	DEAGLE_BACKPACK_AMMO,
	DEAGLE_TO,
	
	SPEED_PRICE,
	SPEED_AMOUNT,
	SPEED_DURATION,
	SPEED_TO,
	
	GRAVITY_PRICE,
	GRAVITY_AMOUNT,
	GRAVITY_DURATION,
	GRAVITY_TO
	
	
}

enum _:WhatUserHas
{
	SPEED,
	GRAVITY,
}

new g_iCvar[ iCvars ];
new bool:g_bUserHas[ 33 ][ WhatUserHas ];

// Do not modify this.
new Ham:Ham_Player_ResetMaxSpeed = Ham_Item_PreFrame;

public plugin_init( )
{
	register_plugin( PLUGIN, VERSION, "Askhanar" );
	register_cvar( "fcs_shop_version", VERSION, FCVAR_SERVER | FCVAR_SPONLY ); 
	
	g_iCvar[ ENABLE ] = register_cvar( "fcsshop_enable", "1" );
	
	g_iCvar[ NADES_PRICE ] = register_cvar( "fcsshop_nades_price", "25" );
	g_iCvar[ NADES_TO ] = register_cvar( "fcsshop_nades_team", "1" );
	
	g_iCvar[ HP_PRICE ] = register_cvar( "fcsshop_hp_price", "60" );
	g_iCvar[ HP_AMOUNT ] = register_cvar( "fcsshop_hp_amount", "300" );
	g_iCvar[ HP_TO ] = register_cvar( "fcsshop_hp_team", "3" );
	
	g_iCvar[ AP_PRICE ] = register_cvar( "fcsshop_ap_price", "55" );
	g_iCvar[ AP_AMOUNT ] = register_cvar( "fcsshop_ap_amount", "500" );
	g_iCvar[ AP_TO ] = register_cvar( "fcsshop_ap_team", "3" );
	
	g_iCvar[ DEAGLE_PRICE ] = register_cvar( "fcsshop_deagle_price", "80" );
	g_iCvar[ DEAGLE_BACKPACK_AMMO ] = register_cvar( "fcsshop_deagle_ammo", "21" );
	g_iCvar[ DEAGLE_TO ] = register_cvar( "fcsshop_deagle_team", "1" );
	
	g_iCvar[ SPEED_PRICE ] = register_cvar( "fcsshop_speed_price", "75" );
	g_iCvar[ SPEED_AMOUNT ] = register_cvar( "fcsshop_speed_amount", "500" );
	g_iCvar[ SPEED_DURATION ] = register_cvar( "fcsshop_speed_duration", "1" );
	g_iCvar[ SPEED_TO ] = register_cvar( "fcsshop_speed_team", "2" );
	
	g_iCvar[ GRAVITY_PRICE ] = register_cvar( "fcsshop_gravity_price", "80" );
	g_iCvar[ GRAVITY_AMOUNT ] = register_cvar( "fcsshop_gravity_amount", "300" );
	g_iCvar[ GRAVITY_DURATION ] = register_cvar( "fcsshop_gravity_duration", "1" );
	g_iCvar[ GRAVITY_TO ] = register_cvar( "fcsshop_gravity_team", "2" );
	
	register_clcmd( "say fcshop", "ClCmdSayShop" );
	register_clcmd( "say_team fcshop", "ClCmdSayShop" );
	register_clcmd( "say /fcshop", "ClCmdSayShop" );
	register_clcmd( "say_team /fcshop", "ClCmdSayShop" );
	
	RegisterHam( Ham_Spawn, "player", "ham_PlayerSpawnPre", true );
	RegisterHam( Ham_Killed, "player", "ham_PlayerKilledPre",true );
	RegisterHam( Ham_Player_ResetMaxSpeed, "player", "ham_PlayerResetMaxSpeedPre", true );

	// Add your code here...
}

public client_putinserver( id )
{
	if( is_user_bot( id ) || is_user_hltv( id ) )
		return;
		
	g_bUserHas[ id ][ SPEED ] = false;
	g_bUserHas[ id ][ GRAVITY ] = false;
	
}

public client_disconnect( id )
{
	if( is_user_bot( id ) || is_user_hltv( id ) )
		return;
		
	g_bUserHas[ id ][ SPEED ] = false;
	g_bUserHas[ id ][ GRAVITY ] = false;
	
}

public ClCmdSayShop( id )
{
	
	
	if( get_pcvar_num( g_iCvar[ ENABLE ] ) == 0 )
	{
		ColorChat( id, RED, "^x04%s^x03 Comanda dezactivata de catre server!", g_szTag );
		return PLUGIN_HANDLED;
	}
	
	if( !is_user_alive( id ) )
	{
		ColorChat( id, RED, "^x04%s^x03 Trebuie sa fii in viata!", g_szTag );
		return PLUGIN_HANDLED;
	}
	
	
	ShopMenu( id );
	return PLUGIN_HANDLED;
	
}

public ShopMenu( id )
{
	new szMenuName[ 64 ];
	formatex( szMenuName, sizeof ( szMenuName ) -1, "%s^n\yCredite: \r%i", g_szMenuName, fcs_get_user_credits( id ) );
	new iMenu = menu_create( szMenuName, "ShopMenuHandler" );	
	new iCallBack  =  menu_makecallback( "CallBackShop" );
	
	new szBuffer[ 6 ][ 64 ], szBufferKey[ 5 ], iBufferKey = 1;
	formatex( szBuffer[ 0 ], sizeof ( szBuffer[ ] ) -1, "\r[ \yFULL\r ] \wGrenades\y       [\r %iC\y ]", get_pcvar_num( g_iCvar[ NADES_PRICE ] ) );
	formatex( szBuffer[ 1 ], sizeof ( szBuffer[ ] ) -1, "\r[ \y%i\r ] \wHP\y                [\r %iC\y ]", get_pcvar_num( g_iCvar[ HP_AMOUNT ] ), get_pcvar_num( g_iCvar[ HP_PRICE ] ) )
	formatex( szBuffer[ 2 ], sizeof ( szBuffer[ ] ) -1, "\r[ \y%i\r ] \wAP\y                  [\r %iC\y ]", get_pcvar_num( g_iCvar[ AP_AMOUNT ] ), get_pcvar_num( g_iCvar[ AP_PRICE ] ) )
	formatex( szBuffer[ 3 ], sizeof ( szBuffer[ ] ) -1, "\r[ \y%i AMMO\r ] \wDeagle\y    [\r %iC\y ]", get_pcvar_num( g_iCvar[ DEAGLE_BACKPACK_AMMO ] ), get_pcvar_num( g_iCvar[ DEAGLE_PRICE ] ) );
	formatex( szBuffer[ 4 ], sizeof ( szBuffer[ ] ) -1, "\r[ \y%.1f\r ] \wSpeed\y          [\r %iC\y ]", float( get_pcvar_num( g_iCvar[ SPEED_AMOUNT ] ) ), get_pcvar_num( g_iCvar[ SPEED_PRICE ] ) );
	formatex( szBuffer[ 5 ], sizeof ( szBuffer[ ] ) -1, "\r[ \y%i\r ] \wGravity\y            [\r %iC\y ]", get_pcvar_num( g_iCvar[ GRAVITY_AMOUNT ] ), get_pcvar_num( g_iCvar[ GRAVITY_PRICE ] ) );
	
	for( new i = 0; i < 6; i++ )
	{
		formatex( szBufferKey, sizeof ( szBufferKey ) -1, "%i", iBufferKey );
		menu_additem( iMenu, szBuffer[ i ], szBufferKey, _, iCallBack );
		
		iBufferKey++;
	}
	
	menu_setprop( iMenu, MPROP_EXITNAME, "\wIesire" );
	
	menu_display( id, iMenu, 0 );

}

/*=======================================================================================s=P=u=f=?*/

public ShopMenuHandler( id, iMenu, iItem )
{
	if( iItem == MENU_EXIT )
	{
		menu_destroy( iMenu );
		return 1PLUGIN_HANDLED;
	}
	
	new data[ 6 ], iName[ 64 ];
	new iaccess, callback;
	
	menu_item_getinfo( iMenu, iItem, iaccess, data, 5, iName, 63, callback );
	
	new key = str_to_num( data );
	//new page = floatround( str_to_float( data ) / 7.0001, floatround_floor );
	
	menu_destroy( iMenu );
	switch( key )
	{
		case 1:
		{
			new iCredits, iNeededCredits;
			iCredits = fcs_get_user_credits( id );
			iNeededCredits = get_pcvar_num( g_iCvar[ NADES_PRICE ] );
			
			if( iCredits < iNeededCredits )
			{
				ColorChat( id, RED, "^x04%s^x03 NU^x01 ai destule credite, iti mai trebuie^x03 %i credite^x01 !", g_szTag, iNeededCredits - iCredits );
				return PLUGIN_HANDLED;
			}
			
			if( bUserHasAnyNade( id ) )
			{
				ColorChat( id, RED, "^x04%s^x03 Ai cel putin o grenada in mana, nu poti cumpara altele!", g_szTag );
				return PLUGIN_HANDLED;
			}
			
			fcs_sub_user_credits( id, iNeededCredits );
			ColorChat( id, RED, "^x04%s^x01 Ai cumparat^x03 FULL Grenades^x01 pentru^x03 %i credite^x01 !", g_szTag, iNeededCredits );
			
			give_item( id, "weapon_hegrenade" );
			give_item( id, "weapon_flashbang" );
			give_item( id, "weapon_flashbang" );
			give_item( id, "weapon_smokegrenade" );
			
		}
		
		case 2:
		{
			new iCredits, iNeededCredits;
			iCredits = fcs_get_user_credits( id );
			iNeededCredits = get_pcvar_num( g_iCvar[ HP_PRICE ] );
			
			if( iCredits < iNeededCredits )
			{
				ColorChat( id, RED, "^x04%s^x03 NU^x01 ai destule credite, iti mai trebuie^x03 %i credite^x01 !", g_szTag, iNeededCredits - iCredits );
				return PLUGIN_HANDLED;
			}
			
			fcs_sub_user_credits( id, iNeededCredits );
			
			new iHP = get_pcvar_num( g_iCvar[ HP_AMOUNT ] );
			ColorChat( id, RED, "^x04%s^x01 Ai cumparat^x03 %i HP^x01 pentru^x03 %i credite^x01 !", g_szTag, iHP, iNeededCredits );
			
			set_user_health( id, get_user_health( id ) + iHP );
			
		}
		
		case 3:
		{
			new iCredits, iNeededCredits;
			iCredits = fcs_get_user_credits( id );
			iNeededCredits = get_pcvar_num( g_iCvar[ AP_PRICE ] );
			
			if( iCredits < iNeededCredits )
			{
				ColorChat( id, RED, "^x04%s^x03 NU^x01 ai destule credite, iti mai trebuie^x03 %i credite^x01 !", g_szTag, iNeededCredits - iCredits );
				return PLUGIN_HANDLED;
			}
			
			fcs_sub_user_credits( id, iNeededCredits );
			
			new iAP = get_pcvar_num( g_iCvar[ AP_AMOUNT ] );
			ColorChat( id, RED, "^x04%s^x01 Ai cumparat^x03 %i AP^x01 pentru^x03 %i credite^x01 !", g_szTag, iAP, iNeededCredits );
			
			set_user_armor( id, get_user_armor( id ) + iAP );
			
		}
		
		case 4:
		{
			new iCredits, iNeededCredits;
			iCredits = fcs_get_user_credits( id );
			iNeededCredits = get_pcvar_num( g_iCvar[ DEAGLE_PRICE ] );
			
			if( iCredits < iNeededCredits )
			{
				ColorChat( id, RED, "^x04%s^x03 NU^x01 ai destule credite, iti mai trebuie^x03 %i credite^x01 !", g_szTag, iNeededCredits - iCredits );
				return PLUGIN_HANDLED;
			}
			
			fcs_sub_user_credits( id, iNeededCredits );
			
			new iAMMO = get_pcvar_num( g_iCvar[ DEAGLE_BACKPACK_AMMO ] );
			ColorChat( id, RED, "^x04%s^x01 Ai cumparat^x03 %i AMMO Deagle^x01 pentru^x03 %i credite^x01 !", g_szTag, iAMMO, iNeededCredits );
			
			give_item( id, "weapon_deagle" );
			cs_set_user_bpammo( id, CSW_DEAGLE, iAMMO );
			
		}
		
		case 5:
		{
			new iCredits, iNeededCredits;
			iCredits = fcs_get_user_credits( id );
			iNeededCredits = get_pcvar_num( g_iCvar[ SPEED_PRICE ] );
			
			if( iCredits < iNeededCredits )
			{
				ColorChat( id, RED, "^x04%s^x03 NU^x01 ai destule credite, iti mai trebuie^x03 %i credite^x01 !", g_szTag, iNeededCredits - iCredits );
				return PLUGIN_HANDLED;
			}
			
			fcs_sub_user_credits( id, iNeededCredits );
			
			new iSpeed = get_pcvar_num( g_iCvar[ SPEED_AMOUNT ] );
			ColorChat( id, RED, "^x04%s^x01 Ai cumparat^x03 %.1f Speed^x01 pentru^x03 %i credite^x01 !", g_szTag, float( iSpeed ), iNeededCredits );
			
			g_bUserHas[ id ][ SPEED ] = true;
			engfunc( EngFunc_SetClientMaxspeed, id, float( iSpeed )  );
			set_pev( id,  pev_maxspeed, float( iSpeed ) );
			
			/*	SlowHack o_O
			client_cmd( id, "cl_forwardspeed %0.1f;cl_sidespeed %0.1f;cl_backspeed %0.1f", float( iSpeed ), float( iSpeed ), float( iSpeed ) );
			*/
		}
		
		case 6:
		{
			new iCredits, iNeededCredits;
			iCredits = fcs_get_user_credits( id );
			iNeededCredits = get_pcvar_num( g_iCvar[ GRAVITY_PRICE ] );
			
			if( iCredits < iNeededCredits )
			{
				ColorChat( id, RED, "^x04%s^x03 NU^x01 ai destule credite, iti mai trebuie^x03 %i credite^x01 !", g_szTag, iNeededCredits - iCredits );
				return PLUGIN_HANDLED;
			}
			
			fcs_sub_user_credits( id, iNeededCredits );
			
			new iGravity = get_pcvar_num( g_iCvar[ GRAVITY_AMOUNT ] );
			ColorChat( id, RED, "^x04%s^x01 Ai cumparat^x03 %i Gravity^x01 pentru^x03 %i credite^x01 !", g_szTag, iGravity, iNeededCredits );
			
			set_user_gravity( id, float( iGravity ) * 0.00125 );
			g_bUserHas[ id ][ GRAVITY ] = true;
		}
		
	}
	
	return PLUGIN_CONTINUE;
	
}

public CallBackShop( id, iMenu, iItem  )
{
	static _access, szInfo[ 4 ],  callback;
	menu_item_getinfo( iMenu, iItem, _access, szInfo, sizeof ( szInfo ) -1, _, _, callback );
	
	//if( szInfo[ 0 ] == '0' )	return ITEM_ENABLED;
	
 	if( szInfo[ 0 ] == '1' )
	{
		if( get_pcvar_num( g_iCvar[ NADES_TO ] ) == 3 || fcs_get_user_team( id ) == get_pcvar_num( g_iCvar[ NADES_TO ] ) )
			return ITEM_ENABLED;
	}
	else if( szInfo[ 0 ] == '2' )
	{
		if( get_pcvar_num( g_iCvar[ HP_TO ] ) == 3 || fcs_get_user_team( id ) == get_pcvar_num( g_iCvar[ HP_TO ] ) )
			return ITEM_ENABLED;
	}
	else if( szInfo[ 0 ] == '3' )
	{
		if( get_pcvar_num( g_iCvar[ AP_TO ] ) == 3 || fcs_get_user_team( id ) == get_pcvar_num( g_iCvar[ AP_TO ] ) )
			return ITEM_ENABLED;
	}
	else if( szInfo[ 0 ] == '4' )
	{
		if( get_pcvar_num( g_iCvar[ DEAGLE_TO ] ) == 3 || fcs_get_user_team( id ) == get_pcvar_num( g_iCvar[ DEAGLE_TO] ) )
			return ITEM_ENABLED;
	}
	else if( szInfo[ 0 ] == '5' )
	{
		if( get_pcvar_num( g_iCvar[ SPEED_TO ] ) == 3 || fcs_get_user_team( id ) == get_pcvar_num( g_iCvar[ SPEED_TO ] ) )
			return ITEM_ENABLED;
	}
	
	else if( szInfo[ 0 ] == '6' )
	{
		if( get_pcvar_num( g_iCvar[ GRAVITY_TO ] ) == 3 || fcs_get_user_team( id ) == get_pcvar_num( g_iCvar[ GRAVITY_TO ] ) )
			return ITEM_ENABLED;
	}
	
	return ITEM_DISABLED;
}

public ham_PlayerSpawnPre(  id  )
{
	
	if( is_user_alive( id ) )
	{
		
		if( get_pcvar_num( g_iCvar[ SPEED_DURATION ] ) == 1 )
		{
			if( g_bUserHas[ id ][ SPEED ] )
			{
				new iSpeed = get_pcvar_num( g_iCvar[ SPEED_AMOUNT ] );
				engfunc( EngFunc_SetClientMaxspeed, id, float( iSpeed )  );
				set_pev( id,  pev_maxspeed, float( iSpeed ) );
				
				/*	SlowHack o_O
				client_cmd( id, "cl_forwardspeed %0.1f;cl_sidespeed %0.1f;cl_backspeed %0.1f", float( iSpeed ), float( iSpeed ), float( iSpeed ) );
				*/
			}
		}
		else
			g_bUserHas[ id ][ SPEED ] = false;
			
		if( get_pcvar_num( g_iCvar[ GRAVITY_DURATION ] ) == 1 )
		{
			if( g_bUserHas[ id ][ GRAVITY ] )
				set_user_gravity( id, float( get_pcvar_num( g_iCvar[ GRAVITY_AMOUNT ] ) ) * 0.00125 );
		}
		else
			g_bUserHas[ id ][ GRAVITY ] = false;
		
		
	}
}


/*======================================= - ¦ Askhanar ¦ - =======================================*/

public ham_PlayerKilledPre(  id  )
{
	g_bUserHas[ id ][ SPEED ] = false;
	g_bUserHas[ id ][ GRAVITY ] = false;
}

public ham_PlayerResetMaxSpeedPre( id )
{

	if( is_user_alive( id )  /*&&  get_user_maxspeed(  id  )  !=  1.0*/  )
	{
		
		if( g_bUserHas[ id ][ SPEED ] )
		{
	
			static Float:flMaxSpeed;
			flMaxSpeed = float( get_pcvar_num( g_iCvar[ SPEED_AMOUNT ] ) );
			
			engfunc( EngFunc_SetClientMaxspeed, id, flMaxSpeed  );
			set_pev( id, pev_maxspeed, flMaxSpeed  );
			
		}
		
		
		/*	SlowHack o_O
			client_cmd(  id,  "cl_forwardspeed %0.1f;cl_sidespeed %0.1f;cl_backspeed %0.1f", flMaxSpeed, flMaxSpeed, flMaxSpeed );
		*/
	}
}

stock bool:bUserHasAnyNade( id )
{
	
	if( user_has_weapon( id, CSW_HEGRENADE ) || user_has_weapon( id, CSW_FLASHBANG )
		|| user_has_weapon( id, CSW_SMOKEGRENADE ) )
		return true;
		
	return false;
	
}

stock fcs_get_user_team( id )
{
	new iTeam = -1;
	if( cs_get_user_team( id ) == CS_TEAM_T )	iTeam = 1;
	else if( cs_get_user_team( id ) == CS_TEAM_CT )	iTeam = 2;
	
	return iTeam;
}

ColorChat(  id, Color:iType, const msg[  ], { Float, Sql, Result, _}:...  )
{
	
	// Daca nu se afla nici un jucator pe server oprim TOT. Altfel dam de erori..
	if( !get_playersnum( ) ) return;
	
	new szMessage[ 256 ];

	switch( iType )
	{
		 // Culoarea care o are jucatorul setata in cvar-ul scr_concolor.
		case NORMAL:	szMessage[ 0 ] = 0x01;
		
		// Culoare Verde.
		case GREEN:	szMessage[ 0 ] = 0x04;
		
		// Alb, Rosu, Albastru.
		default: 	szMessage[ 0 ] = 0x03;
	}

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

	// Ne asiguram ca mesajul nu este mai lung de 192 de caractere.Altfel pica server-ul.
	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;
}

Comenzi publice (se tasteaza in joc prin apasarea tastei Y):
  • fcshop - afiseaza meniul.
    /fcshop - afiseaza meniul.

Cvar-uri (se adauga in fisierul amxmodx\configs\amxx.cfg):
  • fcsshop_enable 1 - activeaza / dezactiveaza pluginul
    fcsshop_nades_price 25 - pretul grenazilor
    fcsshop_nades_team 1 - echipa care poate cumpara ( 0 niciuna, 1 doar furienii, 2 doar antifurienii, 3 ambii )
    fcsshop_hp_price 60 - pretul pentru HP
    fcsshop_hp_amount 300 - cantitatea de HP care apare in shop spre cumparare.
    fcsshop_hp_team 3 - echipa care poate cumpara ( 0 niciuna, 1 doar furienii, 2 doar antifurienii, 3 ambii )
    fcsshop_ap_price 55 - pretul pentru AP
    fcsshop_ap_amount 300 - cantitatea de AP care apare in shop spre cumparare.
    fcsshop_ap_team 3 - echipa care poate cumpara ( 0 niciuna, 1 doar furienii, 2 doar antifurienii, 3 ambii )
    fcsshop_deagle_price 80 - pretul pentru DEAGLE
    fcsshop_deagle_ammo 21 - cate gloante primeste la DEAGLE
    fcsshop_deagle_team 1 - echipa care poate cumpara ( 0 niciuna, 1 doar furienii, 2 doar antifurienii, 3 ambii )
    fcsshop_speed_price 75 - pretul vitezei
    fcsshop_speed_amount 550 - ce viteza primeste
    fcsshop_speed_duration 1 - daca ii ramane viteza pana moare( 0 runda viitoare ii dispare viteza | 1 ii ramane viteza pana jucatorul moare )
    fcsshop_speed_team 2 - echipa care poate cumpara ( 0 niciuna, 1 doar furienii, 2 doar antifurienii, 3 ambii )
    fcsshop_gravity_price 75 - pretul gravitatiei
    fcsshop_gravity_amount 330 - ce gravitate primeste
    fcsshop_gravity_duration 1 - daca ii ramane gravitatia pana moare( 0 runda viitoare ii dispare gravitatia | 1 ii ramane gravitatia pana jucatorul moare )
    fcsshop_gravity_team 2 - echipa care poate cumpara ( 0 niciuna, 1 doar furienii, 2 doar antifurienii, 3 ambii )
Imagini FCS Shop | Afiseaza codul
Image
pluginul a fost testat si functioneaza in proportie de 100%.
aveti grija ca acest plugin sa fie trecut sub cel de credite ( sau cel aio ).

Furien Credits System AIO ( All In One )
Furien Credits System AIO 1.8.8 | Afiseaza codul
#include < amxmodx >
#include < amxmisc >
#include < cstrike >
#include < fakemeta >
#include < hamsandwich >
#include < nvault >

#pragma semicolon 1


#define PLUGIN "Furien Credits System AIO"
#define VERSION "1.8.8"   // 1.x.x  noi verificari/imbunatatiri

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

enum Color
{
	NORMAL = 1, 		// Culoarea care o are jucatorul setata in cvar-ul scr_concolor.
	GREEN, 			// Culoare Verde.
	TEAM_COLOR, 		// Culoare Rosu, Albastru, Gri.
	GREY, 			// Culoarea Gri.
	RED, 			// Culoarea Rosu.
	BLUE, 			// Culoarea Albastru.
};

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

new const g_szTag[ ] = "[Furien Credits]";
new const g_szGiveCreditsFlag[ ] = "a";

new g_iCvarPruneDays;
new g_iCvarEntry;
new g_iCvarRetire;

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 g_iUserRetired[ 33 ];

new iVault;

public plugin_init( )
{
	register_plugin( PLUGIN, VERSION, "Askhanar" );
	register_cvar( "fcs_version_aio", VERSION, FCVAR_SERVER | FCVAR_SPONLY ); 

	g_iCvarPruneDays = register_cvar( "fcs_prunedays", "15" );
	g_iCvarEntry = register_cvar( "fcs_entry_credits", "300" );
	g_iCvarRetire = register_cvar( "fcs_maxretrive", "0" );
	
	g_iCvarPTREnable = register_cvar( "fcs_pentru_enable", "1" );
	g_iCvarPTRMinutes = register_cvar( "fcs_pentru_minutes", "5" );
	g_iCvarPTRCredits = register_cvar( "fcs_pentru_credits", "15" );
	
	g_iCvarKREnable = register_cvar( "fcs_kr_enable", "1" );
	g_iCvarKRCredits = register_cvar( "fcs_kr_credits", "7" );
	g_iCvarKRHSCredits = register_cvar( "fcs_kr_hscredits", "3" );//( bonus, fcs_kr_credits + fcs_kr_hscredits )
	
	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", "12" );
	g_iCvarWTRAnti = register_cvar( "fcs_wtr_antifurien", "20" );
	
	register_clcmd( "say", "ClCmdSay" );
	register_clcmd( "say_team", "ClCmdSay" );
	
	register_clcmd( "say /depozit", "ClCmdSayDepozit" );
	register_clcmd( "say /deposit", "ClCmdSayDepozit" );
	register_clcmd( "say_team /depozit", "ClCmdSayDepozit" );
	register_clcmd( "say_team /deposit", "ClCmdSayDepozit" );
	
	register_clcmd( "say /retrage", "ClCmdSayRetrage" );
	register_clcmd( "say /withdraw", "ClCmdSayRetrage" );
	register_clcmd( "say_team /retrage", "ClCmdSayRetrage" );
	register_clcmd( "say_team /withdraw", "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" );
	
	RegisterHam( Ham_Spawn, "player", "ham_SpawnPlayerPost", true );
	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" );
	
	set_task( 1.0, "task_PTRFunctions", TASK_pentru, _, _, "b", 0 );	

}

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;
	g_iUserRetired[ id ] = 0;
	return PLUGIN_CONTINUE;
	
}

public client_disconnect( id )
{
	if( is_user_bot( id ) )
		return PLUGIN_CONTINUE;
		
	SaveCredits( id );
	g_iUserRetired[ id ] = 0;
	
	return PLUGIN_CONTINUE;
	
}

public ClCmdSay( id )
{
	static szArgs[192];
	read_args( szArgs, sizeof ( szArgs ) -1 );
	
	if( !szArgs[ 0 ] )
		return PLUGIN_CONTINUE;
	
	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 PLUGIN_HANDLED;
	}
	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 PLUGIN_HANDLED;
	}
		
	return PLUGIN_CONTINUE;
}

public ClCmdCredits( id )
{
	if( !is_user_connected( id ) )
		return PLUGIN_HANDLED;
		
	new szArg[ 32 ];
    	read_argv( 1, szArg, sizeof ( szArg ) -1 );

	if( equal( szArg, "" ) ) 
	{
		
		ColorChat( id, RED, "^x04%s^x01 Ai^x03 %i^x01 credite.", g_szTag, g_iUserCredits[ id ] );
		return PLUGIN_HANDLED;
	}
	
    	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 PLUGIN_HANDLED;
	}

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

public ClCmdSayDepozit( id)
{
	
	if( !is_user_connected( id ) )
		return PLUGIN_HANDLED;
		
	new CsTeams:iTeam = cs_get_user_team( id );
	
	if( CS_TEAM_T <= iTeam <= CS_TEAM_CT )
	{
		new iMoney = cs_get_user_money( id );
		if( iMoney >= 16000 )
		{
			
			ColorChat( id, RED, "^x04%s^x01 Ai depozitat^x03 16000$^x01 si ai primit^x03 1^x01 credit.", g_szTag );
			cs_set_user_money( id, iMoney - 16000 );
			g_iUserCredits[ id ] += 1;
			
			SaveCredits( id );
			return PLUGIN_HANDLED;
		}
		else
		{
			ColorChat( id, RED, "^x04%s^x01 Iti trebuie^x03 16000$^x01 pentru a putea depozita.", g_szTag );
			return PLUGIN_HANDLED;
		}
	}
	
	return PLUGIN_HANDLED;

}

public ClCmdSayRetrage( id)
{
	
	new CsTeams:iTeam = cs_get_user_team( id );
	
	if( CS_TEAM_T <= iTeam <= CS_TEAM_CT )
	{
		
		if( g_iUserCredits[ id ] > 0 )
		{
			new iMaxRetrieve = get_pcvar_num( g_iCvarRetire );
			if( iMaxRetrieve > 0 )
			{
				if( g_iUserRetired[ id ] >= iMaxRetrieve )
				{
					ColorChat( id, RED, "^x04%s^x01 Ai retras deja^x03 %i^x01 credit%s runda asta^x01.", g_szTag, iMaxRetrieve, iMaxRetrieve == 1 ? "" : "e" );
					return PLUGIN_HANDLED;
				}
			}
			
			new iMoney = cs_get_user_money( id );
			
			ColorChat( id, RED, "^x04%s^x01 Ai retras^x03 1^x01 credit si, ai primi^x03 16000$^x01.", g_szTag );
			cs_set_user_money( id, iMoney + 16000 );
			
			g_iUserCredits[ id ] -=1;
			g_iUserRetired[ id ]++;
			
			SaveCredits( id );
			
			if( ( iMoney + 16000 ) > 16000 )
			{
				ColorChat( id, RED, "^x04%s^x03 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$^x01.", g_szTag );
				return PLUGIN_HANDLED;
			}
		}
		else
		{
			ColorChat(id, RED, "^x04%s^x03 NU^x01 ai ce sa retragi, ai^x03 0^x01 credite.", g_szTag );
			return PLUGIN_HANDLED;
		}
		
	}
	
	return PLUGIN_HANDLED;

}

public ClCmdGiveCredits( id )
{
	
	if( !( get_user_flags( id ) & read_flags( g_szGiveCreditsFlag ) ) )
	{
		client_cmd( id, "echo NU ai acces la aceasta comanda!" );
		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, "" ) )
	{
		client_cmd( id, "echo amx_give_credits < nume/ @ALL/ @T/ @CT > < credite >" );
		return PLUGIN_HANDLED;
	}
	
	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 PLUGIN_HANDLED;
	}
	
	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, RED, "^x04^%s^x01 Adminul^x03 %s^x01 le-a dat^x03 %i^x01 credite tuturor jucatorilor!", g_szTag, szName, iCredits );
					return PLUGIN_HANDLED;
				}
			}
			
			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 PLUGIN_HANDLED;
					}
					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, RED, "^x04^%s^x01 Adminul^x03 %s^x01 le-a dat^x03 %i^x01 credite jucatorilor de la^x03 TERO^x01!", g_szTag, szName, iCredits );
					return PLUGIN_HANDLED;
				}
			}
			
			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 PLUGIN_HANDLED;
					}
					
					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, RED, "^x04^%s^x01 Adminul^x03 %s^x01 le-a dat^x03 %i^x01 credite jucatorilor de la^x03 CT^x01!", g_szTag, szName, iCredits );
					return PLUGIN_HANDLED;
				}
			}
		}
	}
		
	new iPlayer = cmd_target( id, szFirstArg, 8 );
	if( !iPlayer )
	{
		client_cmd( id, "echo Jucatorul %s nu a fost gasit!", szFirstArg );
		return PLUGIN_HANDLED;
	}
	
	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, RED, "^x04%s^x01 Adminul^x03 %s^x01 i-a dat^x03 %i^x01 credite lui^x03 %s^x01.", g_szTag, szName, iCredits, _szName );
	
	return PLUGIN_HANDLED;
	
	
}

public ClCmdTakeCredits( id )
{
	
	if( !( get_user_flags( id ) & read_flags( g_szGiveCreditsFlag ) ) )
	{
		client_cmd( id, "echo NU ai acces la aceasta comanda!" );
		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, "" ) )
	{
		client_cmd( id, "echo amx_take_credits < nume > < credite >" );
		return PLUGIN_HANDLED;
	}
	
	new iCredits = str_to_num( szSecondArg );
	if( iCredits <= 0 )
	{
		client_cmd( id, "echo Valoare creditelor trebuie sa fie mai mare decat 0!" );
		return PLUGIN_HANDLED;
	}
			
	new iPlayer = cmd_target( id, szFirstArg, 8 );
	if( !iPlayer )
	{
		client_cmd( id, "echo Jucatorul %s nu a fost gasit!", szFirstArg );
		return PLUGIN_HANDLED;
	}
	
	if( g_iUserCredits[ iPlayer ] < iCredits )
	{
		client_cmd( id, "echo Jucatorul %s nu are atatea credite!Are doar %i", szFirstArg, g_iUserCredits[ iPlayer ] );
		return PLUGIN_HANDLED;
	}
	
	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, RED, "^x04%s^x01 Adminul^x03 %s^x01 i-a sters^x03 %i^x01 credite lui^x03 %s^x01.", g_szTag, szName, iCredits, _szName );
	
	return PLUGIN_HANDLED;
	
	
}

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^x03 /donate^x01 <^x03 nume^x01 > <^x03 credite^x01 >.", g_szTag );
		return PLUGIN_HANDLED;
	}
	
	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 credite.", 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 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 credite, ai doar^x03 %i credit%s^x01.",  g_szTag, g_iUserCredits[ id ], g_iUserCredits[ id ] == 1 ? "" : "e"  );
		return PLUGIN_HANDLED;
	}
	
	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^03 %i credit%s^x01 lui^x03 %s^x01 .", g_szTag, szFirstName, iCredits, iCredits == 1 ? "" : "e", szSecondName );
	return PLUGIN_HANDLED;
}

public ham_SpawnPlayerPost( id )
{
	if( is_user_alive( id ) )
		g_iUserRetired[ id ] = 0;
}

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^x03 %s^x01 !", g_szTag, g_szName[ id ], szNewName );
	ColorChat( id, RED, "^x04%s^x01 Am salvat^x03 %i^x01 credite pe numele^x03 %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 credite de pe noul nume (^x03 %s^x01 ) !", g_szTag, g_iUserCredits[ id ], g_szName[ id ] );
	
	return FMRES_IGNORED;
}


public LoadCredits( id )
{
	iVault  =  nvault_open(  "FurienCreditsSystem"  );
	
	if(  iVault  ==  INVALID_HANDLE  )
	{
		set_fail_state(  "nValut returned invalid handle!"  );
	}
	
	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 ] = get_pcvar_num( g_iCvarEntry );
	}
	
	nvault_close( iVault );
	
}


public SaveCredits(  id  )
{
	
	iVault  =  nvault_open(  "FurienCreditsSystem"  );
	
	if(  iVault  ==  INVALID_HANDLE  )
	{
		set_fail_state(  "nValut returned invalid handle!"  );
	}
	
	static szData[ 256 ];
	formatex( szData, sizeof ( szData ) -1, "%i", g_iUserCredits[ id ] );
	
	nvault_set( iVault, g_szName[ id ], szData );
	nvault_close( iVault );
}


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, "^x04%s^x01 Ai primit^x03 %i^x01 credite pentru^x03 %i^x01 minute jucate!",
				g_szTag, iCredits, iTime );
				
			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 )
{
	
	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 ];
		if( 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;
		}
	}
}

public plugin_end( )
{
	iVault  =  nvault_open(  "FurienCreditsSystem"  );
	
	if(  iVault  ==  INVALID_HANDLE  )
	{
		set_fail_state(  "nValut returned invalid handle!"  );
	}
	
	new iDays = get_pcvar_num( g_iCvarPruneDays );
	if( iDays > 0 )
	{
		nvault_prune( iVault, 0, get_systime( ) - ( iDays * ONE_DAY_IN_SECONDS ) );
	}
	
	nvault_close( iVault );
}

ColorChat(  id, Color:iType, const msg[  ], { Float, Sql, Result, _}:...  )
{
	
	// Daca nu se afla nici un jucator pe server oprim TOT. Altfel dam de erori..
	if( !get_playersnum( ) ) return;
	
	new szMessage[ 256 ];

	switch( iType )
	{
		 // Culoarea care o are jucatorul setata in cvar-ul scr_concolor.
		case NORMAL:	szMessage[ 0 ] = 0x01;
		
		// Culoare Verde.
		case GREEN:	szMessage[ 0 ] = 0x04;
		
		// Alb, Rosu, Albastru.
		default: 	szMessage[ 0 ] = 0x03;
	}

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

	// Ne asiguram ca mesajul nu este mai lung de 192 de caractere.Altfel pica server-ul.
	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 PLUGIN_HANDLED;
}

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 PLUGIN_CONTINUE;
}

CC_FindPlayer(  )
{
	new iMaxPlayers  =  get_maxplayers(  );
	
	for( new i = 1; i <= iMaxPlayers; i++ )
		if(  is_user_connected( i )  )
			return i;
	
	return -1;
}

Cvar-uri (se adauga in fisierul amxmodx\configs\amxx.cfg):
  • NEW!fcs_prunedays 15 - sterge toate inregistrarile din nvault care nu au intrat pe server de x zile ( la fiecare sfarsit de mapa ) | setati valoarea 0 pentru a dezactiva functia.
    NEW!fcs_entry_credits 300 - cate credite primesc cand intra pentru prima data pe server.
    NEW! [ 20.03.2014 ]fcs_maxretrieve "0" - nr maxim de credite pe care il pot retrage intr-o runda. ( 0 fara limita de retragere )
    fcs_pentru_enable 1 - activeaza/dezactiveaza bonusurile pentru timpul petrecut pe server.
    fcs_pentru_minutes 5 - minutele jucate ca sa primeasca y credite. ( din x in x minute )
    fcs_pentru_credits 15 - creditele care le primeste din in x in x minute.
    fcs_kr_enable 1 - activeaza/dezactiveaza bonusurile de la kill.
    fcs_kr_credits 7 - cate credite primeste la fiecare kill.
    fcs_kr_hscredits 3 - cate credite primeste bonus daca a dat HeadShot ( => 7 + 3 = 10 )
    fcs_transfer_enable 1 - activeaza / dezactiveaza transferul de credite.
    fcs_transfer_maxcredits 50 - cantitatea maxima de credite pe care o poti transfera o data.
    fcs_wtr_enable 1 - activeaza/dezactiveaza bonusurile pentru castigarea rundei.
    fcs_wtr_furien 3 - cate credite primesc furienii daca au castigat runda. ( 0, dezactiveaza reward-ul pentru echipa furien )
    fcs_wtr_anti 5 - cate credite primesc antifurienii daca au castigat runda. ( 0, dezactiveaza reward-ul pentru echipa antifurien )
Comenzi administrative (se tasteaza in consola si trebuie sa fiti administrator):
  • amx_give_credits < nume/ @ALL/ @CT/ @T > < credite > - dai credite cuiva.
    amx_take_credits < nume > - ii stergi din credite cuiva.
Comenzi publice (se tasteaza in joc prin apasarea tastei Y):
  • /credits - aflii cate credite ai
    /credits < nume > - aflii cate credite are jucatorul respectiv
    /deposit sau /depozit - depozitezi 16000$ si primesti un credit
    /retrage sau /withdraw - retragi un credit si premesti 16000$
    /transfer <nume> <credite> - transferi x credite jucatorului specificat.
    /donate <nume> <credite> - transferi x credite jucatorului specificat.
Module necesare (se sterge ; din fata modulului de mai jos; acestea le gasiti in fisierul amxmodx\configs\modules.ini):
- cstrike
- fakemeta
- nvault

Furien Credits Sistem AIO + FCS Shop ( beta )
Furien Credits Sistem AIO + FCS Shop ( beta ) | Afiseaza codul
#include < amxmodx >
#include < amxmisc >
#include < cstrike >
#include < fakemeta >
#include < hamsandwich >
#include < nvault >
#include < fun >

#pragma semicolon 1


#define PLUGIN "Furien Credits System AIO + FCS Shop"
#define VERSION "1.3.3Beta"

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

enum Color
{
	NORMAL = 1, 		// Culoarea care o are jucatorul setata in cvar-ul scr_concolor.
	GREEN, 			// Culoare Verde.
	TEAM_COLOR, 		// Culoare Rosu, Albastru, Gri.
	GREY, 			// Culoarea Gri.
	RED, 			// Culoarea Rosu.
	BLUE, 			// Culoarea Albastru.
};

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

new const g_szTag[ ] = "[Furien Credits]";
new const g_szGiveCreditsFlag[ ] = "a";
new g_szMenuName[ ] = "\rFCS\y SHOP";

enum _:iCvars
{
	ENABLE,
	
	NADES_PRICE,
	NADES_TO,
	
	HP_PRICE,
	HP_AMOUNT,
	HP_TO,
	
	AP_PRICE,
	AP_AMOUNT,
	AP_TO,
	
	DEAGLE_PRICE,
	DEAGLE_BACKPACK_AMMO,
	DEAGLE_TO,
	
	SPEED_PRICE,
	SPEED_AMOUNT,
	SPEED_DURATION,
	SPEED_TO,
	
	GRAVITY_PRICE,
	GRAVITY_AMOUNT,
	GRAVITY_DURATION,
	GRAVITY_TO
	
	
}

enum _:WhatUserHas
{
	SPEED,
	GRAVITY,
}

new g_iCvar[ iCvars ];
new g_iCvarPruneDays;
new g_iCvarEntry;
new g_iCvarRetire;

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 g_iUserRetired[ 33 ];

new bool:g_bUserHas[ 33 ][ WhatUserHas ];

new iVault;
new g_iMaxPlayers;

// Do not modify this.
new Ham:Ham_Player_ResetMaxSpeed = Ham_Item_PreFrame;


public plugin_init( )
{
	register_plugin( PLUGIN, VERSION, "Askhanar" );
	register_cvar( "fcs_version_aio_shop", VERSION, FCVAR_SERVER | FCVAR_SPONLY ); 

	g_iCvarPruneDays = register_cvar( "fcs_prunedays", "15" );
	g_iCvarEntry = register_cvar( "fcs_entry_credits", "300" );
	g_iCvarRetire = register_cvar( "fcs_maxretrive", "0" );
	
	g_iCvarPTREnable = register_cvar( "fcs_pentru_enable", "1" );
	g_iCvarPTRMinutes = register_cvar( "fcs_pentru_minutes", "5" );
	g_iCvarPTRCredits = register_cvar( "fcs_pentru_credits", "15" );
	
	g_iCvarKREnable = register_cvar( "fcs_kr_enable", "1" );
	g_iCvarKRCredits = register_cvar( "fcs_kr_credits", "7" );
	g_iCvarKRHSCredits = register_cvar( "fcs_kr_hscredits", "3" );//( bonus, fcs_kr_credits + fcs_kr_hscredits )
	
	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", "12" );
	g_iCvarWTRAnti = register_cvar( "fcs_wtr_antifurien", "20" );
	
	g_iCvar[ ENABLE ] = register_cvar( "fcsshop_enable", "1" );
	
	g_iCvar[ NADES_PRICE ] = register_cvar( "fcsshop_nades_price", "25" );
	g_iCvar[ NADES_TO ] = register_cvar( "fcsshop_nades_team", "1" );
	
	g_iCvar[ HP_PRICE ] = register_cvar( "fcsshop_hp_price", "60" );
	g_iCvar[ HP_AMOUNT ] = register_cvar( "fcsshop_hp_amount", "300" );
	g_iCvar[ HP_TO ] = register_cvar( "fcsshop_hp_team", "3" );
	
	g_iCvar[ AP_PRICE ] = register_cvar( "fcsshop_ap_price", "55" );
	g_iCvar[ AP_AMOUNT ] = register_cvar( "fcsshop_ap_amount", "500" );
	g_iCvar[ AP_TO ] = register_cvar( "fcsshop_ap_team", "3" );
	
	g_iCvar[ DEAGLE_PRICE ] = register_cvar( "fcsshop_deagle_price", "80" );
	g_iCvar[ DEAGLE_BACKPACK_AMMO ] = register_cvar( "fcsshop_deagle_ammo", "21" );
	g_iCvar[ DEAGLE_TO ] = register_cvar( "fcsshop_deagle_team", "1" );
	
	g_iCvar[ SPEED_PRICE ] = register_cvar( "fcsshop_speed_price", "75" );
	g_iCvar[ SPEED_AMOUNT ] = register_cvar( "fcsshop_speed_amount", "500" );
	g_iCvar[ SPEED_DURATION ] = register_cvar( "fcsshop_speed_duration", "1" );
	g_iCvar[ SPEED_TO ] = register_cvar( "fcsshop_speed_team", "2" );
	
	g_iCvar[ GRAVITY_PRICE ] = register_cvar( "fcsshop_gravity_price", "80" );
	g_iCvar[ GRAVITY_AMOUNT ] = register_cvar( "fcsshop_gravity_amount", "300" );
	g_iCvar[ GRAVITY_DURATION ] = register_cvar( "fcsshop_gravity_duration", "1" );
	g_iCvar[ GRAVITY_TO ] = register_cvar( "fcsshop_gravity_team", "2" );
	
	register_clcmd( "say", "ClCmdSay" );
	register_clcmd( "say_team", "ClCmdSay" );
	
	register_clcmd( "say /depozit", "ClCmdSayDepozit" );
	register_clcmd( "say /deposit", "ClCmdSayDepozit" );
	register_clcmd( "say_team /depozit", "ClCmdSayDepozit" );
	register_clcmd( "say_team /deposit", "ClCmdSayDepozit" );
	
	register_clcmd( "say /retrage", "ClCmdSayRetrage" );
	register_clcmd( "say /withdraw", "ClCmdSayRetrage" );
	register_clcmd( "say_team /retrage", "ClCmdSayRetrage" );
	register_clcmd( "say_team /withdraw", "ClCmdSayRetrage" );
	
	register_clcmd( "say fcshop", "ClCmdSayShop" );
	register_clcmd( "say_team fcshop", "ClCmdSayShop" );
	register_clcmd( "say /fcshop", "ClCmdSayShop" );
	register_clcmd( "say_team /fcshop", "ClCmdSayShop" );
	
	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" );
	
	RegisterHam( Ham_Spawn, "player", "ham_SpawnPlayerPost", true );
	RegisterHam( Ham_Killed, "player", "ham_PlayerKilledPre",true );
	RegisterHam( Ham_Player_ResetMaxSpeed, "player", "ham_PlayerResetMaxSpeedPre", true );
	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(  "FurienCreditsSystem"  );
	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_putinserver( 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;
	g_iUserRetired[ id ] = 0;
	g_bUserHas[ id ][ SPEED ] = false;
	g_bUserHas[ id ][ GRAVITY ] = false;
	
	return PLUGIN_CONTINUE;
	
}

public client_disconnect( id )
{
	if( is_user_bot( id ) )
		return PLUGIN_CONTINUE;
		
	SaveCredits( id );
	g_iUserRetired[ id ] = 0;
	g_bUserHas[ id ][ SPEED ] = false;
	g_bUserHas[ id ][ GRAVITY ] = false;
	
	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 credite.", 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^x03 %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^x03 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 iMaxRetrieve = get_pcvar_num( g_iCvarRetire );
			if( iMaxRetrieve > 0 )
			{
				if( g_iUserRetired[ id ] >= iMaxRetrieve )
				{
					ColorChat( id, RED, "^x04%s^x01 Ai retras deja^x03 %i^x01 credit%s runda asta^x01.", g_szTag, iMaxRetrieve, iMaxRetrieve == 1 ? "" : "e" );
					return PLUGIN_HANDLED;
				}
			}
			
			new iMoney = cs_get_user_money( id );
			
			ColorChat( id, RED, "^x04%s^x01 Ai retras^x03 1^x01 credit si, ai primi^x03 16000$^x01.", g_szTag );
			cs_set_user_money( id, iMoney + 16000 );
			
			g_iUserCredits[ id ] -=1;
			g_iUserRetired[ id ]++;
			
			SaveCredits( id );
			
			if( ( iMoney + 16000 ) > 16000 )
			{
				ColorChat( id, RED, "^x04%s^x03 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$^x01.", g_szTag );
				return 1;
			}
		}
		else
		{
			ColorChat(id, RED, "^x04%s^x03 NU^x01 ai ce sa retragi, ai^x03 0^x01 credite.", g_szTag );
			return 1;
		}
		
	}
	
	return 1;

}

public ClCmdSayShop( id )
{
	
	
	if( get_pcvar_num( g_iCvar[ ENABLE ] ) == 0 )
	{
		ColorChat( id, RED, "^x04%s^x03 Comanda dezactivata de catre server!", g_szTag );
		return PLUGIN_HANDLED;
	}
	
	if( !is_user_alive( id ) )
	{
		ColorChat( id, RED, "^x04%s^x03 Trebuie sa fii in viata!", g_szTag );
		return PLUGIN_HANDLED;
	}
	
	
	ShopMenu( id );
	return PLUGIN_HANDLED;
	
}

public ShopMenu( id )
{
	new szMenuName[ 64 ];
	formatex( szMenuName, sizeof ( szMenuName ) -1, "%s^n\yCredite: \r%i", g_szMenuName, g_iUserCredits[ id ] );
	new iMenu = menu_create( szMenuName, "ShopMenuHandler" );	
	new iCallBack  =  menu_makecallback( "CallBackShop" );
	
	new szBuffer[ 6 ][ 64 ], szBufferKey[ 5 ], iBufferKey = 1;
	formatex( szBuffer[ 0 ], sizeof ( szBuffer[ ] ) -1, "\r[ \yFULL\r ] \wGrenades\y       [\r %iC\y ]", get_pcvar_num( g_iCvar[ NADES_PRICE ] ) );
	formatex( szBuffer[ 1 ], sizeof ( szBuffer[ ] ) -1, "\r[ \y%i\r ] \wHP\y                [\r %iC\y ]", get_pcvar_num( g_iCvar[ HP_AMOUNT ] ), get_pcvar_num( g_iCvar[ HP_PRICE ] ) );
	formatex( szBuffer[ 2 ], sizeof ( szBuffer[ ] ) -1, "\r[ \y%i\r ] \wAP\y                  [\r %iC\y ]", get_pcvar_num( g_iCvar[ AP_AMOUNT ] ), get_pcvar_num( g_iCvar[ AP_PRICE ] ) );
	formatex( szBuffer[ 3 ], sizeof ( szBuffer[ ] ) -1, "\r[ \y%i AMMO\r ] \wDeagle\y    [\r %iC\y ]", get_pcvar_num( g_iCvar[ DEAGLE_BACKPACK_AMMO ] ), get_pcvar_num( g_iCvar[ DEAGLE_PRICE ] ) );
	formatex( szBuffer[ 4 ], sizeof ( szBuffer[ ] ) -1, "\r[ \y%.1f\r ] \wSpeed\y          [\r %iC\y ]", float( get_pcvar_num( g_iCvar[ SPEED_AMOUNT ] ) ), get_pcvar_num( g_iCvar[ SPEED_PRICE ] ) );
	formatex( szBuffer[ 5 ], sizeof ( szBuffer[ ] ) -1, "\r[ \y%i\r ] \wGravity\y            [\r %iC\y ]", get_pcvar_num( g_iCvar[ GRAVITY_AMOUNT ] ), get_pcvar_num( g_iCvar[ GRAVITY_PRICE ] ) );
	
	for( new i = 0; i < 6; i++ )
	{
		formatex( szBufferKey, sizeof ( szBufferKey ) -1, "%i", iBufferKey );
		menu_additem( iMenu, szBuffer[ i ], szBufferKey, _, iCallBack );
		
		iBufferKey++;
	}
	
	menu_setprop( iMenu, MPROP_EXITNAME, "\wIesire" );
	
	menu_display( id, iMenu, 0 );

}

/*=======================================================================================s=P=u=f=?*/

public ShopMenuHandler( id, iMenu, iItem )
{
	if( iItem == MENU_EXIT )
	{
		menu_destroy( iMenu );
		return 1PLUGIN_HANDLED;
	}
	
	new data[ 6 ], iName[ 64 ];
	new iaccess, callback;
	
	menu_item_getinfo( iMenu, iItem, iaccess, data, 5, iName, 63, callback );
	
	new key = str_to_num( data );
	//new page = floatround( str_to_float( data ) / 7.0001, floatround_floor );
	
	menu_destroy( iMenu );
	switch( key )
	{
		case 1:
		{
			new iNeededCredits;
			iNeededCredits = get_pcvar_num( g_iCvar[ NADES_PRICE ] );
			
			if( g_iUserCredits[ id ] < iNeededCredits )
			{
				ColorChat( id, RED, "^x04%s^x03 NU^x01 ai destule credite, iti mai trebuie^x03 %i credite^x01 !", g_szTag, iNeededCredits - g_iUserCredits[ id ] );
				return PLUGIN_HANDLED;
			}
			
			if( bUserHasAnyNade( id ) )
			{
				ColorChat( id, RED, "^x04%s^x03 Ai cel putin o grenada in mana, nu poti cumpara altele!", g_szTag );
				return PLUGIN_HANDLED;
			}
			
			g_iUserCredits[ id ] -= iNeededCredits;
			ColorChat( id, RED, "^x04%s^x01 Ai cumparat^x03 FULL Grenades^x01 pentru^x03 %i credite^x01 !", g_szTag, iNeededCredits );
			
			give_item( id, "weapon_hegrenade" );
			give_item( id, "weapon_flashbang" );
			give_item( id, "weapon_flashbang" );
			give_item( id, "weapon_smokegrenade" );
			
		}
		
		case 2:
		{
			new iNeededCredits;
			iNeededCredits = get_pcvar_num( g_iCvar[ HP_PRICE ] );
			
			if( g_iUserCredits[ id ] < iNeededCredits )
			{
				ColorChat( id, RED, "^x04%s^x03 NU^x01 ai destule credite, iti mai trebuie^x03 %i credite^x01 !", g_szTag, iNeededCredits - g_iUserCredits[ id ] );
				return PLUGIN_HANDLED;
			}
			
			g_iUserCredits[ id ] -= iNeededCredits;
			
			new iHP = get_pcvar_num( g_iCvar[ HP_AMOUNT ] );
			ColorChat( id, RED, "^x04%s^x01 Ai cumparat^x03 %i HP^x01 pentru^x03 %i credite^x01 !", g_szTag, iHP, iNeededCredits );
			
			set_user_health( id, get_user_health( id ) + iHP );
			
		}
		
		case 3:
		{
			new iNeededCredits;
			iNeededCredits = get_pcvar_num( g_iCvar[ AP_PRICE ] );
			
			if( g_iUserCredits[ id ] < iNeededCredits )
			{
				ColorChat( id, RED, "^x04%s^x03 NU^x01 ai destule credite, iti mai trebuie^x03 %i credite^x01 !", g_szTag, iNeededCredits - g_iUserCredits[ id ] );
				return PLUGIN_HANDLED;
			}
			
			g_iUserCredits[ id ] -= iNeededCredits;
			
			new iAP = get_pcvar_num( g_iCvar[ AP_AMOUNT ] );
			ColorChat( id, RED, "^x04%s^x01 Ai cumparat^x03 %i AP^x01 pentru^x03 %i credite^x01 !", g_szTag, iAP, iNeededCredits );
			
			set_user_armor( id, get_user_armor( id ) + iAP );
			
		}
		
		case 4:
		{
			new iNeededCredits;
			iNeededCredits = get_pcvar_num( g_iCvar[ DEAGLE_PRICE ] );
			
			if( g_iUserCredits[ id ] < iNeededCredits )
			{
				ColorChat( id, RED, "^x04%s^x03 NU^x01 ai destule credite, iti mai trebuie^x03 %i credite^x01 !", g_szTag, iNeededCredits - g_iUserCredits[ id ] );
				return PLUGIN_HANDLED;
			}
			
			g_iUserCredits[ id ] -= iNeededCredits;
			
			new iAMMO = get_pcvar_num( g_iCvar[ DEAGLE_BACKPACK_AMMO ] );
			ColorChat( id, RED, "^x04%s^x01 Ai cumparat^x03 %i AMMO Deagle^x01 pentru^x03 %i credite^x01 !", g_szTag, iAMMO, iNeededCredits );
			
			give_item( id, "weapon_deagle" );
			cs_set_user_bpammo( id, CSW_DEAGLE, iAMMO );
			
		}
		
		case 5:
		{
			new iNeededCredits;
			iNeededCredits = get_pcvar_num( g_iCvar[ SPEED_PRICE ] );
			
			if( g_iUserCredits[ id ] < iNeededCredits )
			{
				ColorChat( id, RED, "^x04%s^x03 NU^x01 ai destule credite, iti mai trebuie^x03 %i credite^x01 !", g_szTag, iNeededCredits - g_iUserCredits[ id ] );
				return PLUGIN_HANDLED;
			}
			
			g_iUserCredits[ id ] -= iNeededCredits;
			
			new iSpeed = get_pcvar_num( g_iCvar[ SPEED_AMOUNT ] );
			ColorChat( id, RED, "^x04%s^x01 Ai cumparat^x03 %.1f Speed^x01 pentru^x03 %i credite^x01 !", g_szTag, float( iSpeed ), iNeededCredits );
			
			g_bUserHas[ id ][ SPEED ] = true;
			engfunc( EngFunc_SetClientMaxspeed, id, float( iSpeed )  );
			set_pev( id,  pev_maxspeed, float( iSpeed ) );
			
			/*	SlowHack o_O
			client_cmd( id, "cl_forwardspeed %0.1f;cl_sidespeed %0.1f;cl_backspeed %0.1f", float( iSpeed ), float( iSpeed ), float( iSpeed ) );
			*/
		}
		
		case 6:
		{
			new iNeededCredits;
			iNeededCredits = get_pcvar_num( g_iCvar[ GRAVITY_PRICE ] );
			
			if( g_iUserCredits[ id ] < iNeededCredits )
			{
				ColorChat( id, RED, "^x04%s^x03 NU^x01 ai destule credite, iti mai trebuie^x03 %i credite^x01 !", g_szTag, iNeededCredits - g_iUserCredits[ id ] );
				return PLUGIN_HANDLED;
			}
			
			g_iUserCredits[ id ] -= iNeededCredits;
			
			new iGravity = get_pcvar_num( g_iCvar[ GRAVITY_AMOUNT ] );
			ColorChat( id, RED, "^x04%s^x01 Ai cumparat^x03 %i Gravity^x01 pentru^x03 %i credite^x01 !", g_szTag, iGravity, iNeededCredits );
			
			set_user_gravity( id, float( iGravity ) * 0.00125 );
			g_bUserHas[ id ][ GRAVITY ] = true;
		}
		
	}
	
	return PLUGIN_CONTINUE;
	
}

public CallBackShop( id, iMenu, iItem  )
{
	static _access, szInfo[ 4 ],  callback;
	menu_item_getinfo( iMenu, iItem, _access, szInfo, sizeof ( szInfo ) -1, _, _, callback );
	
	//if( szInfo[ 0 ] == '0' )	return ITEM_ENABLED;
	
 	if( szInfo[ 0 ] == '1' )
	{
		if( get_pcvar_num( g_iCvar[ NADES_TO ] ) == 3 || fcs_get_user_team( id ) == get_pcvar_num( g_iCvar[ NADES_TO ] ) )
			return ITEM_ENABLED;
	}
	else if( szInfo[ 0 ] == '2' )
	{
		if( get_pcvar_num( g_iCvar[ HP_TO ] ) == 3 || fcs_get_user_team( id ) == get_pcvar_num( g_iCvar[ HP_TO ] ) )
			return ITEM_ENABLED;
	}
	else if( szInfo[ 0 ] == '3' )
	{
		if( get_pcvar_num( g_iCvar[ AP_TO ] ) == 3 || fcs_get_user_team( id ) == get_pcvar_num( g_iCvar[ AP_TO ] ) )
			return ITEM_ENABLED;
	}
	else if( szInfo[ 0 ] == '4' )
	{
		if( get_pcvar_num( g_iCvar[ DEAGLE_TO ] ) == 3 || fcs_get_user_team( id ) == get_pcvar_num( g_iCvar[ DEAGLE_TO] ) )
			return ITEM_ENABLED;
	}
	else if( szInfo[ 0 ] == '5' )
	{
		if( get_pcvar_num( g_iCvar[ SPEED_TO ] ) == 3 || fcs_get_user_team( id ) == get_pcvar_num( g_iCvar[ SPEED_TO ] ) )
			return ITEM_ENABLED;
	}
	
	else if( szInfo[ 0 ] == '6' )
	{
		if( get_pcvar_num( g_iCvar[ GRAVITY_TO ] ) == 3 || fcs_get_user_team( id ) == get_pcvar_num( g_iCvar[ GRAVITY_TO ] ) )
			return ITEM_ENABLED;
	}
	
	return ITEM_DISABLED;
}

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 > < credite >" );
		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, RED, "^x04^%s^x01 Adminul^x03 %s^x01 le-a dat^x03 %i^x01 credite tuturor jucatorilor!", g_szTag, 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, RED, "^x04^%s^x01 Adminul^x03 %s^x01 le-a dat^x03 %i^x01 credite jucatorilor de la^x03 TERO^x01!", g_szTag, 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, RED, "^x04^%s^x01 Adminul^x03 %s^x01 le-a dat^x03 %i^x01 credite jucatorilor de la^x03 CT^x01!", g_szTag, 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, RED, "^x04%s^x01 Adminul^x03 %s^x01 i-a dat^x03 %i^x01 credite lui^x03 %s^x01.", g_szTag, 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 > < credite >" );
		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 credite!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, RED, "^x04%s^x01 Adminul^x03 %s^x01 i-a sters^x03 %i^x01 credite lui^x03 %s^x01.", g_szTag, 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^x03 /donate^x01 <^x03 nume^x01 > <^x03 credite^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 credite.", 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 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 credite, ai doar^x03 %i credit%s^x01.",  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^03 %i credit%s^x01 lui^x03 %s^x01 .", g_szTag, szFirstName, iCredits, iCredits == 1 ? "" : "e", szSecondName );
	return PLUGIN_HANDLED;
}

public ham_SpawnPlayerPost( id )
{
	if( !is_user_alive( id ) )
		return;
		
	g_iUserRetired[ id ] = 0;
	
	if( get_pcvar_num( g_iCvar[ SPEED_DURATION ] ) == 1 )
	{
		if( g_bUserHas[ id ][ SPEED ] )
		{
			new iSpeed = get_pcvar_num( g_iCvar[ SPEED_AMOUNT ] );
			engfunc( EngFunc_SetClientMaxspeed, id, float( iSpeed )  );
			set_pev( id,  pev_maxspeed, float( iSpeed ) );
			
			/*	SlowHack o_O
			client_cmd( id, "cl_forwardspeed %0.1f;cl_sidespeed %0.1f;cl_backspeed %0.1f", float( iSpeed ), float( iSpeed ), float( iSpeed ) );
			*/
		}
	}
	else
		g_bUserHas[ id ][ SPEED ] = false;
		
	if( get_pcvar_num( g_iCvar[ GRAVITY_DURATION ] ) == 1 )
	{
		if( g_bUserHas[ id ][ GRAVITY ] )
			set_user_gravity( id, float( get_pcvar_num( g_iCvar[ GRAVITY_AMOUNT ] ) ) * 0.00125 );
	}
	else
		g_bUserHas[ id ][ GRAVITY ] = false;
			
}

public ham_PlayerKilledPre(  id  )
{
	g_bUserHas[ id ][ SPEED ] = false;
	g_bUserHas[ id ][ GRAVITY ] = false;
}

public ham_PlayerResetMaxSpeedPre( id )
{

	if( is_user_alive( id )  /*&&  get_user_maxspeed(  id  )  !=  1.0*/  )
	{
		
		if( g_bUserHas[ id ][ SPEED ] )
		{
	
			static Float:flMaxSpeed;
			flMaxSpeed = float( get_pcvar_num( g_iCvar[ SPEED_AMOUNT ] ) );
			
			engfunc( EngFunc_SetClientMaxspeed, id, flMaxSpeed  );
			set_pev( id, pev_maxspeed, flMaxSpeed  );
			
		}
		
		
		/*	SlowHack o_O
			client_cmd(  id,  "cl_forwardspeed %0.1f;cl_sidespeed %0.1f;cl_backspeed %0.1f", flMaxSpeed, flMaxSpeed, flMaxSpeed );
		*/
	}
}

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^x03 %s^x01 !", g_szTag, g_szName[ id ], szNewName );
	ColorChat( id, RED, "^x04%s^x01 Am salvat^x03 %i^x01 credite pe numele^x03 %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 credite de pe noul nume (^x03 %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 ] = get_pcvar_num( g_iCvarEntry );
	}
	
}


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, "^x04%s^x01 Ai primit^x03 %i^x01 credite pentru^x03 %i^x01 minute jucate!",
				g_szTag, iCredits, iTime );
				
			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( 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( )
{
	new iDays = get_pcvar_num( g_iCvarPruneDays );
	if( iDays > 0 )
	{
		nvault_prune( iVault, 0, get_systime( ) - ( iDays * ONE_DAY_IN_SECONDS ) );
	}
	
	nvault_close( iVault );
}

stock bool:bUserHasAnyNade( id )
{
	
	if( user_has_weapon( id, CSW_HEGRENADE ) || user_has_weapon( id, CSW_FLASHBANG )
		|| user_has_weapon( id, CSW_SMOKEGRENADE ) )
		return true;
		
	return false;
	
}

stock fcs_get_user_team( id )
{
	new iTeam = -1;
	if( cs_get_user_team( id ) == CS_TEAM_T )	iTeam = 1;
	else if( cs_get_user_team( id ) == CS_TEAM_CT )	iTeam = 2;
	
	return iTeam;
}

ColorChat(  id, Color:iType, const msg[  ], { Float, Sql, Result, _}:...  )
{
	
	// Daca nu se afla nici un jucator pe server oprim TOT. Altfel dam de erori..
	if( !get_playersnum( ) ) return;
	
	new szMessage[ 256 ];

	switch( iType )
	{
		 // Culoarea care o are jucatorul setata in cvar-ul scr_concolor.
		case NORMAL:	szMessage[ 0 ] = 0x01;
		
		// Culoare Verde.
		case GREEN:	szMessage[ 0 ] = 0x04;
		
		// Alb, Rosu, Albastru.
		default: 	szMessage[ 0 ] = 0x03;
	}

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

	// Ne asiguram ca mesajul nu este mai lung de 192 de caractere.Altfel pica server-ul.
	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;
}
Cvar-uri (se adauga in fisierul amxmodx\configs\amxx.cfg):
  • NEW!fcs_prunedays 15 - sterge toate inregistrarile din nvault care nu au intrat pe server de x zile ( la fiecare sfarsit de mapa ) | setati valoarea 0 pentru a dezactiva functia.
    NEW!fcs_entry_credits 300 - cate credite primesc cand intra pentru prima data pe server.
    NEW! [ 20.03.2014 ]fcs_maxretrieve "0" - nr maxim de credite pe care il pot retrage intr-o runda. ( 0 fara limita de retragere )
    fcs_pentru_enable 1 - activeaza/dezactiveaza bonusurile pentru timpul petrecut pe server.
    fcs_pentru_minutes 5 - minutele jucate ca sa primeasca y credite. ( din x in x minute )
    fcs_pentru_credits 15 - creditele care le primeste din in x in x minute.
    fcs_kr_enable 1 - activeaza/dezactiveaza bonusurile de la kill.
    fcs_kr_credits 7 - cate credite primeste la fiecare kill.
    fcs_kr_hscredits 3 - cate credite primeste bonus daca a dat HeadShot ( => 7 + 3 = 10 )
    fcs_transfer_enable 1 - activeaza / dezactiveaza transferul de credite.
    fcs_transfer_maxcredits 50 - cantitatea maxima de credite pe care o poti transfera o data.
    fcs_wtr_enable 1 - activeaza/dezactiveaza bonusurile pentru castigarea rundei.
    fcs_wtr_furien 3 - cate credite primesc furienii daca au castigat runda. ( 0, dezactiveaza reward-ul pentru echipa furien )
    fcs_wtr_anti 5 - cate credite primesc antifurienii daca au castigat runda. ( 0, dezactiveaza reward-ul pentru echipa antifurien )

    fcsshop_enable 1 - activeaza / dezactiveaza pluginul
    fcsshop_nades_price 25 - pretul grenazilor
    fcsshop_nades_team 1 - echipa care poate cumpara ( 0 niciuna, 1 doar furienii, 2 doar antifurienii, 3 ambii )
    fcsshop_hp_price 60 - pretul pentru HP
    fcsshop_hp_amount 300 - cantitatea de HP care apare in shop spre cumparare.
    fcsshop_hp_team 3 - echipa care poate cumpara ( 0 niciuna, 1 doar furienii, 2 doar antifurienii, 3 ambii )
    fcsshop_ap_price 55 - pretul pentru AP
    fcsshop_ap_amount 300 - cantitatea de AP care apare in shop spre cumparare.
    fcsshop_ap_team 3 - echipa care poate cumpara ( 0 niciuna, 1 doar furienii, 2 doar antifurienii, 3 ambii )
    fcsshop_deagle_price 80 - pretul pentru DEAGLE
    fcsshop_deagle_ammo 21 - cate gloante primeste la DEAGLE
    fcsshop_deagle_team 1 - echipa care poate cumpara ( 0 niciuna, 1 doar furienii, 2 doar antifurienii, 3 ambii )
    fcsshop_speed_price 75 - pretul vitezei
    fcsshop_speed_amount 550 - ce viteza primeste
    fcsshop_speed_duration 1 - daca ii ramane viteza pana moare( 0 runda viitoare ii dispare viteza | 1 ii ramane viteza pana jucatorul moare )
    fcsshop_speed_team 2 - echipa care poate cumpara ( 0 niciuna, 1 doar furienii, 2 doar antifurienii, 3 ambii )
    fcsshop_gravity_price 75 - pretul gravitatiei
    fcsshop_gravity_amount 330 - ce gravitate primeste
    fcsshop_gravity_duration 1 - daca ii ramane gravitatia pana moare( 0 runda viitoare ii dispare gravitatia | 1 ii ramane gravitatia pana jucatorul moare )
    fcsshop_gravity_team 2 - echipa care poate cumpara ( 0 niciuna, 1 doar furienii, 2 doar antifurienii, 3 ambii )

Comenzi administrative (se tasteaza in consola si trebuie sa fiti administrator):
  • amx_give_credits < nume/ @ALL/ @CT/ @T > < credite > - dai credite cuiva.
    amx_take_credits < nume > - ii stergi din credite cuiva.
Comenzi publice (se tasteaza in joc prin apasarea tastei Y):
  • /credits - aflii cate credite ai
    /credits < nume > - aflii cate credite are jucatorul respectiv
    /deposit sau /depozit - depozitezi 16000$ si primesti un credit
    /retrage sau /withdraw - retragi un credit si premesti 16000$
    /transfer <nume> <credite> - transferi x credite jucatorului specificat.
    /donate <nume> <credite> - transferi x credite jucatorului specificat.
    fcshop - afiseaza meniul.
    /fcshop - afiseaza meniul.
Module necesare (se sterge ; din fata modulului de mai jos; acestea le gasiti in fisierul amxmodx\configs\modules.ini):
- cstrike
- fakemeta
- hamsandwich
- nvault
- fun
Serverele care folosesc pluginurile de mai sus:

Furien Credits Sistem
Furien Credits Sistem AIO
FCS Shop
Furien Credits Sistem AIO + FCS Shop
Last edited by Ulquiorra on 05 Apr 2016, 20:31, edited 35 times in total.
""Copilarie, iarta-ma c-am vrut sa fiu om mare.. ""
User avatar
PlayToy
Membru, skill +1
Membru, skill +1
Posts: 493
Joined: 02 Aug 2011, 18:56
Detinator Steam: Da
CS Status: Busy
Detinator server CS: DA.
Reputatie: Membru Club eXtreamCS (1 luna)
Utilizator neserios ( tepar )
Location: Bucuresti
Has thanked: 17 times
Been thanked: 24 times
Contact:

01 Jul 2013, 10:17

Sunt buguri..

Când vreau să dau credite la cineva.

furien_credite @all 10 (nu merge)
furien_credite X zice aşa: Adminul Goffy (numele meu) a dat X credite la Goffy, apare tot numele meu.
Şi când ies de pe server se tot resetează.
User avatar
Keennn[x]
Membru, skill 0
Membru, skill 0
Posts: 29
Joined: 01 Jul 2013, 09:02
Detinator Steam: Da
SteamID: Extreme
Has thanked: 1 time
Contact:

01 Jul 2013, 12:33

Eu Folosesc,Acest plugin si n-am Treaba cu el. gj
Image


Image
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:

10 Jul 2013, 20:58

PlayToy wrote:Sunt buguri..

Când vreau să dau credite la cineva.

furien_credite @all 10 (nu merge)
furien_credite X zice aşa: Adminul Goffy (numele meu) a dat X credite la Goffy, apare tot numele meu.
Şi când ies de pe server se tot resetează.
plugin`ul ruleaza pe un sv de mai bine de 3 luni.. ( a fost plugin privat ) si nu a dat nici`o eroare.

btw nu exista nicio comanda furien_credite ..

Code: Select all

Comenzi administrative (se tasteaza in consola si trebuie sa fiti administrator):

    amx_give_credits < nume/ @ALL/ @CT/ @T > < credite > - dai credite cuiva.
    amx_take_credits < nume > - ii stergi din credite cuiva.
""Copilarie, iarta-ma c-am vrut sa fiu om mare.. ""
User avatar
L E V I N
Scripter eXtreamCS
Scripter eXtreamCS
Posts: 2174
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:

13 Jul 2013, 13:11

Te rog frumos nu poti face in asa fel incat daca cinva joaca 5(sau mai multe) minute pe sv sa primeasca o cantitate de credite(setat) si sa poata si dona te rog frumos :o3
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.
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:

13 Jul 2013, 15:42

pluginul pentru timp jucat pe sv:
FCS PlayedTime Reward | Afiseaza codul
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <CC_ColorChat>
#include <fcs>

#define PLUGIN "FCS PlayedTime Reward"
#define VERSION "1.0"

#define TASK	06091993
new const g_szTag[ ] = "[Furien Credits]";

new g_iCvarTime;
new g_iCvarCredits;

new g_iUserTime[ 33 ];

public plugin_init( )
{
	register_plugin( PLUGIN, VERSION, "Askhanar" );
	
	g_iCvarTime = register_cvar( "fmu_time", "5" );
	g_iCvarCredits = register_cvar( "fmu_credits", "15" );
	
	// Add your code here...
}



public client_putinserver( id )
{
	if( is_user_bot( id ) || is_user_hltv( id ) )
		return PLUGIN_CONTINUE;
	
	g_iUserTime[ id ] = 0;
	set_task( 1.0, "task_Time", id + TASK, _, _, "b", 0 );
	
	return PLUGIN_CONTINUE;
}

public client_disconnect( id )
{
	if( is_user_bot( id ) || is_user_hltv( id ) )
		return PLUGIN_CONTINUE;
		
	g_iUserTime[ id ] = 0;
	remove_task( id + TASK );
	
	return PLUGIN_CONTINUE;
}

public task_Time( id )
{
	id -= TASK;
	if( !is_user_connected( id ) )
		return PLUGIN_HANDLED;
		
	g_iUserTime[ id ]++;
	static iTime;
	iTime = get_pcvar_num( g_iCvarTime ) ;
	
	if( g_iUserTime[ id ] >= iTime * 60 )
	{
		g_iUserTime[ id ] -= iTime * 60;
		
		static iCredits;
		iCredits = get_pcvar_num( g_iCvarCredits );
		
		fcs_add_user_credits( id, iCredits );
		ColorChat( id, RED, "^x04%s^x01 Ai primit^x03 %i^x01 credite pentru^x03 %i^x01 minute jucate!",
			g_szTag, iCredits, iTime );
			
	}
	
	return PLUGIN_CONTINUE;
	
}
Cvaruri:

fmu_time 5 ( la cate minute primeste x credite )
fmu_credits 15 ( cate credite primeste )

o sa dau edit si cu celalalt plugin.

btw ia din primul post CC_ColorChat.inc si fcs.inc
""Copilarie, iarta-ma c-am vrut sa fiu om mare.. ""
User avatar
Chris Duskblade
Utilizator neserios (tepar)
Utilizator neserios (tepar)
Posts: 2887
Joined: 18 Jun 2013, 15:46
Detinator Steam: Da
Reputatie: Fost super moderator
Nume anterior: Cristinel.
Utilizator neserios (tepar)
Location: Timișoara
Has thanked: 62 times
Been thanked: 19 times
Contact:

14 Jul 2013, 02:03

Si ca si un gen de furien cu creditele acelea sa poti lua credite cand omori un jucator adica cand omori un jucator ai 1 credit cand omori inca unul ai inca un credit iar daca omori 3 ai un bonus si iti da 2 .. daca eram si eu priceput sau macar sa stiu sa fac :))
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:

14 Jul 2013, 03:26

le fac maine pe aman2, acum ma culc.
""Copilarie, iarta-ma c-am vrut sa fiu om mare.. ""
User avatar
L E V I N
Scripter eXtreamCS
Scripter eXtreamCS
Posts: 2174
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:

14 Jul 2013, 09:13

Ok mersi mult nb

EDIT: am vzt ca ai facut da as dori sa imbini pluginurile si cu credit pe kill :)

EDIT 2: Am incercat eu sa le combin dar nu stiu daca e bine (nu am testat)
| Afiseaza codul
#include < amxmodx >
#include < amxmisc >
#include < cstrike >
#include < fakemeta >
#include < nvault >
#include < CC_ColorChat >
#include < fcs >

#pragma semicolon 1

#define PLUGIN "Furien Credits System"
#define VERSION "0.4.12"

#define TASK	06091993

new const g_szTag[ ] = "[Furien Credits]";

new const g_szGiveCreditsFlag[ ] = "a";

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

new iVault;

new g_iCvarTime;
new g_iCvarCredits;

new g_iUserTime[ 33 ];

new g_iCvarHSCredits;

//stock fcs_add_user_credits(client, credits)
//{
	//return fcs_set_user_credits(client, fcs_get_user_credits(client) + credits);
//}

//stock fcs_sub_user_credits(client, credits)
//{
	//return fcs_set_user_credits(client, fcs_get_user_credits(client) - credits);
//}

//native fcs_get_user_credits(client);
//native fcs_set_user_credits(client, credits);

public plugin_init( )
{
	register_plugin( PLUGIN, VERSION, "Askhanar" );
	
	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( "amx_give_credits", "ClCmdGiveCredits" );
	register_clcmd( "amx_take_credits", "ClCmdTakeCredits" );

	g_iCvarTime = register_cvar( "fcs_pentru_minutes", "5" );
	g_iCvarCredits = register_cvar( "fcs_pentru_credits", "15" );

	g_iCvarCredits = register_cvar( "fcs_kr_credits", "3" );
	g_iCvarHSCredits = register_cvar( "fcs_kr_hscredits", "7" );
	
	register_event( "DeathMsg","ev_DeathMsg", "a");
	
	register_forward( FM_ClientUserInfoChanged, "Fwd_ClientUserInfoChanged" );
	
	iVault  =  nvault_open(  "FurienCreditsSystem"  );
	
	if(  iVault  ==  INVALID_HANDLE  )
	{
		set_fail_state(  "nValut returned invalid handle!"  );
	}

}

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 0;
	
	get_user_name( id, g_szName[ id ], sizeof ( g_szName[] ) -1 );
	LoadCredits( id );
	
	return 0;
	
}

public client_putinserver( id )
{
	if( is_user_bot( id ) || is_user_hltv( id ) )
		return PLUGIN_CONTINUE;
	
	g_iUserTime[ id ] = 0;
	set_task( 1.0, "task_Time", id + TASK, _, _, "b", 0 );
	
	return PLUGIN_CONTINUE;
}

public client_disconnect( id )
{
	if( is_user_bot( id ) || is_user_hltv( id ) )
		return 0;
		
	SaveCredits( id );
		
	g_iUserTime[ id ] = 0;
	remove_task( id + TASK );

	return PLUGIN_CONTINUE;
}

public ev_DeathMsg()
{
	new iKiller = read_data( 1 );
	if( iKiller == read_data( 2 ) )
		return PLUGIN_CONTINUE;
		
	new iCredits = get_pcvar_num( g_iCvarCredits );
	
	if( read_data( 3 ) )
		iCredits += get_pcvar_num( g_iCvarHSCredits );
		
	fcs_add_user_credits( iKiller, iCredits );
	
	return PLUGIN_CONTINUE;
}

public task_Time( id )
{
	id -= TASK;
	if( !is_user_connected( id ) )
		return PLUGIN_HANDLED;
		
	g_iUserTime[ id ]++;
	static iTime;
	iTime = get_pcvar_num( g_iCvarTime ) ;
	
	if( g_iUserTime[ id ] >= iTime * 60 )
	{
		g_iUserTime[ id ] -= iTime * 60;
		
		static iCredits;
		iCredits = get_pcvar_num( g_iCvarCredits );
		
		fcs_add_user_credits( id, iCredits );
		ColorChat( id, RED, "^x04[Dr.rLz.Ro]^x01 Ai primit^x04 %i^x01 credite pentru ca ai jucat^x04 %i^x01 minute pe ^x04Dr.rLz.Ro ^x01!", iCredits, iTime );
		ColorChat( id, RED, "^x01Joaca in ^x04continuare ^x01si vei primi iar !" );
			
	}
	
	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 );
	
	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;
	}
	
	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 credite.", 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^x03 %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^x03 1^x01 credit.", g_szTag );
			cs_set_user_money( id, 0 );
			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^x03 16000$^x01.", g_szTag );
			cs_set_user_money( id, iMoney + 16000 );
			
			g_iUserCredits[ id ] -=1;
			SaveCredits( id );
			
			if( ( iMoney + 16000 ) > 16000 )
			{
				ColorChat( id, RED, "^x04%s^x03 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$^x01.", g_szTag );
				return 1;
			}
		}
		else
		{
			ColorChat(id, RED, "^x04%s^x03 NU^x01 ai ce sa retragi, ai^x03 0^x01 credite.", 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 > < credite >" );
		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, RED, "^x04^%s^x01 Adminul^x03 %s^x01 le-a dat^x03 %i^x01 credite tuturor jucatorilor!", g_szTag, 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, RED, "^x04^%s^x01 Adminul^x03 %s^x01 le-a dat^x03 %i^x01 credite jucatorilor de la^x03 TERO^x01!", g_szTag, 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, RED, "^x04^%s^x01 Adminul^x03 %s^x01 le-a dat^x03 %i^x01 credite jucatorilor de la^x03 CT^x01!", g_szTag, 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( id, _szName, sizeof ( _szName ) -1 );
	
	ColorChat( 0, RED, "^x04%s^x01 Adminul^x03 %s^x01 i-a dat^x03 %i^x01 credite lui^x03 %s^x01.", g_szTag, 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 > < credite >" );
		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 credite!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( id, _szName, sizeof ( _szName ) -1 );
	
	ColorChat( 0, RED, "^x04%s^x01 Adminul^x03 %s^x01 i-a sters^x03 %i^x01 credite lui^x03 %s^x01.", g_szTag, szName, iCredits, _szName );
	
	return 1;
	
	
}

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^x03 %s^x01 !", g_szTag, g_szName[ id ], szNewName );
	ColorChat( id, RED, "^x04%s^x01 Am salvat^x03 %i^x01 credite pe numele^x03 %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 credite de pe noul nume (^x03 %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 plugin_end( )
{
	nvault_close( iVault );
}
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.
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:

14 Jul 2013, 13:36

Adryyy wrote:Ok mersi mult nb

EDIT: am vzt ca ai facut da as dori sa imbini pluginurile si cu credit pe kill :)

EDIT 2: Am incercat eu sa le combin dar nu stiu daca e bine (nu am testat)
| Afiseaza codul
#include < amxmodx >
#include < amxmisc >
#include < cstrike >
#include < fakemeta >
#include < nvault >
#include < CC_ColorChat >
#include < fcs >

#pragma semicolon 1

#define PLUGIN "Furien Credits System"
#define VERSION "0.4.12"

#define TASK	06091993

new const g_szTag[ ] = "[Furien Credits]";

new const g_szGiveCreditsFlag[ ] = "a";

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

new iVault;

new g_iCvarTime;
new g_iCvarCredits;

new g_iUserTime[ 33 ];

new g_iCvarHSCredits;

//stock fcs_add_user_credits(client, credits)
//{
	//return fcs_set_user_credits(client, fcs_get_user_credits(client) + credits);
//}

//stock fcs_sub_user_credits(client, credits)
//{
	//return fcs_set_user_credits(client, fcs_get_user_credits(client) - credits);
//}

//native fcs_get_user_credits(client);
//native fcs_set_user_credits(client, credits);

public plugin_init( )
{
	register_plugin( PLUGIN, VERSION, "Askhanar" );
	
	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( "amx_give_credits", "ClCmdGiveCredits" );
	register_clcmd( "amx_take_credits", "ClCmdTakeCredits" );

	g_iCvarTime = register_cvar( "fcs_pentru_minutes", "5" );
	g_iCvarCredits = register_cvar( "fcs_pentru_credits", "15" );

	g_iCvarCredits = register_cvar( "fcs_kr_credits", "3" );
	g_iCvarHSCredits = register_cvar( "fcs_kr_hscredits", "7" );
	
	register_event( "DeathMsg","ev_DeathMsg", "a");
	
	register_forward( FM_ClientUserInfoChanged, "Fwd_ClientUserInfoChanged" );
	
	iVault  =  nvault_open(  "FurienCreditsSystem"  );
	
	if(  iVault  ==  INVALID_HANDLE  )
	{
		set_fail_state(  "nValut returned invalid handle!"  );
	}

}

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 0;
	
	get_user_name( id, g_szName[ id ], sizeof ( g_szName[] ) -1 );
	LoadCredits( id );
	
	return 0;
	
}

public client_putinserver( id )
{
	if( is_user_bot( id ) || is_user_hltv( id ) )
		return PLUGIN_CONTINUE;
	
	g_iUserTime[ id ] = 0;
	set_task( 1.0, "task_Time", id + TASK, _, _, "b", 0 );
	
	return PLUGIN_CONTINUE;
}

public client_disconnect( id )
{
	if( is_user_bot( id ) || is_user_hltv( id ) )
		return 0;
		
	SaveCredits( id );
		
	g_iUserTime[ id ] = 0;
	remove_task( id + TASK );

	return PLUGIN_CONTINUE;
}

public ev_DeathMsg()
{
	new iKiller = read_data( 1 );
	if( iKiller == read_data( 2 ) )
		return PLUGIN_CONTINUE;
		
	new iCredits = get_pcvar_num( g_iCvarCredits );
	
	if( read_data( 3 ) )
		iCredits += get_pcvar_num( g_iCvarHSCredits );
		
	fcs_add_user_credits( iKiller, iCredits );
	
	return PLUGIN_CONTINUE;
}

public task_Time( id )
{
	id -= TASK;
	if( !is_user_connected( id ) )
		return PLUGIN_HANDLED;
		
	g_iUserTime[ id ]++;
	static iTime;
	iTime = get_pcvar_num( g_iCvarTime ) ;
	
	if( g_iUserTime[ id ] >= iTime * 60 )
	{
		g_iUserTime[ id ] -= iTime * 60;
		
		static iCredits;
		iCredits = get_pcvar_num( g_iCvarCredits );
		
		fcs_add_user_credits( id, iCredits );
		ColorChat( id, RED, "^x04[Dr.rLz.Ro]^x01 Ai primit^x04 %i^x01 credite pentru ca ai jucat^x04 %i^x01 minute pe ^x04Dr.rLz.Ro ^x01!", iCredits, iTime );
		ColorChat( id, RED, "^x01Joaca in ^x04continuare ^x01si vei primi iar !" );
			
	}
	
	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 );
	
	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;
	}
	
	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 credite.", 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^x03 %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^x03 1^x01 credit.", g_szTag );
			cs_set_user_money( id, 0 );
			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^x03 16000$^x01.", g_szTag );
			cs_set_user_money( id, iMoney + 16000 );
			
			g_iUserCredits[ id ] -=1;
			SaveCredits( id );
			
			if( ( iMoney + 16000 ) > 16000 )
			{
				ColorChat( id, RED, "^x04%s^x03 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$^x01.", g_szTag );
				return 1;
			}
		}
		else
		{
			ColorChat(id, RED, "^x04%s^x03 NU^x01 ai ce sa retragi, ai^x03 0^x01 credite.", 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 > < credite >" );
		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, RED, "^x04^%s^x01 Adminul^x03 %s^x01 le-a dat^x03 %i^x01 credite tuturor jucatorilor!", g_szTag, 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, RED, "^x04^%s^x01 Adminul^x03 %s^x01 le-a dat^x03 %i^x01 credite jucatorilor de la^x03 TERO^x01!", g_szTag, 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, RED, "^x04^%s^x01 Adminul^x03 %s^x01 le-a dat^x03 %i^x01 credite jucatorilor de la^x03 CT^x01!", g_szTag, 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( id, _szName, sizeof ( _szName ) -1 );
	
	ColorChat( 0, RED, "^x04%s^x01 Adminul^x03 %s^x01 i-a dat^x03 %i^x01 credite lui^x03 %s^x01.", g_szTag, 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 > < credite >" );
		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 credite!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( id, _szName, sizeof ( _szName ) -1 );
	
	ColorChat( 0, RED, "^x04%s^x01 Adminul^x03 %s^x01 i-a sters^x03 %i^x01 credite lui^x03 %s^x01.", g_szTag, szName, iCredits, _szName );
	
	return 1;
	
	
}

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^x03 %s^x01 !", g_szTag, g_szName[ id ], szNewName );
	ColorChat( id, RED, "^x04%s^x01 Am salvat^x03 %i^x01 credite pe numele^x03 %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 credite de pe noul nume (^x03 %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 plugin_end( )
{
	nvault_close( iVault );
}

ai putina rabdare, urmeaza sa mai postez inca 2 pluginuri si apoi voi face un AIO.. ( all in one )
""Copilarie, iarta-ma c-am vrut sa fiu om mare.. ""
User avatar
lexta
Fost moderator
Fost moderator
Posts: 922
Joined: 02 May 2009, 00:52
Detinator Steam: Da
SteamID: hhh_cs
Reputatie: Fost Moderator
Membru Club eXtreamCS (o luna)
Location: Galaţi
Has thanked: 6 times
Been thanked: 4 times
Contact:

14 Jul 2013, 14:21

Askhanar wrote:Descriere: Acesta este un plugin de credite pentru modul furien.
Deasemenea poate fi folosit si in alte moduri.
In ce consta acest plugin? Ei bine, cand ai 16000$, prin simpla comanda, /deposit, iti transformi banii in 1 credit.
Nu exista limita de credite.
Creditele se salveaza pe nume.

Plugin-ul are si native, cu care poti afla/modifica creditele unui jucator, din alte plugine.


Descarcare:
Furien Credits System | Afiseaza codul
#include < amxmodx >
#include < amxmisc >
#include < cstrike >
#include < fakemeta >
#include < nvault >
#include < CC_ColorChat >

#pragma semicolon 1


#define PLUGIN "Furien Credits System"
#define VERSION "0.4.12"

new const g_szTag[ ] = "[Furien Credits]";

new const g_szGiveCreditsFlag[ ] = "a";

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

new iVault;

public plugin_init( )
{
	register_plugin( PLUGIN, VERSION, "Askhanar" );
	
	register_clcmd( "say", "ClCmdSay" );
	register_clcmd( "say_team", "ClCmdSay" );
	
	register_clcmd( "say /depozit", "ClCmdSayDepozit" );
	register_clcmd( "say /deposit", "ClCmdSayDepozit" );
	register_clcmd( "say_team /depozit", "ClCmdSayDepozit" );
	register_clcmd( "say_team /deposit", "ClCmdSayDepozit" );
	
	register_clcmd( "say /retrage", "ClCmdSayRetrage" );
	register_clcmd( "say /withdraw", "ClCmdSayRetrage" );
	register_clcmd( "say_team /retrage", "ClCmdSayRetrage" );
	register_clcmd( "say_team /withdraw", "ClCmdSayRetrage" );
	
	register_clcmd( "fcs_credite", "ClCmdCredits" );
	register_clcmd( "fcs_credits", "ClCmdCredits" );
	
	register_clcmd( "amx_give_credits", "ClCmdGiveCredits" );
	register_clcmd( "amx_take_credits", "ClCmdTakeCredits" );
	
	register_forward( FM_ClientUserInfoChanged, "Fwd_ClientUserInfoChanged" );
	
	iVault  =  nvault_open(  "FurienCreditsSystem"  );
	
	if(  iVault  ==  INVALID_HANDLE  )
	{
		set_fail_state(  "nValut returned invalid handle!"  );
	}

}

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 0;
	
	get_user_name( id, g_szName[ id ], sizeof ( g_szName[] ) -1 );
	LoadCredits( id );
	
	return 0;
	
}

public client_disconnect( id )
{
	if( is_user_bot( id ) )
		return 0;
		
	SaveCredits( id );
	
	return 0;
	
}

public ClCmdSay( id )
{
	static szArgs[192];
	read_args( szArgs, sizeof ( szArgs ) -1 );
	
	if( !szArgs[ 0 ] )
		return 0;
	
	new szCommand[ 15 ];
	remove_quotes( szArgs );
	
	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;
	}
	
	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 credite.", 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^x03 %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^x03 1^x01 credit.", g_szTag );
			cs_set_user_money( id, 0 );
			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^x03 16000$^x01.", g_szTag );
			cs_set_user_money( id, iMoney + 16000 );
			
			g_iUserCredits[ id ] -=1;
			SaveCredits( id );
			
			if( ( iMoney + 16000 ) > 16000 )
			{
				ColorChat( id, RED, "^x04%s^x03 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$^x01.", g_szTag );
				return 1;
			}
		}
		else
		{
			ColorChat(id, RED, "^x04%s^x03 NU^x01 ai ce sa retragi, ai^x03 0^x01 credite.", 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 > < credite >" );
		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, RED, "^x04^%s^x01 Adminul^x03 %s^x01 le-a dat^x03 %i^x01 credite tuturor jucatorilor!", g_szTag, 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, RED, "^x04^%s^x01 Adminul^x03 %s^x01 le-a dat^x03 %i^x01 credite jucatorilor de la^x03 TERO^x01!", g_szTag, 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, RED, "^x04^%s^x01 Adminul^x03 %s^x01 le-a dat^x03 %i^x01 credite jucatorilor de la^x03 CT^x01!", g_szTag, 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( id, _szName, sizeof ( _szName ) -1 );
	
	ColorChat( 0, RED, "^x04%s^x01 Adminul^x03 %s^x01 i-a dat^x03 %i^x01 credite lui^x03 %s^x01.", g_szTag, 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 > < credite >" );
		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 credite!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( id, _szName, sizeof ( _szName ) -1 );
	
	ColorChat( 0, RED, "^x04%s^x01 Adminul^x03 %s^x01 i-a sters^x03 %i^x01 credite lui^x03 %s^x01.", g_szTag, szName, iCredits, _szName );
	
	return 1;
	
	
}

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^x03 %s^x01 !", g_szTag, g_szName[ id ], szNewName );
	ColorChat( id, RED, "^x04%s^x01 Am salvat^x03 %i^x01 credite pe numele^x03 %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 credite de pe noul nume (^x03 %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 plugin_end( )
{
	nvault_close( iVault );
}
Nume: Furien Credits System
Versiune: v0.4.12
Link oficial: http://www.extreamcs.com/forum

Instalare:
1. Fisierul FurienCreditsSystem.sma il puneti in addons/amxmodx/scripting
2. Fisierul FurienCreditsSystem.amxx il puneti in addons/amxmodx/plugins
3. Intrati in fisierul addons/amxmodx/configs/plugins.ini si adaugati la urma:

Code: Select all

FurienCreditsSystem.amxx
4. Alti pasi necesari....

Este necesara compilarea locala!
O sa aveti nevoie si de fisierul CC_ColorChat.inc .
CC_ColorChat.inc | Afiseaza codul
/*              	        __________________________________
* 			       |Functiile originade create de Numb|
*			        ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯

* 				Fisier rescris si fixat de Askhanar.
*

*				Copyright © 2012, Askhanar @disconnect.ro
*			Acest fisier este prevazut asa cum este ( fara garantii )
*/

#if defined _CC_ColorChat_included
  #endinput
#endif
#define _CC_ColorChat_included

enum Color
{
	NORMAL = 1, 		// Culoarea care o are jucatorul setata in cvar-ul scr_concolor.
	GREEN, 			// Culoare Verde.
	TEAM_COLOR, 		// Culoare Rosu, Albastru, Gri.
	GREY, 			// Culoarea Gri.
	RED, 			// Culoarea Rosu.
	BLUE, 			// Culoarea Albastru.
}

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

ColorChat(  id, Color:iType, const msg[  ], { Float, Sql, Result, _}:...  )
{
	
	// Daca nu se afla nici un jucator pe server oprim TOT. Altfel dam de erori..
	if( !get_playersnum( ) ) return;
	
	new szMessage[ 256 ];

	switch( iType )
	{
		 // Culoarea care o are jucatorul setata in cvar-ul scr_concolor.
		case NORMAL:	szMessage[ 0 ] = 0x01;
		
		// Culoare Verde.
		case GREEN:	szMessage[ 0 ] = 0x04;
		
		// Alb, Rosu, Albastru.
		default: 	szMessage[ 0 ] = 0x03;
	}

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

	// Ne asiguram ca mesajul nu este mai lung de 192 de caractere.Altfel pica server-ul.
	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;
}
Modificatu in fisierul sursa:

Code: Select all

new const g_szGiveCreditsFlag[ ] = "a";
in loc de "a" puneti flagul pentru comenzize de mai jos.


Comenzi administrative (se tasteaza in consola si trebuie sa fiti administrator):
  • amx_give_credits < nume/ @ALL/ @CT/ @T > < credite > - dai credite cuiva.
    amx_take_credits < nume > - ii stergi din credite cuiva.

    Comenzi publice (se tasteaza in joc prin apasarea tastei Y):
    • /credits - aflii cate credite ai
      /credits < nume > - aflii cate credite are jucatorul respectiv
      /deposit sau /depozit - depozitezi 16000$ si primesti un credit
      /retrage sau /withdraw - retragi un credit si premesti 16000$
Module necesare (se sterge ; din fata modulului de mai jos; acestea le gasiti in fisierul amxmodx\configs\modules.ini):
- cstrike
- fakemeta
- nvault
Imagini | Afiseaza codul
Image

LE:

Image

Pentru scripteri sau cei ce se pricep cat de cat:
fcs.inc | 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);
}

Exemplu de folosire:
FCS Example | Afiseaza codul
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <fcs>

#define PLUGIN "FCS Example"
#define VERSION "1.0"


public plugin_init( )
{
	register_plugin( PLUGIN, VERSION, "Askhanar" );
	
	register_clcmd( "say /credite2", "say_Credite" );
	register_clcmd( "say /freecredits", "say_FreeCredits" );
	// Add your code here...
}

public say_Credite( id )
{
	new iCredits = fcs_get_user_credits( id );
	client_print( id, print_chat, "[FCS TEST]: Ai %i credite!", iCredits );
}

public say_FreeCredits( id )
{
	new iCredits = fcs_get_user_credits( id );
	new iNewCredits = fcs_set_user_credits( id, iCredits + 5 );
	client_print( id, print_chat, "[FCS TEST]: Ai primit %i credite, si acum ai in total %i !", iCredits, iNewCredits );
}
Ii rog pe toti cei ce-l vor folosi sa-mi dea macar un Multumesc.
Mulţumesc :)
Image
Post Reply

Return to “AmxModX”

  • Information