Advanced Points System [v1.1] [little update: shop]

Pluginuri facute de utilizatorii forumului eXtream.

Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com

User avatar
YONTU
Moderator ajutator
Moderator ajutator
Posts: 2446
Joined: 10 May 2013, 13:25
Detinator Steam: Nu
CS Status: Everyone is looking at ur shoes
Reputatie: Moderator ajutator
Fost scripter eXtreamCS
Location: Gura Humorului
Has thanked: 255 times
Been thanked: 281 times
Contact:

13 Dec 2013, 17:04

Descriere: - Acest plugin este un sistem de puncte ! Ce inseamna asta? Cand faci un frag vei primi X puncte si de asemenea faci puncte si pe alte obiective !

Atunci cand ai un numar X de puncte poti avea Y sanse sa poti reinvia !
Un Headshot = X puncte | un kill = 1 punct !

Descarcare: GirlShare! | ZippyShare!

New: Am adaugat si un SHOP pe baza acestui sistem de puncte: Click
SMA | Afiseaza codul
/*===========================================================================================================================

				        *********************************************************
				         *********** [ Advanced Points System 1.1 ] ************
				        *********************************************************

		-------------------------
		   ---- * Description * ----
		-------------------------

			- Acest plugin este un sistem de puncte ! Ce inseamna asta? Cand faci un frag vei primi X puncte si de asemenea
		mai faci puncte si pe alte obiective !

		-------------------------
		   --- * Configuration * ---
		-------------------------

			points_show_info "0 / 1"			- 0: Afiseaza datele in HUD sub radar | 1: Afiseaza datele deasupra vietii
			points_bombevents_rewards "0 / 1"		- 0: Dezactivat | 1: Activat -> Puncte obtinute pe plantarea/dezamorsarea/explodearea bombei
			points_costonepoint	"MONEY"			- Cat sa coste un punct atunci cand il cumperi prin comanda "/buypoint"
			points_per_headshot "PUNCTE"		- Cate puncte sa primesti pe HeadShot !
			points_bomb_planted "X"			- Cate puncte sa primesti pe plantarea bombei
			points_bomb_exploded "Y"			- Cate puncte sa primesti pe explodarea bombei
			points_bomb_defused "Z"			- Cate puncte sa primesti pe dezamorsarea bombei
			points_gamename "Adv. Points System v1.1"	- Schimbi numele default( Counter-Strike ) cu altul
			points_add_newround "PUNCTE"		- Cate puncte sa primesti la fiecare runda !
			points_enable_respawn "0 / 1"		- Activeaza / Dezactiveaza respawn-ul cand victima moare doar daca are X PUNCTE
			points_for_respawn "PUNCTE"		- Cate puncte sa aiba victima ca sa poata reinvia atunci cand este omorata
			points_respawn_chance "SANSE"		- De cate sanse are nevoie victima ca sa invie atunci cand are X PUNCTE

		-------------------------
		   ----- * Modules * -----
		-------------------------

				- Hamsandwich;
			- Fakemeta;
		- Cstrike;

		-------------------------
		      --- * Credits * ---
		-------------------------

			- sDs|Aragon* - sistemul avansat de salvare al punctelor;

		-------------------------
		    --- * Changelog * ---
		-------------------------

			* v1.0:
			   - Initial release | Private | ( 15th Oct 2013 ) :D

			* v1.1:
			   - Public Source ( 13th Dec 2013 )

		-------------------------
		    --- * Update * ---
		-------------------------

				        *********************************************************
				         *********** [ Advanced Points System 1.1 ] ************
				        *********************************************************

===========================================================================================================================*/

#include < amxmodx >
#include < amxmisc >
#include < fakemeta >
#include < hamsandwich >
#include < CC_ColorChat >
#include < csx >
#include < cstrike >

#pragma semicolon 1

#define ADMIN_ACCESS ADMIN_IMMUNITY
#define is_user_player(%1) ( 1 <= %1 <= g_MaxPlayers )

#define PLUGIN_NAME 	"Advanced Points System"
#define PLUGIN_VERSION 	"1.1"
#define PLUGIN_AUTHOR 	"YONTU"

new const g_szTag[ ] = "[ Points Manager ]";

// Make files?
new const szWriteCvarsPoints[  ] = "addons/amxmodx/configs/points/points.cfg";
new const szLocationPoints[  ] = "addons/amxmodx/configs/points";

const PEV_SPEC_TARGET = pev_iuser2;

new g_iUserPoints[ 33 ];
new File[ 128 ];

new points_gamename;
new SyncHudMessage, g_MaxPlayers;

enum _:iCvars {

	EnableBombEvents,
	ShowType,
	CostOnePoint,
	PointsPerHS,
	PointsBombPlanted,
	PointsBombExploded,
	PointsBombDefused,
	AddPointsNewRound,
	EnableRespawn,
	PointsForRespawn,
	PointsForRespawnChance
}
;
new g_iCvar[ iCvars ];

