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

Pluginuri facute de utilizatorii forumului eXtream.

Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com

mz00relllll
Membru, skill +1
Membru, skill +1
Posts: 104
Joined: 11 Dec 2013, 18:00
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Has thanked: 16 times
Been thanked: 9 times
Contact:

04 Jan 2014, 16:25

super
Rapidserver
Nelutzu
Membru, skill 0
Membru, skill 0
Posts: 19
Joined: 04 Nov 2009, 16:52
Detinator Steam: Da
Detinator server CS: pro.freakz.ro
SteamID: nelutzu_zrw
Contact:

29 Jan 2014, 16:04

Eu am o problema cu acest plugin.
Dupa cateva zile, mi se sterge fisierul in care se salveaza toate punctele.

Oare de ce? Devine prea mare?
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:

29 Jan 2014, 16:29

Vezi PM Nelutzu !
O sa fac versiunea si pe nvault!
„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
Nelutzu
Membru, skill 0
Membru, skill 0
Posts: 19
Joined: 04 Nov 2009, 16:52
Detinator Steam: Da
Detinator server CS: pro.freakz.ro
SteamID: nelutzu_zrw
Contact:

29 Jan 2014, 16:53

Eu am mai modificat pluginul asta, mesajele nu le mai apar tututor jucatorilor, ci doar celor care is implicati (cand un admin ii da puncte unui jucator, mesajul apare doar jucatorului care a primit si adminului care a dat si alte comenzi de genul).

Sper ca modificarea pe care o faci tu, cu nVault, implica doar scrierea si citirea din fisier :D ca sa nu trebuiasca sa modific iar la mesaje.
Oricum, am salvate modificarile si nu ar fi o problema modificarile facute de tine. Deci, fa tot ce poti numai sa fie bine.

Si apropo, mai spunea cineva de bullet damage. Intradevar, face conflict cu acest plugin.
Probabil se suprapun niste mesaje de tip HUD. Si de asta nu apare damage-ul facut.
Din cate am inteles eu, un jucator poate primi 4 mesaje HUD in acelasi timp. Atat bullet damage cat si acest plugin facut de tine trimit mesaje HUD. Poate is prea multe mesaje in acelasi loc.
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:

29 Jan 2014, 17:07

| 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 >
#include < nvault >

#pragma semicolon 1

#define ADMIN_ACCESS ADMIN_RCON
#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[  ] = "Sistem puncte";
new g_Vault;

