Cerere modificare plugin buy_vip

Categoria cu cereri de pluginuri si nu numai.

Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com

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

Daca doriti sa vi se modifice un plugin, va rugam postati aici .
C0non
Membru, skill 0
Membru, skill 0
Posts: 18
Joined: 06 Aug 2020, 14:36
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Fond eXtream: 0

11 Sep 2021, 13:03

Plugin Cerut: Modificare plugin Buy_vip
Descriere (adica ce face el mai exact): A-si dori plugin-u sa fie modificat pentru modul classic
Serverul impune conditii strict HLDS/REHLDS?: Nu
Ai cautat pluginul?(daca da, precizeaza cum): Da, tot pe comunitatea eXtreamCS.com l-am gasit
Necesita mod special?: nu
Configuratie server:1.8.2

Code: Select all

/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <csgo_remake>

#pragma tabsize 0

#define VIP_FLAG "t"
#define COST_VIP_1W 10
#define COST_VIP_1M 10
#define COST_VIP_P 10

new name[33][32]

public plugin_init() {
	register_clcmd("say /buy_vip","BV")
	register_clcmd("say_team /buy_vip","BV")
}

public client_authorized(id)	if(!is_user_bot(id)||!is_user_hltv(id))	get_user_name(id,name[id],charsmax(name[]))

public BV(id)
{
	if(get_user_flags(id)&read_flags(VIP_FLAG)||!csgor_is_user_logged(id))	return
	
	new menu=menu_create("Ia-ti VIP","mh"),form[125]
	
	formatex(form,charsmax(form),"VIP 1 saptamana - %dP",COST_VIP_1W)
	menu_additem(menu,form)
	formatex(form,charsmax(form),"VIP 1 LUNA - %dP",COST_VIP_1M)
	menu_additem(menu,form)
	formatex(form,charsmax(form),"VIP PERMANENT - %dP",COST_VIP_P)
	menu_additem(menu,form)
	
	menu_display(id,menu)
}

public mh(id,menu,item)
{
	new text[125]
	switch(item)
	{
		case 0:
		{
			if(csgor_get_user_points(id)<COST_VIP_1W)	return
			
			csgor_set_user_points(id,csgor_get_user_points(id)-COST_VIP_1W)
			
			formatex(text,charsmax(text),"amx_tempadmin %s 7 %s",name[id],VIP_FLAG)
			server_cmd(text)
		}
		case 1:
		{
			if(csgor_get_user_points(id)<COST_VIP_1M)	return
			
			csgor_set_user_points(id,csgor_get_user_points(id)-COST_VIP_1M)
			
			formatex(text,charsmax(text),"amx_tempadmin %s 27 %s",name[id],VIP_FLAG)
			server_cmd(text)
		}
		case 2:
		{
			if(csgor_get_user_points(id)<COST_VIP_P)	return
			
			csgor_set_user_points(id,csgor_get_user_points(id)-COST_VIP_P)
			
			formatex(text,charsmax(text),"amx_tempadmin %s 0 %s",name[id],VIP_FLAG)
			server_cmd(text)
		}
	}
}
C0non
Membru, skill 0
Membru, skill 0
Posts: 18
Joined: 06 Aug 2020, 14:36
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Fond eXtream: 0

12 Sep 2021, 14:04

UP!! Ma ajuta cineva va rog frumos
User avatar
N3v3rM1nd
Membru, skill +2
Membru, skill +2
Posts: 522
Joined: 06 Oct 2018, 13:41
Detinator Steam: Da
Fond eXtream: 0
Location: La mine in casa :D
Has thanked: 92 times
Been thanked: 25 times

12 Sep 2021, 15:16

Pe ce sistem vr pluginul? Lasa link cv..
C0non
Membru, skill 0
Membru, skill 0
Posts: 18
Joined: 06 Aug 2020, 14:36
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Fond eXtream: 0

12 Sep 2021, 15:23

C0non
Membru, skill 0
Membru, skill 0
Posts: 18
Joined: 06 Aug 2020, 14:36
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Fond eXtream: 0

12 Sep 2021, 15:28

N3v3rM1nd wrote:
12 Sep 2021, 15:16
Pe ce sistem vr pluginul? Lasa link cv..
Sau poti sa mi-l faci pe credite?