public plugin_init( ) {

	register_plugin( PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR );
	
	register_event( "DeathMsg", "event_DeathMsg", "a" );

	register_forward( FM_GetGameDescription, "GameDesc" ); 
	register_forward( FM_PlayerPreThink, "fwd_PlayerPreThink" );

	RegisterHam( Ham_Spawn, "player", "Ham_PlayerSpawned_Post", 1 );
	RegisterHam( Ham_Killed, "player", "Ham_PlayerKilled", 1 );
	
	register_clcmd( "say /buypoint", "ClCmdSayBuyPoint" );
	register_clcmd( "say_team /buypoint", "ClCmdSayBuyPoint" );

	register_clcmd( "say pall", "ClCmdSayShowAllPoints" );
	register_clcmd( "say_team pall", "ClCmdSayShowAllPoints" );

	register_clcmd( "say /points", "ClCmdSayPoints" );
	register_clcmd( "say_team /points", "ClCmdSayPoints" );

	register_concmd( "amx_give_points" ,"ClCmdGivePoints", ADMIN_ACCESS, "< nume / @ALL / @T / @CT > < Puncte >" );
	register_concmd( "amx_take_points", "ClCmdTakePoints", ADMIN_ACCESS, "< nume > < Puncte >" );
	register_concmd( "amx_reset_points", "ClCmdResetPoints", ADMIN_ACCESS, "< nume / @ALL >" );
	
	g_iCvar[ ShowType ] = register_cvar( "points_show_info", "1" );
	g_iCvar[ EnableBombEvents ] = register_cvar( "points_bombevents_rewards", "1" );
	g_iCvar[ CostOnePoint ] = register_cvar( "points_costonepoint", "4000" );
	g_iCvar[ PointsPerHS ] = register_cvar( "points_per_headshot", "2" );
	g_iCvar[ PointsBombPlanted ] = register_cvar( "points_bomb_planted", "1" );
	g_iCvar[ PointsBombExploded ] = register_cvar( "points_bomb_exploded", "2" );
	g_iCvar[ PointsBombDefused ] = register_cvar( "points_bomb_defused", "1" );
	g_iCvar[ PointsForRespawn ] = register_cvar( "points_for_respawn", "10000" );
	g_iCvar[ PointsForRespawnChance ] = register_cvar( "points_respawn_chance", "70" );
	g_iCvar[ EnableRespawn ] = register_cvar( "points_enable_respawn", "1" );
	points_gamename = register_cvar( "points_gamename", "Adv. Points System v1.1" );

	SyncHudMessage = CreateHudSyncObj(  );
	g_MaxPlayers = global_get( glb_maxClients );

	new DataDir[ 64 ];
	get_datadir( DataDir, 63 );
	format( File, 127, "%s/AdvancedPointsSystem.dat", DataDir );
}

public plugin_precache(  ) {

	server_cmd( "exec %s", szWriteCvarsPoints );
       
	if( !dir_exists( szLocationPoints ) )
		mkdir( szLocationPoints );

	if( !file_exists( szWriteCvarsPoints ) ) {

		write_file( szWriteCvarsPoints, "// In acest fisier se afla cvar-urile legate despre puncte:");
		write_file( szWriteCvarsPoints, " ");
		write_file( szWriteCvarsPoints, "points_show_info ^"1^" // 0: Afiseaza datele in HUD sub radar | 1: Afiseaza datele deasupra vietii" );
		write_file( szWriteCvarsPoints, "points_bombevents_rewards ^"1^" // 0: Dezactivat | 1: Activat -> Puncte obtinute pe plantarea/dezamorsarea/explodearea bombei" );
		write_file( szWriteCvarsPoints, "points_costonepoint ^"4000^" // Cat sa coste un punct atunci cand il cumperi prin comanda /buypoint" );
		write_file( szWriteCvarsPoints, "points_per_headshot ^"2^" // Cate puncte sa primesti pe HeadShot !" );
		write_file( szWriteCvarsPoints, "points_bomb_planted ^"1^" // Cate puncte sa primesti pe plantarea bombei" );
		write_file( szWriteCvarsPoints, "points_bomb_exploded ^"2^" // Cate puncte sa primesti pe explodarea bombei" );
		write_file( szWriteCvarsPoints, "points_bomb_defused ^"1^" // Cate puncte sa primesti pe dezamorsarea bombei" );
		write_file( szWriteCvarsPoints, "points_enable_respawn ^"1^" // Activeaza / Dezactiveaza respawn-ul cand victima moare doar daca are X PUNCTE" );
		write_file( szWriteCvarsPoints, "points_for_respawn ^"1000^" // Cate puncte sa aiba victima ca sa poata reinvia atunci cand este omorata" );
		write_file( szWriteCvarsPoints, "points_respawn_chance ^"40^" // Cate sanse sa aiba victima ca sa poata reinvia" );
		write_file( szWriteCvarsPoints, "points_gamename ^"Adv. Points System v1.1^" // Schimbi numele default( Counter-Strike ) cu altul" );
		//write_file( szWriteCvarsPoints, "cvar ^"1 / 0^" // De cate sanse are nevoie victima ca sa invie atunci cand are X PUNCTE" );
	}
}