// 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 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 /cumparapuncte", "ClCmdSayBuyPoint" );
	register_clcmd( "say_team /cumparapuncte", "ClCmdSayBuyPoint" );

	register_clcmd( "say /ptop", "ClCmdSayShowAllPoints" );
	register_clcmd( "say_team /ptop", "ClCmdSayShowAllPoints" );

	register_clcmd( "say /puncte", "ClCmdSayPoints" );
	register_clcmd( "say_team /puncte", "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", "0" );
	g_iCvar[ EnableBombEvents ] = register_cvar( "points_bombevents_rewards", "1" );
	g_iCvar[ CostOnePoint ] = register_cvar( "points_costonepoint", "16000" );
	g_iCvar[ PointsPerHS ] = register_cvar( "points_per_headshot", "3" );
	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", "2" );
	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", "0" );

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

	g_Vault = nvault_open( "AdvPointsSystem" );
}

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 ^"0^" // 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 ^"16000^" // Cat sa coste un punct atunci cand il cumperi prin comanda /buypoint" );
		write_file( szWriteCvarsPoints, "points_per_headshot ^"3^" // 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 ^"2^" // Cate puncte sa primesti pe dezamorsarea bombei" );
		write_file( szWriteCvarsPoints, "points_enable_respawn ^"0^" // Activeaza / Dezactiveaza respawn-ul cand victima moare doar daca are X PUNCTE" );
		write_file( szWriteCvarsPoints, "points_for_respawn ^"10000^" // 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" );
	}
}

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 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[ 160 ];
				if( targetTeam == team ) {

					formatex( sMessage, sizeof( sMessage ) -1, "%s: %s^nHP: %i | Puncte: %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^nHP: %i | Puncte: %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( 0, 255, 0, 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( 0, 255, 0, 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( 0, 255, 0, 0.01, 0.23, 0, 0.5, 15.0, 2.0, 2.0, -1 );
				ShowSyncHudMsg( id, SyncHudMessage, "Puncte: %d", g_iUserPoints[ id ] );
			}

			else {

				new idSpec;
				new iPlayerName[ 32 ];

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

				set_hudmessage( 0, 255, 0, 0.01, 0.22, 0, 0.5, 15.0, 2.0, 2.0, -1 );
				ShowSyncHudMsg( id, SyncHudMessage, "Jucator: %s^nHP: %d^nPuncte: %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 | Puncte: %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( 0, 255, 0, -1.0, 0.7, 0, 0.5, 15.0, 2.0, 2.0, -1 );
				ShowSyncHudMsg( id, SyncHudMessage, "Jucator: %s^nHP: %d^nPuncte: %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( id, TEAM_COLOR, "^x01[%s^x01] Mai ai nevoie de^x03 %d $^x01 pentru a cumpara^x03 10 puncte^x01", g_szTag, iNeededMoney - g_iUserMoney );
 
		else {
 
			g_iUserPoints[ id ] += 10;
			cs_set_user_money( id, g_iUserMoney - iNeededMoney );
			ColorChat( id, TEAM_COLOR, "^x01[^%s^x01] Tocmai ai cumparat^x03 10 puncte^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><table style='font-family: Courier New; font-size: 12px; background-color: black; color: yellow; border: 1px solid yellow; padding: 2px; width: 300px'><tr colspan='2'><td>Puncte jucatori online</td></tr><tr><td>Nume</td><td>Puncte</td></tr>");
	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, "<tr><td>%s</td><td>%i</td></tr>", szName, g_iUserPoints[ iPlayers[ i ] ] );
	}

	formatex( szMotd[ len ], charsmax( szMotd ) - len, "</table></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, "[^x04Sistem puncte^x01] Ai %i puncte", g_iUserPoints[ id ] );
	
	ColorChat( id, TEAM_COLOR, "^x01[^%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 ] );
	//show_hudmessage(iPlanter, "[^x04Sistem puncte^x01] Ai primit^x03 1 punct^x01 pentru plantarea bombei", g_szTag);
	ColorChat( iPlanter, TEAM_COLOR, "^x01[%s^x01] Ai primit^x03 1 punct^x01 pentru plantarea bombei", g_szTag);
	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 ] );
	//show_hudmessage(iExploder, "[^x04Sistem puncte^x01] Ai primit^x03 2 puncte^x01 pentru ca bomba a explodat", g_szTag);
	ColorChat( iExploder, TEAM_COLOR, "^x01[%s^x01] Ai primit^x03 2 puncte^x01 pentru ca bomba a explodat", g_szTag);
	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 ] );
	//show_hudmessage(iDefuser, "[^x04Sistem puncte^x01] Ai primit ^x03 2 puncte^x01 pentru dezamorsarea bombei", g_szTag);
	ColorChat( iDefuser, TEAM_COLOR, "^x01[%s^x01] Ai primit^x03 2 puncte^x01 pentru dezamorsarea bombei", g_szTag);
	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 > <puncte>" );
		return 1;
	}
	
	new iPlayers[ 32 ];
	new iPlayersNum;
	
	new iPoints = str_to_num( szSecondArg );
	if( iPoints <= 0 ) {

		client_cmd( id, "echo Numarul de puncte 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, "^x01[%s^x01] Adminul^x03 %s^x01 le-a dat^x03 %i punct(e)^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 nici un jucator in aceasta echipa!" );
						return 1;
					}

					for( new i = 0; i < iPlayersNum ; i++ )
						g_iUserPoints[ iPlayers[ i ] ] += iPoints;
						
					ColorChat( 0, TEAM_COLOR, "^x01[%s^x01] Adminul^x03 %s^x01 le-a dat^x03 %i punct(e)^x01 jucatorilor din echipa^x03 T^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, "^x01[%s^x01] Adminul^x03 %s^x01 le-a dat^x03 %i punct(e)^x01 jucatorilor din echipa^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 );
	
	if( is_user_connected(id) )
	{
		ColorChat( iPlayer, TEAM_COLOR, "^x01[^%s^x01] Adminul^x03 %s^x01 ti-a dat^x03 %i punct(e)^x01", g_szTag, get_name( id ), iPoints);
		ColorChat( id, TEAM_COLOR, "^x01[^%s^x01] I-ai dat^x03 %i punct(e)^x01 lui^x03 %s^x01", g_szTag, 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 Numarul de puncte 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 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 );
	if( is_user_connected(id) )
	{
		ColorChat( iPlayer, TEAM_COLOR, "^x01[^%s^x01] Adminul^x03 %s^x01 ti-a luat^x03 %i punct(e)^x01", g_szTag, get_name( id ), iPoints);
		ColorChat( id, TEAM_COLOR, "^x01[^%s^x01] I-ai luat^x03 %i puncte^x01 lui^x03 %s^x01", g_szTag, iPoints, szName );
	}
	return 1;
}

public ClCmdResetPoints( id, level, cid ) {
	if( !( get_user_flags( id ) & ADMIN_ACCESS ) ) {

		client_cmd( id, "echo Nu ai acces la aceasta comanda!" );
		return 1;
	}
	
	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, "^x01[^%s^x01] Adminul^x03 %s^x01 a resetat punctele tuturor jucatorilor", g_szTag, get_name( id ) );
	}
			
	else {

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

		if( !player )  {

  			 return PLUGIN_HANDLED;
		}
	
		//new iPlayer = cmd_target( id, szFirstArg, 8 );
		new TargetName[ 32 char ];
		get_user_name( player, TargetName, charsmax( TargetName ) );
		
		g_iUserPoints[ player ] = 0;
		ColorChat( player, TEAM_COLOR, "^x01[^%s^x01] Adminul^x03 %s^x01 ti-a resetat punctele", g_szTag, get_name( id ));
		ColorChat( id, TEAM_COLOR, "^x01[^%s^x01] I-ai resetat punctele lui^x03 %s^x01", g_szTag, TargetName );
	}

	return PLUGIN_HANDLED;
}