Code: Select all

#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[ ] = "[CSHELLWORLD CREDITS]";
new const g_szGiveCreditsFlag[ ] = "u";

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_concmd( "amx_give_credits", "ClCmdGiveCredits" );
	register_concmd( "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 1000^x01 credite.", g_szTag );
			cs_set_user_money( id, iMoney - 16000 );
			g_iUserCredits[ id ] += 1000;
			
			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 100$^x01.", g_szTag );
			cs_set_user_money( id, iMoney + 100 );
			
			g_iUserCredits[ id ] -=1;
			g_iUserRetired[ id ]++;
			
			SaveCredits( id );
			
			if( ( iMoney + 100 ) > 100 )
			{
				ColorChat( id, RED, "^x04%s^x03 ATENTIE^x01, ai^x03 %i$^x01 !", g_szTag, iMoney + 100 );
				ColorChat( id, RED, "^x04%s^x01 La spawn, vei pierde tot ce depaseste suma de^x03 100$^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;
}
User avatar
CyBer[N]eTicK
Membru, skill 0
Membru, skill 0
Posts: 67
Joined: 29 May 2020, 04:35
Detinator Steam: Da
CS Status: Citesc & Ajut | BB Force
Detinator server CS: BB.BlackGames.Ro
SteamID: BBCyBer
Fond eXtream: 0
Location: LocalHost
Discord: CyBer[N]eTicK#9999
Has thanked: 7 times
Been thanked: 3 times
Contact:

12 Sep 2021, 23:40

Poftim ți l-am făcut pe FCS pluginul, dar noi nu știm exact ce anume este în acel înclude csgo_remake.

Code: Select all

/* Plugin generated by AMXX-Studio */

#include <amxmodx>

native fcs_get_user_credits ( id );
native fcs_set_user_credits ( id, credits ); 

#define VIP_FLAG "t"


#define COST_VIP_1W 10
#define COST_VIP_1M 10
#define COST_VIP_P 10

new name[33][32]

public plugin_init() {
    register_clcmd("say /buy_vip","BV")
    register_clcmd("say_team /buy_vip","BV")
}

public client_authorized(id)    if(!is_user_bot(id)||!is_user_hltv(id)) get_user_name(id,name[id],charsmax(name[]))

public BV(id)
{
    if(get_user_flags(id) & ADMIN_LEVEL_H) {
    
    new menu=menu_create("Ia-ti VIP","mh"),form[125]
    
    formatex(form,charsmax(form),"VIP 1 saptamana - %dP",COST_VIP_1W)
    menu_additem(menu,form)
    formatex(form,charsmax(form),"VIP 1 LUNA - %dP",COST_VIP_1M)
    menu_additem(menu,form)
    formatex(form,charsmax(form),"VIP PERMANENT - %dP",COST_VIP_P)
    menu_additem(menu,form)
    
    menu_display(id,menu)
    }
}

public mh(id,menu,item)
{
    new text[125]
    switch(item)
    {
        case 0:
        {
            if(fcs_get_user_credits(id)<COST_VIP_1W)   return
            
            fcs_set_user_credits(id,fcs_get_user_credits(id)-COST_VIP_1W)
            
            formatex(text,charsmax(text),"amx_tempadmin %s 7 %s",name[id],VIP_FLAG)
            server_cmd(text)
        }
        case 1:
        {
            if(fcs_get_user_credits(id)<COST_VIP_1M)   return
            
            fcs_set_user_credits(id,fcs_get_user_credits(id)-COST_VIP_1M)
            
            formatex(text,charsmax(text),"amx_tempadmin %s 27 %s",name[id],VIP_FLAG)
            server_cmd(text)
        }
        case 2:
        {
            if(fcs_get_user_credits(id)<COST_VIP_P)    return
            
            fcs_set_user_credits(id,fcs_get_user_credits(id)-COST_VIP_P)
            
            formatex(text,charsmax(text),"amx_tempadmin %s 0 %s",name[id],VIP_FLAG)
            server_cmd(text)
        }
    }
}
,,Mai bine taci și accepți prostia altora, de cât să fii mai nimic decât ei."
| Afiseaza codul
„--» Am văzut oamenii proști ridicându-se chiar peste nivelul celor înalți și mai mari chiar de cât ei în caracter."   :hand_to_chin:  :closed_lips: 
lexz
Membru, skill +1
Membru, skill +1
Posts: 171
Joined: 02 Nov 2020, 01:57
Detinator Steam: Da
Detinator server CS: CSGO.WARFACE.RO
SteamID: profiles/76561198070
Fond eXtream: 0
Discord: lexzor#0630
Has thanked: 11 times
Been thanked: 19 times

13 Sep 2021, 03:08

inca va mai ocupati cu scripting >?
C0non
Membru, skill 0
Membru, skill 0
Posts: 18
Joined: 06 Aug 2020, 14:36
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Fond eXtream: 0

13 Sep 2021, 12:49

CyBer[N]eTicK wrote:
12 Sep 2021, 23:40
Poftim ți l-am făcut pe FCS pluginul, dar noi nu știm exact ce anume este în acel înclude csgo_remake.

Code: Select all

/* Plugin generated by AMXX-Studio */

#include <amxmodx>

native fcs_get_user_credits ( id );
native fcs_set_user_credits ( id, credits ); 

#define VIP_FLAG "t"


#define COST_VIP_1W 10
#define COST_VIP_1M 10
#define COST_VIP_P 10

new name[33][32]

public plugin_init() {
    register_clcmd("say /buy_vip","BV")
    register_clcmd("say_team /buy_vip","BV")
}

public client_authorized(id)    if(!is_user_bot(id)||!is_user_hltv(id)) get_user_name(id,name[id],charsmax(name[]))

public BV(id)
{
    if(get_user_flags(id) & ADMIN_LEVEL_H) {
    
    new menu=menu_create("Ia-ti VIP","mh"),form[125]
    
    formatex(form,charsmax(form),"VIP 1 saptamana - %dP",COST_VIP_1W)
    menu_additem(menu,form)
    formatex(form,charsmax(form),"VIP 1 LUNA - %dP",COST_VIP_1M)
    menu_additem(menu,form)
    formatex(form,charsmax(form),"VIP PERMANENT - %dP",COST_VIP_P)
    menu_additem(menu,form)
    
    menu_display(id,menu)
    }
}

public mh(id,menu,item)
{
    new text[125]
    switch(item)
    {
        case 0:
        {
            if(fcs_get_user_credits(id)<COST_VIP_1W)   return
            
            fcs_set_user_credits(id,fcs_get_user_credits(id)-COST_VIP_1W)
            
            formatex(text,charsmax(text),"amx_tempadmin %s 7 %s",name[id],VIP_FLAG)
            server_cmd(text)
        }
        case 1:
        {
            if(fcs_get_user_credits(id)<COST_VIP_1M)   return
            
            fcs_set_user_credits(id,fcs_get_user_credits(id)-COST_VIP_1M)
            
            formatex(text,charsmax(text),"amx_tempadmin %s 27 %s",name[id],VIP_FLAG)
            server_cmd(text)
        }
        case 2:
        {
            if(fcs_get_user_credits(id)<COST_VIP_P)    return
            
            fcs_set_user_credits(id,fcs_get_user_credits(id)-COST_VIP_P)
            
            formatex(text,charsmax(text),"amx_tempadmin %s 0 %s",name[id],VIP_FLAG)
            server_cmd(text)
        }
    }
}
Nu merge, si nu imi apare nici o eroare in logs, cand scriu /buy_vip nu se intampla nimic
User avatar
CyBer[N]eTicK
Membru, skill 0
Membru, skill 0
Posts: 67
Joined: 29 May 2020, 04:35
Detinator Steam: Da
CS Status: Citesc & Ajut | BB Force
Detinator server CS: BB.BlackGames.Ro
SteamID: BBCyBer
Fond eXtream: 0
Location: LocalHost
Discord: CyBer[N]eTicK#9999
Has thanked: 7 times
Been thanked: 3 times
Contact:

13 Sep 2021, 16:04

C0non wrote:
13 Sep 2021, 12:49
CyBer[N]eTicK wrote:
12 Sep 2021, 23:40
Poftim ți l-am făcut pe FCS pluginul, dar noi nu știm exact ce anume este în acel înclude csgo_remake.

Code: Select all

/* Plugin generated by AMXX-Studio */

#include <amxmodx>

native fcs_get_user_credits ( id );
native fcs_set_user_credits ( id, credits ); 

#define VIP_FLAG "t"


#define COST_VIP_1W 10
#define COST_VIP_1M 10
#define COST_VIP_P 10

new name[33][32]

public plugin_init() {
    register_clcmd("say /buy_vip","BV")
    register_clcmd("say_team /buy_vip","BV")
}

public client_authorized(id)    if(!is_user_bot(id)||!is_user_hltv(id)) get_user_name(id,name[id],charsmax(name[]))

public BV(id)
{
    if(get_user_flags(id) & ADMIN_LEVEL_H) {
    
    new menu=menu_create("Ia-ti VIP","mh"),form[125]
    
    formatex(form,charsmax(form),"VIP 1 saptamana - %dP",COST_VIP_1W)
    menu_additem(menu,form)
    formatex(form,charsmax(form),"VIP 1 LUNA - %dP",COST_VIP_1M)
    menu_additem(menu,form)
    formatex(form,charsmax(form),"VIP PERMANENT - %dP",COST_VIP_P)
    menu_additem(menu,form)
    
    menu_display(id,menu)
    }
}

public mh(id,menu,item)
{
    new text[125]
    switch(item)
    {
        case 0:
        {
            if(fcs_get_user_credits(id)<COST_VIP_1W)   return
            
            fcs_set_user_credits(id,fcs_get_user_credits(id)-COST_VIP_1W)
            
            formatex(text,charsmax(text),"amx_tempadmin %s 7 %s",name[id],VIP_FLAG)
            server_cmd(text)
        }
        case 1:
        {
            if(fcs_get_user_credits(id)<COST_VIP_1M)   return
            
            fcs_set_user_credits(id,fcs_get_user_credits(id)-COST_VIP_1M)
            
            formatex(text,charsmax(text),"amx_tempadmin %s 27 %s",name[id],VIP_FLAG)
            server_cmd(text)
        }
        case 2:
        {
            if(fcs_get_user_credits(id)<COST_VIP_P)    return
            
            fcs_set_user_credits(id,fcs_get_user_credits(id)-COST_VIP_P)
            
            formatex(text,charsmax(text),"amx_tempadmin %s 0 %s",name[id],VIP_FLAG)
            server_cmd(text)
        }
    }
}
Nu merge, si nu imi apare nici o eroare in logs, cand scriu /buy_vip nu se intampla nimic
Da, nu e bine așa m-am uitat mai bine, trebuie refăcut în totalitate pluginul altfel. Degeaba înlocuiești acele native, chestia este că acuma nu mai am timp să mă ocup că altfel îl începeam de la 0, poate te ajută altcineva. Mult succes.

PS: Maxim într-o săptămână pot fii la pc dacă până atunci nu te ajută nimeni ți l-am refăcut eu. Mult succes
,,Mai bine taci și accepți prostia altora, de cât să fii mai nimic decât ei."
| Afiseaza codul
„--» Am văzut oamenii proști ridicându-se chiar peste nivelul celor înalți și mai mari chiar de cât ei în caracter."   :hand_to_chin:  :closed_lips: 
C0non
Membru, skill 0
Membru, skill 0
Posts: 18
Joined: 06 Aug 2020, 14:36
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Fond eXtream: 0

13 Sep 2021, 19:14

CyBer[N]eTicK wrote:
13 Sep 2021, 16:04
C0non wrote:
13 Sep 2021, 12:49
CyBer[N]eTicK wrote:
12 Sep 2021, 23:40
Poftim ți l-am făcut pe FCS pluginul, dar noi nu știm exact ce anume este în acel înclude csgo_remake.

Code: Select all

/* Plugin generated by AMXX-Studio */

#include <amxmodx>

native fcs_get_user_credits ( id );
native fcs_set_user_credits ( id, credits ); 

#define VIP_FLAG "t"


#define COST_VIP_1W 10
#define COST_VIP_1M 10
#define COST_VIP_P 10

new name[33][32]

public plugin_init() {
    register_clcmd("say /buy_vip","BV")
    register_clcmd("say_team /buy_vip","BV")
}

public client_authorized(id)    if(!is_user_bot(id)||!is_user_hltv(id)) get_user_name(id,name[id],charsmax(name[]))

public BV(id)
{
    if(get_user_flags(id) & ADMIN_LEVEL_H) {
    
    new menu=menu_create("Ia-ti VIP","mh"),form[125]
    
    formatex(form,charsmax(form),"VIP 1 saptamana - %dP",COST_VIP_1W)
    menu_additem(menu,form)
    formatex(form,charsmax(form),"VIP 1 LUNA - %dP",COST_VIP_1M)
    menu_additem(menu,form)
    formatex(form,charsmax(form),"VIP PERMANENT - %dP",COST_VIP_P)
    menu_additem(menu,form)
    
    menu_display(id,menu)
    }
}

public mh(id,menu,item)
{
    new text[125]
    switch(item)
    {
        case 0:
        {
            if(fcs_get_user_credits(id)<COST_VIP_1W)   return
            
            fcs_set_user_credits(id,fcs_get_user_credits(id)-COST_VIP_1W)
            
            formatex(text,charsmax(text),"amx_tempadmin %s 7 %s",name[id],VIP_FLAG)
            server_cmd(text)
        }
        case 1:
        {
            if(fcs_get_user_credits(id)<COST_VIP_1M)   return
            
            fcs_set_user_credits(id,fcs_get_user_credits(id)-COST_VIP_1M)
            
            formatex(text,charsmax(text),"amx_tempadmin %s 27 %s",name[id],VIP_FLAG)
            server_cmd(text)
        }
        case 2:
        {
            if(fcs_get_user_credits(id)<COST_VIP_P)    return
            
            fcs_set_user_credits(id,fcs_get_user_credits(id)-COST_VIP_P)
            
            formatex(text,charsmax(text),"amx_tempadmin %s 0 %s",name[id],VIP_FLAG)
            server_cmd(text)
        }
    }
}
Nu merge, si nu imi apare nici o eroare in logs, cand scriu /buy_vip nu se intampla nimic
Da, nu e bine așa m-am uitat mai bine, trebuie refăcut în totalitate pluginul altfel. Degeaba înlocuiești acele native, chestia este că acuma nu mai am timp să mă ocup că altfel îl începeam de la 0, poate te ajută altcineva. Mult succes.

PS: Maxim într-o săptămână pot fii la pc dacă până atunci nu te ajută nimeni ți l-am refăcut eu. Mult succes
Multumesc mult! o sa astept
User avatar
CyBer[N]eTicK
Membru, skill 0
Membru, skill 0
Posts: 67
Joined: 29 May 2020, 04:35
Detinator Steam: Da
CS Status: Citesc & Ajut | BB Force
Detinator server CS: BB.BlackGames.Ro
SteamID: BBCyBer
Fond eXtream: 0
Location: LocalHost
Discord: CyBer[N]eTicK#9999
Has thanked: 7 times
Been thanked: 3 times
Contact:

17 Sep 2021, 21:46

C0non wrote:
13 Sep 2021, 19:14
CyBer[N]eTicK wrote:
13 Sep 2021, 16:04
C0non wrote:
13 Sep 2021, 12:49


Nu merge, si nu imi apare nici o eroare in logs, cand scriu /buy_vip nu se intampla nimic
Da, nu e bine așa m-am uitat mai bine, trebuie refăcut în totalitate pluginul altfel. Degeaba înlocuiești acele native, chestia este că acuma nu mai am timp să mă ocup că altfel îl începeam de la 0, poate te ajută altcineva. Mult succes.

PS: Maxim într-o săptămână pot fii la pc dacă până atunci nu te ajută nimeni ți l-am refăcut eu. Mult succes
Multumesc mult! o sa astept
1. Am schimbat total pluginul, este altul făcut de mine, dar nu știu dacă acționează functia aceasta de mai jos respectivă.

Code: Select all

formatex(text,charsmax(text),"amx_tempadmin %s 7 %s",name[id], ACCES_VIP)
2. Meniul se afișează perfect și da celor ce au flag-ul T așa am pus deoarece asa era și in plugin de mai sus.
3. Trebuie să ai plugin de credite FCS a lui askanar să meargă pluginul.
4. Dacă-ți merge perfect lasă un reply, multumesc, sper să te mulțumească.

Code: Select all

#include <amxmodx>
#include <amxmisc>
#include <engine>


// Definitii
#define PLUGIN "Plugin buy vip"
#define AUTOR " - "
#define VERSIUNE "1.0"

#define ACCES_VIP ADMIN_LEVEL_H // ADMIN LEVEL H este flagul "T"

// Cat sa coste vip-urile 
#define SumaDeCredite_VIP_Saptamana 10
#define SumaDeCredite_VIP_Luna 10
#define SumaDeCredite_VIP_Permanent 10

new const Tag[] = "!g[Buy-VIP]!t" // Tag-ul de la inceputul text-ului
new name[33][32]

// Nativele de credite
native fcs_get_user_credits ( id );
native fcs_set_user_credits ( id, iCredits ); 

public plugin_init()
{
	register_plugin(PLUGIN, AUTOR, VERSIUNE)

	// Comenzile publice
	register_clcmd("say /buyvip", "ShowMeniuBuyVIP")
	register_clcmd("say_team /buyvip", "ShowMeniuBuyVIP")

}
public client_authorized(id)    if(!is_user_bot(id)||!is_user_hltv(id)) get_user_name(id,name[id],charsmax(name[]))

public ShowMeniuBuyVIP(id){
	if(is_user_connected(id) && get_user_flags(id) & ACCES_VIP) // Verificam sa fie conectat pe server si aibe flagul T
	{ 
		new menu = menu_create("\rCumpara-ti \yVIP", "GiveMeniu")

		menu_additem(menu, "\wVIP 1 Saptamana \r[10 CREDITE]", "0", 0)
		menu_additem(menu, "\wVIP 1 Luna \r[10 CREDITE]", "1", 0)
		menu_additem(menu, "\wVIP PERMANENT \r[10 CREDITE]", "2", 0)

		menu_setprop(menu, MPROP_EXIT, MEXIT_ALL)
		menu_display(id, menu, 0); 
	}
}

public GiveMeniu(id, menu, item)
{
    if (item == MENU_EXIT)
    {
        menu_destroy(menu);
        return 1;
    }
    new text[125]
    switch (item)
    {
    	case 0:
    	{
    		new iCredits = fcs_get_user_credits(id) - SumaDeCredite_VIP_Saptamana;

    		if ( iCredits < 0 ) 
    		{
    		cc_chat(id, "%s Nu ai destule credite pentru a putea cumpara VIP", Tag)
    		return 1;
    		}
    		else
    		{
    			cc_chat(id, "%s Succes ti-ai luat VIP 1 Saptamana", Tag)
    			fcs_set_user_credits ( id, iCredits );

    			formatex(text,charsmax(text),"amx_tempadmin %s 7 %s",name[id], ACCES_VIP)
    			server_cmd(text)
           		return 1
    		}
    	}
    	case 1:
    	{
    		new iCredits = fcs_get_user_credits(id) - SumaDeCredite_VIP_Luna;

    		if ( iCredits < 0 ) 
    		{
    		cc_chat(id, "%s Nu ai destule credite pentru a putea cumpara VIP", Tag)
    		return 1;
    		}
    		else
    		{
    			cc_chat(id, "%s Succes ti-ai luat VIP 1 Luna", Tag)
    			fcs_set_user_credits ( id, iCredits );

    			formatex(text,charsmax(text),"amx_tempadmin %s 27 %s",name[id], ACCES_VIP)
    			server_cmd(text)
           		return 1
    		}
    	}
    	case 2:
    	{
    		new iCredits = fcs_get_user_credits(id) - SumaDeCredite_VIP_Permanent;

    		if ( iCredits < 0 ) 
    		{
    		cc_chat(id, "%s Nu ai destule credite pentru a putea cumpara VIP", Tag)
    		return 1;
    		}
    		else
    		{
    			cc_chat(id, "%s Succes ti-ai luat VIP PERMANENT", Tag)
    			fcs_set_user_credits ( id, iCredits );

    			formatex(text,charsmax(text),"amx_tempadmin %s 0 %s",name[id], ACCES_VIP)
    			server_cmd(text)
           		return 1
    		}
    	}
   	}
    menu_destroy(menu);
    return 1;
}


stock cc_chat( const id, const input[ ], any:... )
{
	new count = 1, players[ 32 ]

	static msg[ 191 ]
	vformat( msg, 190, input, 3 )

	replace_all( msg, 190, "!g", "^4" ) //- verde
	replace_all( msg, 190, "!y", "^1" ) //- galben
	replace_all( msg, 190, "!t", "^3" ) //- echipa
	replace_all( msg, 190, "!n", "^0" ) //- normal

	if( id ) players[ 0 ] = id; else get_players( players, count, "ch" )
	{
		for( new i = 0; i < count; i++ )
		{
			if( is_user_connected( players[ i ] ) )
			{
				message_begin( MSG_ONE_UNRELIABLE, get_user_msgid( "SayText" ), _, players[ i ] )
				write_byte( players[ i ] );
				write_string( msg );
				message_end( );
			}
		}
	}
}
,,Mai bine taci și accepți prostia altora, de cât să fii mai nimic decât ei."
| Afiseaza codul
„--» Am văzut oamenii proști ridicându-se chiar peste nivelul celor înalți și mai mari chiar de cât ei în caracter."   :hand_to_chin:  :closed_lips: 
User avatar
N3v3rM1nd
Membru, skill +2
Membru, skill +2
Posts: 522
Joined: 06 Oct 2018, 13:41
Detinator Steam: Da
Fond eXtream: 0
Location: La mine in casa :D
Has thanked: 92 times
Been thanked: 25 times

Yesterday, 11:59

CyBer[N]eTicK wrote:
17 Sep 2021, 21:46
C0non wrote:
13 Sep 2021, 19:14
CyBer[N]eTicK wrote:
13 Sep 2021, 16:04


Da, nu e bine așa m-am uitat mai bine, trebuie refăcut în totalitate pluginul altfel. Degeaba înlocuiești acele native, chestia este că acuma nu mai am timp să mă ocup că altfel îl începeam de la 0, poate te ajută altcineva. Mult succes.

PS: Maxim într-o săptămână pot fii la pc dacă până atunci nu te ajută nimeni ți l-am refăcut eu. Mult succes
Multumesc mult! o sa astept
1. Am schimbat total pluginul, este altul făcut de mine, dar nu știu dacă acționează functia aceasta de mai jos respectivă.

Code: Select all

formatex(text,charsmax(text),"amx_tempadmin %s 7 %s",name[id], ACCES_VIP)
2. Meniul se afișează perfect și da celor ce au flag-ul T așa am pus deoarece asa era și in plugin de mai sus.
3. Trebuie să ai plugin de credite FCS a lui askanar să meargă pluginul.
4. Dacă-ți merge perfect lasă un reply, multumesc, sper să te mulțumească.

Code: Select all

#include <amxmodx>
#include <amxmisc>
#include <engine>


// Definitii
#define PLUGIN "Plugin buy vip"
#define AUTOR " - "
#define VERSIUNE "1.0"

#define ACCES_VIP ADMIN_LEVEL_H // ADMIN LEVEL H este flagul "T"

// Cat sa coste vip-urile 
#define SumaDeCredite_VIP_Saptamana 10
#define SumaDeCredite_VIP_Luna 10
#define SumaDeCredite_VIP_Permanent 10

new const Tag[] = "!g[Buy-VIP]!t" // Tag-ul de la inceputul text-ului
new name[33][32]

// Nativele de credite
native fcs_get_user_credits ( id );
native fcs_set_user_credits ( id, iCredits ); 

public plugin_init()
{
	register_plugin(PLUGIN, AUTOR, VERSIUNE)

	// Comenzile publice
	register_clcmd("say /buyvip", "ShowMeniuBuyVIP")
	register_clcmd("say_team /buyvip", "ShowMeniuBuyVIP")

}
public client_authorized(id)    if(!is_user_bot(id)||!is_user_hltv(id)) get_user_name(id,name[id],charsmax(name[]))

public ShowMeniuBuyVIP(id){
	if(is_user_connected(id) && get_user_flags(id) & ACCES_VIP) // Verificam sa fie conectat pe server si aibe flagul T
	{ 
		new menu = menu_create("\rCumpara-ti \yVIP", "GiveMeniu")

		menu_additem(menu, "\wVIP 1 Saptamana \r[10 CREDITE]", "0", 0)
		menu_additem(menu, "\wVIP 1 Luna \r[10 CREDITE]", "1", 0)
		menu_additem(menu, "\wVIP PERMANENT \r[10 CREDITE]", "2", 0)

		menu_setprop(menu, MPROP_EXIT, MEXIT_ALL)
		menu_display(id, menu, 0); 
	}
}

public GiveMeniu(id, menu, item)
{
    if (item == MENU_EXIT)
    {
        menu_destroy(menu);
        return 1;
    }
    new text[125]
    switch (item)
    {
    	case 0:
    	{
    		new iCredits = fcs_get_user_credits(id) - SumaDeCredite_VIP_Saptamana;

    		if ( iCredits < 0 ) 
    		{
    		cc_chat(id, "%s Nu ai destule credite pentru a putea cumpara VIP", Tag)
    		return 1;
    		}
    		else
    		{
    			cc_chat(id, "%s Succes ti-ai luat VIP 1 Saptamana", Tag)
    			fcs_set_user_credits ( id, iCredits );

    			formatex(text,charsmax(text),"amx_tempadmin %s 7 %s",name[id], ACCES_VIP)
    			server_cmd(text)
           		return 1
    		}
    	}
    	case 1:
    	{
    		new iCredits = fcs_get_user_credits(id) - SumaDeCredite_VIP_Luna;

    		if ( iCredits < 0 ) 
    		{
    		cc_chat(id, "%s Nu ai destule credite pentru a putea cumpara VIP", Tag)
    		return 1;
    		}
    		else
    		{
    			cc_chat(id, "%s Succes ti-ai luat VIP 1 Luna", Tag)
    			fcs_set_user_credits ( id, iCredits );

    			formatex(text,charsmax(text),"amx_tempadmin %s 27 %s",name[id], ACCES_VIP)
    			server_cmd(text)
           		return 1
    		}
    	}
    	case 2:
    	{
    		new iCredits = fcs_get_user_credits(id) - SumaDeCredite_VIP_Permanent;

    		if ( iCredits < 0 ) 
    		{
    		cc_chat(id, "%s Nu ai destule credite pentru a putea cumpara VIP", Tag)
    		return 1;
    		}
    		else
    		{
    			cc_chat(id, "%s Succes ti-ai luat VIP PERMANENT", Tag)
    			fcs_set_user_credits ( id, iCredits );

    			formatex(text,charsmax(text),"amx_tempadmin %s 0 %s",name[id], ACCES_VIP)
    			server_cmd(text)
           		return 1
    		}
    	}
   	}
    menu_destroy(menu);
    return 1;
}


stock cc_chat( const id, const input[ ], any:... )
{
	new count = 1, players[ 32 ]

	static msg[ 191 ]
	vformat( msg, 190, input, 3 )

	replace_all( msg, 190, "!g", "^4" ) //- verde
	replace_all( msg, 190, "!y", "^1" ) //- galben
	replace_all( msg, 190, "!t", "^3" ) //- echipa
	replace_all( msg, 190, "!n", "^0" ) //- normal

	if( id ) players[ 0 ] = id; else get_players( players, count, "ch" )
	{
		for( new i = 0; i < count; i++ )
		{
			if( is_user_connected( players[ i ] ) )
			{
				message_begin( MSG_ONE_UNRELIABLE, get_user_msgid( "SayText" ), _, players[ i ] )
				write_byte( players[ i ] );
				write_string( msg );
				message_end( );
			}
		}
	}
}

Code: Select all

get_user_flags(id) & ACCES_VIP) 
->

Code: Select all

!(get_user_flags(id) & ACCES_VIP))
Post Reply

Return to “Cereri”

  • Information