public plugin_natives( ) {

	register_native( "get_user_points", "native_get_user_points", 1 );
	register_native( "set_user_points", "native_set_user_points", 1 );
}

public native_get_user_points( id ) {

	return g_iUserPoints[ id ];
}

public native_set_user_points( id, points ) {

	g_iUserPoints[ id ] = points;
}

public client_putinserver( id ) {

	LoadUserPoints( id );
}

public client_disconnect( id ) {

	SaveUserPoints( id );
}

public GameDesc( ) {

	static szGameName[ 32 ];

	get_pcvar_string( points_gamename, szGameName, 31 );
	forward_return( FMV_STRING, szGameName );

	return FMRES_SUPERCEDE; 
}

public fwdPlayerPreThink( id ) {
	
	if( is_user_alive( id ) ) {
		
		new target, body; 
		get_user_aiming( id, target, body, 9999 );
		
		new CsTeams:team = cs_get_user_team( id );
		
		if( is_user_alive( target ) ) {

			if( is_user_player( target ) ) {
			
				new CsTeams:targetTeam = cs_get_user_team( target );
				
				new szName[ 32 ];
				get_user_name( target,  szName, sizeof( szName ) -1 );
							
				new sMessage[ 64 ];
				if( targetTeam == team ) {

					formatex( sMessage, sizeof( sMessage ) -1, "%s: %s^nHealth: %i | Points: %i", is_user_vip( target ) ? "VIP" : "Friend", szName, get_user_health( target ), g_iUserPoints[ target ] );
				}

				else if( targetTeam != team && team != CS_TEAM_CT ) {

					formatex( sMessage, sizeof( sMessage ) -1, "%s: %s^nHealth: %i | Points: %i", is_user_vip( target ) ? "VIP" : "Enemy", szName, get_user_health( target ), g_iUserPoints[ target ] );
				}
					
				if( targetTeam == CS_TEAM_CT ) {

					set_hudmessage( 0, 255, 0, -1.0, 0.6, 0, 0.0, 0.1, 0.0, 0.0, -1 );
				}

				else if( targetTeam == CS_TEAM_T ) {

					set_hudmessage( 127, 0, 0, -1.0, 0.6, 0, 0.0, 0.1, 0.0, 0.0, -1 );
				}	
				
				show_hudmessage( id, "%s",  sMessage );
			}
		}
	}
	
	return FMRES_IGNORED;
}

public event_DeathMsg( ) {

	new iKiller = read_data( 1 );
	new iVictim = read_data( 2 );
	new iHeadshot = read_data( 3 );
	
	if( !is_user_connected( iKiller ) || !is_user_connected( iVictim ) ) {

		return;
	}
	
	if( iKiller == iVictim ) {

		return;
	}
	
	if( iHeadshot ) {

		g_iUserPoints[ iKiller ] += get_pcvar_num( g_iCvar[ PointsPerHS ] );
		set_hudmessage( random( 255 ), random( 255 ), random( 255 ), 0.6, 0.7, 1, 6.0, 7.0 );
		show_hudmessage( iKiller, "+%i points", get_pcvar_num( g_iCvar[ PointsPerHS ] ) );
	}

	else {

		g_iUserPoints[ iKiller ]++;
		set_hudmessage( random( 255 ), random( 255 ), random( 255 ), 0.6, 0.7, 0, 6.0, 7.0 );
		show_hudmessage( iKiller, "+1 point" );
	}
}

public Ham_PlayerSpawned_Post( id ) {

	if( is_user_connected( id ) && is_user_alive( id ) ) {

		set_task( 1.0, "ShowHud", id, _, _, "b" );
	}
}

public Ham_PlayerKilled( iVictim, iAttacker, iShouldgib ) {

	if( get_pcvar_num( g_iCvar[ EnableRespawn ] ) == 0 || !is_user_connected( iVictim ) )
		return PLUGIN_CONTINUE;

	new iPoints = get_pcvar_num( g_iCvar[ PointsForRespawn ] );
	new iChance = random_num( 1, 100 );
	new iAccepted = get_pcvar_num( g_iCvar[ PointsForRespawnChance ] );

	if( g_iUserPoints[ iVictim ] == iPoints ) {

		if( iChance <= iAccepted ) {

			ExecuteHamB( Ham_CS_RoundRespawn, iVictim );
			ColorChat( 0, TEAM_COLOR, "^x04%s^x01 Tocmai ai fost inviat pentru ca ai avut^x03 %i^x01 sanse !", g_szTag, iChance );
		}

		if( iChance >= iAccepted ) {

			ColorChat( 0, TEAM_COLOR, "^x04%s^x01 Poate runda viitoare vei avea^x03 %i^x01 sanse pentru a putea reinvia !", g_szTag, iChance );
		}
	}

	return PLUGIN_CONTINUE;
}