public SaveUserPoints( id ) {

	new szVaultKey[ 64 ], szVaultData[ 256 ];

	format( szVaultKey, 63, "%s", get_name( id ) );
	format( szVaultData, 255, "%i#", g_iUserPoints[ id ] );

	nvault_set( g_Vault, szVaultKey, szVaultData );

	return 1;
}

public LoadUserPoints( id ) {

 	new szVaultKey[ 64 ], szVaultData[ 256 ];

	format( szVaultKey, 63, "%s", get_name( id ) );
	format( szVaultData, 255, "%i#", g_iUserPoints[ id ] );

 	nvault_get( g_Vault, szVaultKey, szVaultData, 255 );

 	replace_all( szVaultData, 255, "#", " " );

 	new Arg1[ 32 ];
 	parse( szVaultData, Arg1, 31 );

 	g_iUserPoints[ id ] = str_to_num( Arg1 );

 	return 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 }
*/
Vedeti acum!
Versiune pe nVault!
„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
Nelutzu
Membru, skill 0
Membru, skill 0
Posts: 19
Joined: 04 Nov 2009, 16:52
Detinator Steam: Da
Detinator server CS: pro.freakz.ro
SteamID: nelutzu_zrw
Contact:

29 Jan 2014, 17:21

Sper sa nu mai faca probleme.
Dar in legatura cu bullet damage, poti sa verifici cumva? Sa nu mai faca conflict.
Nelutzu
Membru, skill 0
Membru, skill 0
Posts: 19
Joined: 04 Nov 2009, 16:52
Detinator Steam: Da
Detinator server CS: pro.freakz.ro
SteamID: nelutzu_zrw
Contact:

30 Jan 2014, 22:43

Cand ia serverul crash.. se duce fisierul..
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:

10 Feb 2014, 13:57

Daca cineva scrie /points (un player oarecare) de ce imi arata si mie cate puncte are ?
PS: Nu am modificat nimic din el.
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:

10 Feb 2014, 14:06

MrFunk wrote:Daca cineva scrie /points (un player oarecare) de ce imi arata si mie cate puncte are ?
PS: Nu am modificat nimic din el.
OPS ;)) ! Gata am rezolvat!
„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
User avatar
[CSDM]Best
Utilizator neserios (tepar)
Utilizator neserios (tepar)
Posts: 932
Joined: 26 Dec 2013, 15:39
Detinator Steam: Da
CS Status: Best Gaming
Detinator server CS: Da sunt :D
SteamID: GangstaCSGO
Location: La Moldoveni
Has thanked: 7 times
Been thanked: 21 times
Contact:

10 Feb 2014, 17:30

frumos si succes in continuare
Image
Copyright © Gangsta - All rights reserved.
Yahoo Messenger: Best_Extream
Skype: vanea432
Image
Concurs steam http://blz.ro/forum/index.php?/topic/44 ... s-steam-1/ csgo cs 1.6 css cs0
Image
Image
JooonnnX
Membru, skill +1
Membru, skill +1
Posts: 122
Joined: 13 Feb 2014, 19:05
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Has thanked: 18 times
Been thanked: 1 time
Contact:

18 Feb 2014, 20:28

Frate, unde si cum modific , sa apara acolo jos punctele in colt stanga jos, cu alta culoare care sare in ochi , ca aia numa la intuneric se vede.
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:

18 Feb 2014, 20:59

| Afiseaza codul
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 ] );
			}
		}
	}
}
Cauti publicul asta in sursa!
Modifici ce ti.am ingrosat eu pentru schimbarea culorilor!
Rosu, Verde, Albastru
„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
Post Reply

Return to “Pluginuri eXtream”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 5 guests