public ShowHud( id ) {

	switch( get_pcvar_num( g_iCvar[ ShowType ] ) ) {

		case 0: {
	
			if( is_user_connected( id ) && is_user_alive( id ) && ( get_user_team( id ) == 1 || get_user_team( id ) == 2 ) ) {

				set_hudmessage( random( 250 ), random( 250 ), random( 250 ), 0.01, 0.23, 0, 0.5, 15.0, 2.0, 2.0, -1 );
				ShowSyncHudMsg( id, SyncHudMessage, "HP: %d^nPoints: %d", get_user_health( id ), g_iUserPoints[ id ] );
			}

			else {

				new idSpec;
				new iPlayerName[ 32 ];

				idSpec = pev( id, PEV_SPEC_TARGET );
				get_user_name( idSpec, iPlayerName, 31 );

				set_hudmessage( random( 250 ), random( 250 ), random( 250 ), 0.01, 0.22, 0, 0.5, 15.0, 2.0, 2.0, -1 );
				ShowSyncHudMsg( id, SyncHudMessage, "Spectating: %s^nHealth: %d^nPoints: %d", iPlayerName, get_user_health( idSpec ), g_iUserPoints[ idSpec ] );
			}
		}

		case 1: {
	
			if( is_user_connected( id ) && is_user_alive( id ) && ( get_user_team( id ) == 1 || get_user_team( id ) == 2 ) ) {

				set_hudmessage( 0, 0, 254, 0.01, 0.91, 0, 0.5, 15.0, 2.0, 2.0, -1 );
				ShowSyncHudMsg( id, SyncHudMessage, "HP: %d | AP: %d | Points: %d", get_user_health( id ), get_user_armor( id ), g_iUserPoints[ id ] );
			}

			else {

				new idSpec;
				new iPlayerName[ 32 ];

				idSpec = pev( id, PEV_SPEC_TARGET );
				get_user_name( idSpec, iPlayerName, 31 );

				set_hudmessage( random( 250 ), random( 250 ), random( 250 ), -1.0, 0.7, 0, 0.5, 15.0, 2.0, 2.0, -1 );
				ShowSyncHudMsg( id, SyncHudMessage, "Spectating: %s^nHealth: %d^nPoints: %d", iPlayerName, get_user_health( idSpec ), g_iUserPoints[ idSpec ] );
			}
		}
	}
}

public ClCmdSayBuyPoint( id ) {

	if( is_user_connected( id ) )
	{
		new g_iUserMoney = cs_get_user_money( id );
		new iNeededMoney = get_pcvar_num( g_iCvar[ CostOnePoint ] );
 
		if( g_iUserMoney < iNeededMoney )
 
		ColorChat( 0, TEAM_COLOR, "^x04%s^x01 Mai ai nevoie de^x03 %d $^x01 pentru a cumpara^x03 1 punct^x01 !", g_szTag, iNeededMoney - g_iUserMoney );
 
		else {
 
			g_iUserPoints[ id ] += 1;
			cs_set_user_money( id, g_iUserMoney - iNeededMoney );
			ColorChat( 0, TEAM_COLOR, "^x04%s^x01 Tocmai ai cumparat^x03 1 punct^x01 pentru^x03 %d $ !", g_szTag, iNeededMoney );
		}
	}
}

public ClCmdSayShowAllPoints( id ) {

	new iPlayers[ 32 ], iPlayersNum, szName[ 40 ], szMotd[ 1024 ], len;

	len = formatex( szMotd, charsmax( szMotd ), "<html> ");
	get_players( iPlayers, iPlayersNum );

	for( new i = 0 ; i < iPlayersNum ; i++ ) {

		get_user_name( iPlayers[ i ], szName, charsmax( szName ) );
		len += formatex( szMotd[ len ], charsmax( szMotd ) - len, "<br> <center> <font color=#008000>Name:</font> <font color=#8A2BE2>%s</font> | <font color=#008000>Points:</font> <font color=#8A2BE2>%i</font> </center> <br>", szName, g_iUserPoints[ iPlayers[ i ] ] );
	}

	formatex( szMotd[ len ], charsmax( szMotd ) - len, "</html>" );
	show_motd( id, szMotd );	
}

public ClCmdSayPoints( id ) {

	set_hudmessage( 127, 42, 255, 0.03, 0.86, 2, 6.0, 10.0 );
	show_hudmessage( id, "Ai %i puncte !", g_iUserPoints[ id ] );
	
	ColorChat( id, TEAM_COLOR, "^x04%s^x01 Ai^x03 %i^x01 puncte !!!", g_szTag, g_iUserPoints[ id ] );
	
	return PLUGIN_CONTINUE;
}

public bomb_planted( iPlanter ) {

	if( get_pcvar_num( g_iCvar[ EnableBombEvents ] ) == 0 || !is_user_connected( iPlanter ) )
		return PLUGIN_CONTINUE;
		
	g_iUserPoints[ iPlanter ] += get_pcvar_num( g_iCvar[ PointsBombPlanted ] );
	ColorChat( 0, TEAM_COLOR, "^x04%s^x03 %s^x01 a primit^x03 1 punct^x01 pentru plantarea bombei !", g_szTag, get_name( iPlanter ) );
	
	return PLUGIN_CONTINUE;
}

public bomb_explode( iExploder ) {
	
	if( get_pcvar_num( g_iCvar[ EnableBombEvents ] ) == 0 || !is_user_connected( iExploder ) )
		return PLUGIN_CONTINUE;
		
	g_iUserPoints[ iExploder ] += get_pcvar_num( g_iCvar[ PointsBombExploded ] );
	ColorChat( 0, TEAM_COLOR, "^x04%s^x03 %s^x01 a primit^x03 2 puncte^x01 pentru explodarea bombei !", g_szTag, get_name( iExploder ) );
	
	return PLUGIN_CONTINUE;
}

public bomb_defused( iDefuser ) {

	if( get_pcvar_num( g_iCvar[ EnableBombEvents ] ) == 0 || !is_user_connected( iDefuser ) )
		return PLUGIN_CONTINUE;
		
	g_iUserPoints[ iDefuser ] += get_pcvar_num( g_iCvar[ PointsBombDefused ] );
	ColorChat( 0, TEAM_COLOR, "^x04%s^x03 %s^x01 a primit^x03 1 punct^x01 pentru dezamorsarea bombei !", g_szTag, get_name( iDefuser ) );
	
	return PLUGIN_CONTINUE;
}

public ClCmdGivePoints( id ) {

	if( !( get_user_flags( id ) & ADMIN_ACCESS ) ) {

		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_points < nume / @ALL / @T / @CT > < points >" );
		return 1;
	}
	
	new iPlayers[ 32 ];
	new iPlayersNum;
	
	new iPoints = str_to_num( szSecondArg );
	if( iPoints <= 0 ) {

		client_cmd( id, "echo Valoare Punctelor 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_iUserPoints[ iPlayers[ i ] ] += iPoints;
						
					ColorChat( 0, TEAM_COLOR, "^x04^%s^x01 Adminul^x03 %s^x01 le-a dat^x03 %i Puncte^x01 tuturor jucatorilor!", g_szTag, get_name( id ), iPoints );
					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_iUserPoints[ iPlayers[ i ] ] += iPoints;
						
					ColorChat( 0, TEAM_COLOR, "^x04^%s^x01 Adminul^x03 %s^x01 le-a dat^x03 %i puncte^x01 jucatorilor de la^x03 TERO^x01!", g_szTag, get_name( id ), iPoints );
					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_iUserPoints[ iPlayers[ i ] ] += iPoints;
						
					ColorChat( 0, TEAM_COLOR, "^x04^%s^x01 Adminul^x03 %s^x01 le-a dat^x03 %i puncte^x01 jucatorilor de la^x03 CT^x01!", g_szTag, get_name( id ), iPoints );
					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_iUserPoints[ iPlayer ] += iPoints;
	
	new szName[ 32 ];
	get_user_name( iPlayer, szName, sizeof ( szName ) -1 );
	
	ColorChat( 0, TEAM_COLOR, "^x04%s^x01 Adminul^x03 %s^x01 i-a dat^x03 %i puncte^x01 lui^x03 %s^x01.", g_szTag, get_name( id ), iPoints, szName );
	
	return 1;
}

public ClCmdTakePoints( id ) {

	if( !( get_user_flags( id ) & ADMIN_ACCESS ) ) {

		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_points < nume > < puncte >" );
		return 1;
	}
	
	new iPoints = str_to_num( szSecondArg );
	if( iPoints <= 0 ) {

		client_cmd( id, "echo Valoare Punctelor 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_iUserPoints[ iPlayer ] < iPoints ) {

		client_cmd( id, "echo Jucatorul %s nu are atatea puncte! Are doar %i puncte !", szFirstArg, g_iUserPoints[ iPlayer ] );
		return 1;
	}
	
	g_iUserPoints[ iPlayer ] -= iPoints;
	
	new szName[ 32 ];
	get_user_name( iPlayer, szName, sizeof( szName ) -1 );
	
	ColorChat( 0, TEAM_COLOR, "^x04%s^x01 Adminul^x03 %s^x01 i-a sters^x03 %i puncte^x01 lui^x03 %s^x01.", g_szTag, get_name( id ), iPoints, szName );
	
	return 1;
}

public ClCmdResetPoints( id, level, cid ) {

	if( !cmd_access( id, level, cid, 2 ) ) {

		return PLUGIN_HANDLED; 
	}
	
	new szArgument[ 32 ];
   	read_argv( 1, szArgument, charsmax( szArgument ) );
	
	new iPlayer[ 32 ], iPlayersNum, all;
	get_players( iPlayer, iPlayersNum, "c" );

	if( equal( szArgument, "@ALL" ) ) {

		for( new i; i < iPlayersNum; i++ ) {

			all = iPlayer[ i ];
			
			g_iUserPoints[ all ] = 0;
			
			ColorChat( 0, TEAM_COLOR, "^x04%s^x01 Adminul^x03 %s^x01 v-a resetat toate^x03 punctele !!!", g_szTag, get_name( id ) );
		}
	}
			
	else {

		new player = cmd_target( id, szArgument, 10 );

		if( !player )  {

  			 return PLUGIN_HANDLED;
		}
	

		new TargetName[ 32 char ];
		get_user_name( player, TargetName, charsmax( TargetName ) );
	
		g_iUserPoints[ player ] = 0;
		ColorChat( 0, TEAM_COLOR, "^x04%s^x01 Adminul^x03 %s^x01 i-a resetat punctele lui^x03 %s^x01 !!!", g_szTag, get_name( id ), TargetName );
	}

	return PLUGIN_HANDLED;
}

public SaveUserPoints( id ) {

	new Name[ 32 ];
	get_user_name( id, Name, 31 );
	
	static Data[ 1024 ];
	formatex( Data, sizeof( Data ) - 1, "^"%i^"", g_iUserPoints[ id ] );
	
	new Save[ 512 ];
	format( Save, 511, "^"%s^" %s", Name, Data );
	
	new Line[ 128 ], Linie, IsPlayer = false, Arg1[ 32 ];
	
	new FileOpen = fopen( File, "rt" );

	while( !feof( FileOpen ) ) {

		fgets( FileOpen, Line, 127 );
		trim( Line );
		
		parse( Line, Arg1, 31 );
		
		if( equali( Arg1, Name ) ) {

			write_file( File, Save, Linie );
			IsPlayer = true;
			break;
		}
		
		Linie++;
	}

	fclose( FileOpen );

	if( !IsPlayer ) {

		write_file( File, Save, -1 );
	}
}

public LoadUserPoints( id ) {

	new Name[ 32 ];
	get_user_name( id, Name, 31 );
	
	new Line[ 128 ], IsPlayer = false, Arg1[ 32 ], Arg2[ 32 ];
	
	new FileOpen = fopen( File, "rt" );

	while( !feof( FileOpen ) ) {

		fgets( FileOpen, Line, 127 );
		trim( Line );
		
		parse( Line, Arg1, 31, Arg2, 31 );
		
		if( equali( Arg1, Name ) ) {

			g_iUserPoints[ id ] = str_to_num( Arg2 );
			IsPlayer = true;
			break;
		}
	}

	fclose( FileOpen );
	
	if( !IsPlayer ) {

		g_iUserPoints[ id ] = 1;
	}
}

stock get_name( id ) {

	new szName[ 32 ];
	get_user_name( id, szName, sizeof ( szName ) -1 );
	return szName;
}

stock bool:is_user_vip( id ) {

	if( get_user_flags( id ) & read_flags( "h" )  )
		return true;
	
	return false;
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1033\\ f0\\ fs16 \n\\ par }
*/
Nume: Advanced Points System
Versiune: 1.1
Link oficial: Aici.

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

Code: Select all

advanced_points_system.amxx
4. Alti pasi necesari....

Cvar-uri (se adauga in fisierul amxmodx/configs/amxx.cfg):
In fisierul amxmodx/configs/points/ gasiti un fisier pe nume points.cfg !

Comenzi administrative (se tasteaza in consola si trebuie sa fiti administrator):
  • amx_give_points < nume / @ALL / @T / @CT > < Puncte > - adauga jucatorilor de pe server puncte
    amx_take_points < nume > < Puncte > - sterge unui jucator / jucatorilor punctele
    amx_reset_points < nume / @ALL > - reseteaza unui jucator / jucatorilor de pe server toate punctele
Comenzi publice (se tasteaza in joc prin apasarea tastei Y):
  • /points - aflii cate puncte ai
    /buypoint - cumperi un punct
    pall - arata intr-un fisier modt numele juctaorilor de pe server si cate puncte are( colorat )
Module necesare (se sterge ; din fata modulului de mai jos; acestea le gasiti in fisierul amxmodx\configs\modules.ini):
- Fakemeta;
- Hamsandwich;
- Cstrike;

Optional: In fisierul amxmodx/configs/points gasiti un fisier pe nume points.cfg ! In el se vor salva toate cvar-urile pluginului si de aceea voi nu trebuie sa mai adaugati cvar-urile in amxx.cfg! Fisierul se creeaza singur si este activat direct din plugin la fiecare schimbare de harta !
points.cfg | Afiseaza codul
// In acest fisier se afla cvar-urile legate despre puncte:
 
points_show_info "1" // 0: Afiseaza datele in HUD sub radar | 1: Afiseaza datele deasupra vietii
points_bombevents_rewards "1" // 0: Dezactivat | 1: Activat -> Puncte obtinute pe plantarea/dezamorsarea/explodearea bombei
points_costonepoint "4000" // Cat sa coste un punct atunci cand il cumperi prin comanda /buypoint
points_per_headshot "2" // Cate puncte sa primesti pe HeadShot !
points_bomb_planted "1" // Cate puncte sa primesti pe plantarea bombei
points_bomb_exploded "2" // Cate puncte sa primesti pe explodarea bombei
points_bomb_defused "1" // Cate puncte sa primesti pe dezamorsarea bombei
points_enable_respawn "1" // Activeaza / Dezactiveaza respawn-ul cand victima moare doar daca are X PUNCTE
points_for_respawn "10000" // Cate puncte sa aiba victima ca sa poata reinvia atunci cand este omorata
points_respawn_chance "40" // Cate sanse sa aiba victima ca sa poata reinvia
points_gamename "Adv. Points System v1.1" // Schimbi numele default( Counter-Strike ) cu altul
Imagini | Afiseaza codul
Image

Image

points_show_info "1"
Image

points_show_info "0"
Image

Image

Image

Image

Image

Image

Image

points_enable_respawn "1"
Image

Image

http://img.plici.ro/images/2014/06/18/d ... 0c1d74.png
Last edited by YONTU on 18 Jun 2014, 17:45, edited 2 times in total.
„Peste douăzeci de ani vei fi dezamăgit din cauza lucrurilor pe care nu le-ai făcut, nu din cauza celor pe care le-ai făcut.” - Mark Twain
„Asa e si in viata, hotii castiga, prostii care invata pierd.” - Mihai Nemeș

discord: IonutC#5114

Vrei sa joci pe un server de biohazard clasic specific timpurilor 2008-2012?
CLICK | Afiseaza codul
89.44.246.14:27015 biohazard clasic
Rapidserver
User avatar
CaTa.
Fost moderator
Fost moderator
Posts: 420
Joined: 28 Jul 2013, 14:06
Detinator Steam: Nu
Detinator server CS: In curand !
Reputatie: Fost Moderator ajutator
Location: Targu-Mures
Has thanked: 99 times
Been thanked: 19 times
Contact:

13 Dec 2013, 17:34

:)>-
CLICK ! | Afiseaza codul
Ma gasesti pe Messenger la id :[/b] stelyistu_95@yahoo.com
Follow me on Instagram
Fa-ti cunoscut serverul de Counter-Strike pe facebook ! 
Fa-ti reclama gratis aici Click
My Plugin Furien Guns
User avatar
FaTzZu
Fost moderator
Fost moderator
Posts: 1206
Joined: 22 Dec 2012, 18:37
Detinator Steam: Da
Reputatie: Fost moderator ajutator
Has thanked: 114 times
Been thanked: 168 times
Contact:

13 Dec 2013, 18:02

Frumos, bravo.
A fool's brain digests philosophy into folly, science into superstition, and art into pedantry.

#RETIRED.
User avatar
YONTU
Moderator ajutator
Moderator ajutator
Posts: 2446
Joined: 10 May 2013, 13:25
Detinator Steam: Nu
CS Status: Everyone is looking at ur shoes
Reputatie: Moderator ajutator
Fost scripter eXtreamCS
Location: Gura Humorului
Has thanked: 255 times
Been thanked: 281 times
Contact:

13 Dec 2013, 18:14

Multam ! >:)
„Peste douăzeci de ani vei fi dezamăgit din cauza lucrurilor pe care nu le-ai făcut, nu din cauza celor pe care le-ai făcut.” - Mark Twain
„Asa e si in viata, hotii castiga, prostii care invata pierd.” - Mihai Nemeș

discord: IonutC#5114

Vrei sa joci pe un server de biohazard clasic specific timpurilor 2008-2012?
CLICK | Afiseaza codul
89.44.246.14:27015 biohazard clasic
Cosmin
Fost moderator
Fost moderator
Posts: 9366
Joined: 06 Jul 2013, 21:08
Detinator Steam: Da
Detinator server CS: Nu
Reputatie: Fost eXtream Mod
Fost Scripter eXtreamCS
Nume anterior: scosmynnnn
Has thanked: 492 times
Been thanked: 546 times

13 Dec 2013, 18:18

Bine boss,bravo foarte frumos :)
User avatar
DaNNe.
Fost moderator
Fost moderator
Posts: 2808
Joined: 08 Nov 2013, 20:43
Detinator Steam: Da
CS Status: Activitate scăzută
SteamID: /id/FurienMaster
Reputatie: Nick anterior: DnD. Gold, Emrys
0.5/3
Fost moderator ajutator
Fost Membru Club eXtreamCS (doua luni)
Has thanked: 230 times
Been thanked: 128 times
Contact:

13 Dec 2013, 19:27

Bravo ca l-ai postat :D
P.S: Incercati sa evitati numele care contin: #, &, % pentru ca pe numele cu aceste simboluri nu se salveaza. L-am testat vreo 2 Saptamani....

GJ Ionutz :D
Contact: Activitate scazuta.
OWNX
Utilizator restrictionat
Utilizator restrictionat
Posts: 247
Joined: 23 Aug 2013, 23:09
Detinator Steam: Da
CS Status: dani_ownx@yahoo.com
Detinator server CS: Server Privat
SteamID: Privat
Reputatie: Utilizator Restrictionat: WishExec
Location: Bragadiru
Has thanked: 10 times
Been thanked: 24 times
Contact:

13 Dec 2013, 19:57

Foarte tare , felicitari
Email :[/color] dani_ownx@yahoo.com


* Privat War3FT V5.0 ( 10 Euro AMXX + SMA ) : http://www.extreamcs.com/forum/anunturi ... 15532.html
DEMO : 93.119.26.151
* Privat UWC3X V4.0 ( 15 Euro AMXX ) : http://www.extreamcs.com/forum/anunturi ... l#p1810595
DEMO : 89.39.13.139

Accept Oferte si Negocieri prin PM
User avatar
^ionutz^
Fost moderator
Fost moderator
Posts: 2000
Joined: 05 Oct 2013, 14:12
Detinator Steam: Da
CS Status: activitate scazuta !
SteamID: /id/ionutz_cs/
Reputatie: Fost moderator ajutator
Location: Galati
Has thanked: 46 times
Been thanked: 23 times
Contact:

14 Dec 2013, 08:11

bv dc nu l-ai avut si tu in addons DnD. Gold ? :)))
User avatar
Rony
Utilizator neserios (tepar)
Utilizator neserios (tepar)
Posts: 967
Joined: 11 Mar 2013, 11:43
Detinator Steam: Da
CS Status: CO-FOUNDER BETANO
Detinator server CS: CS1.6 , CS:GO
SteamID: 31r1
Reputatie: Membru Club eXtreamCS (1 luna)
Membru Club eXtreamCs (28 Feb)
Utilizator neserios (tepar)
Location: NAPOLI
Has thanked: 172 times
Been thanked: 66 times
Contact:

14 Dec 2013, 10:37

frumos,felicitari.
User avatar
FaTzZu
Fost moderator
Fost moderator
Posts: 1206
Joined: 22 Dec 2012, 18:37
Detinator Steam: Da
Reputatie: Fost moderator ajutator
Has thanked: 114 times
Been thanked: 168 times
Contact:

24 Dec 2013, 11:04

O metoda mai buna

Code: Select all

get_pcvar_num( g_iCvar[ EnableBombEvents ] ) == 0
->

Code: Select all

!get_pcvar_num( g_iCvar[ EnableBombEvents ] )
A fool's brain digests philosophy into folly, science into superstition, and art into pedantry.

#RETIRED.
User avatar
Alyn^H3k3r
Membru, skill 0
Membru, skill 0
Posts: 94
Joined: 26 Nov 2013, 18:17
Detinator Steam: Nu
Detinator server CS: Da
Location: Galati
Has thanked: 14 times
Been thanked: 2 times
Contact:

24 Dec 2013, 18:53

Ai putea sa faci si pentru mine in felul urmator: in loc de puncte sa arate credite(pluginul credit system a lui askhanar) si sa scoti acele cvaruri care le are in acest moment pluginul tau?
Dau x5 Multumesc :)
Ajut la modificarea/creearea de addons-uri/pluginuri CS1.6 de orice mod, ajutorul meu nu consta in nimic, o fac din pura placere!

ContacT:
Skype: novuslink.h3k3r
Messenger: novuslink.h3k3r
E-mail: novuslink.h3k3r@yahoo.com

MrFunk
Membru, skill 0
Membru, skill 0
Posts: 75
Joined: 16 Sep 2013, 17:59
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Has thanked: 2 times
Been thanked: 1 time
Contact:

01 Jan 2014, 13:20

Am o problema cu el: de ce atunci cand adaug acest plugin, bullet damage numai merge ?? Se mai vede 1 data la vreo 30 secunde cata viata i-am luat adversarului si vice-versa. mai fa un update sa mearga cu toate pluginurile :)
Post Reply

Return to “Pluginuri eXtream”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 4 guests