Micsorare continut motd [rezolvat]

Discutii legate de instalarea, configurarea si modificarea unui server de Counter-Strike.

Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com

Post Reply
User avatar
vlad340
Membru, skill +1
Membru, skill +1
Posts: 122
Joined: 08 Dec 2014, 22:04
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Fond eXtream: 0
Contact:

21 Feb 2015, 18:00

Salut, am VIP system si cand scriu in chat /vip imi apare motd dar cand dau in jos e incomplet si e foarte marit... Ce pot face sa l micsorez?
Last edited by Nubo on 22 Feb 2015, 17:36, edited 1 time in total.
Reason: rezolvat
Kekshost
User avatar
Nubo
Fost moderator
Fost moderator
Posts: 2734
Joined: 11 Jul 2012, 18:45
Detinator Steam: Da
CS Status: [əˈnɒn.ɪ.məs]
Reputatie: Fost scripter eXtreamCS
Fost eXtream Mod
Has thanked: 8 times
Been thanked: 27 times

21 Feb 2015, 19:56

Pune codul + o poza cu problema.
Cand nu merge acest forum sunt online aici:
  • * Skype: nubo_cs
    * Y!M ID: nubo_cs
User avatar
vlad340
Membru, skill +1
Membru, skill +1
Posts: 122
Joined: 08 Dec 2014, 22:04
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Fond eXtream: 0
Contact:

21 Feb 2015, 20:18

Scuze Ca a iesit asa Poza. Image
Trebuia sa Apara si contactul.
VIPSystem | Afiseaza codul
/*


		Credits:	Exolent - VIP in Scoreboard
			pharse - x2 Jump for VIP( for ZP 5.0.5 )
			Sn!ff3r - Show bullet dmg in HUD only VIP
			Askhanar - Change Model to VIP
			cheap.suit - No VIP Flash( extracted on Biohazard v2.00 beta )
			AMXX Dev Team - Add VIP's
			cyby - VIP Event
		

*/
#include < amxmodx >
#include < amxmisc >
#include < hamsandwich >
#include < cstrike >
#include < fakemeta >
#include < engine >
#include < fun >
#include < CC_ColorChat >
#include < message_const >

//#define USING_SQL

#if defined USING_SQL
#include < sqlx >
#endif

// Toate aceste date vor fi trecute in fisierul "users.ini" !
#define VIP_FLAGS		"bit"	// Flagurile VIP-ului( Nu schimba )
#define VIP_FLAGS_TYPE		"a"	// a - deconecteaza VIP-ii cu parola invalida( Alte flaguri gasiti in "users.ini" )
#define VIP_PASSWORD		"parola"	// Aici setati parola oricarui VIP

#define is_user_player(%1) ( 1 <= %1 <= g_iMaxPlayers )

#define TASK_SECRET_MSG		216439

// Aici schimbati orele cand jucatorii pot avea VIP free( pentru a dezactiva setati caloarea 0 cvar-ului "vip_enable_vip_event" )
#define FIRST_HOUR	00
#define LAST_HOUR	03

new const PLUGIN_VERSION[  ] = "1.0.2",
	 PLUGIN_AUTHOR[  ] = "YONTU";

#if defined USING_SQL
new const PLUGIN_NAME_SQL[  ] = "VIP System( SQL )";
#else
new const PLUGIN_NAME[  ] = "VIP System";
#endif

new const g_szTag[  ] = "[VIP System]";	// TAG
new const g_szVipFlags[  ] =	"t";		// flagul vip-ului( ADMIN_LEVEL_H )

// Aici iti pui numele cu care joci pe server si adresa ta( pluginul va afisa un mesaj la inceput de runda cu datele tale daca jucatorii sunt interesati sa cumpere vip );
new const YourNick[  ] = "...", 
	 YourMessenger[  ] = "[email protected]";

static const COLORG[  ] = "^x04", COLORD[  ] = "^x01", COLORT[  ] = "^x03";

// Refil Ammo on headshot
new const g_Weapons[  ] = {

	CSW_M4A1,
	CSW_AK47,
	CSW_DEAGLE,
	CSW_USP
};

new const g_szWeapons[  ][  ] = {

	"weapon_m4a1",
	"weapon_ak47",
	"weapon_deagle",
	"weapon_usp"
};

new const g_iWeaponsAmmo[  ] = {

	30,
	30,
	7,
	12
};

enum {

    	SCOREATTRIB_ARG_PLAYERID = 1,
    	SCOREATTRIB_ARG_FLAGS
};

enum ( <<= 1 ) {

    	SCOREATTRIB_FLAG_NONE = 0,
    	SCOREATTRIB_FLAG_DEAD = 1,
    	SCOREATTRIB_FLAG_BOMB,
    	SCOREATTRIB_FLAG_VIP
};

enum _:WhatUserHas {

	Speed,
	Jump,
}
new bool:g_bUserHas[ 33 ][ WhatUserHas ];

new 	g_cvar_speed_spawn,
	g_cvar_health_spawn,
	g_cvar_armor_spawn,
	g_cvar_gravity_spawn,
	g_cvar_multidmg,
	g_cvar_health_kill_reward,
	g_cvar_health_hs_reward,
	g_cvar_maxhealth,
	g_cvar_kill_money_reward,
	g_cvar_show_msgs,
	g_cvar_enable_show_dmg,
	g_cvar_ebable_vip_scoreboard,
	g_cvar_enable_vip_noflash,
	g_cvar_enable_vip_multijump,
	g_cvar_enable_vip_event,
	g_cvar_enable_vip_model;

new Ham:Ham_Player_ResetMaxSpeed = Ham_Item_PreFrame;

new bool:VipEvent;

new iJumpNum[ 33 ] = 0;
new g_iMultiJumps[ 33 ] = 0;
new g_iMaxJumps = 0;

new g_iMaxPlayers;
new SyncHudMessage;

public plugin_init(  ) {

	#if defined USING_SQL
	register_plugin( PLUGIN_NAME_SQL,
			PLUGIN_VERSION,
			PLUGIN_AUTHOR );
	#else
	register_plugin( PLUGIN_NAME,
			PLUGIN_VERSION,
			PLUGIN_AUTHOR );
	#endif

	register_clcmd( "say /wantvip", "ShowAbilityForVip" );
	register_clcmd( "say_team /wantvip", "ShowAbilityForVip" );

	register_concmd( "amx_addvips", "ClCmdAddVips", ADMIN_RCON, "< nume >" );

	register_event( "ResetHUD", "event_ResetModel", "b" );
	register_event( "DeathMsg", "event_DeathMsg", "a" );
	register_event( "DeathMsg", "event_DeathMsg2", "ae" );
	register_event( "Damage", "event_Damage", "b", "2!0", "3=0", "4!0" );

	register_logevent( "logevent_RoundStart", 2 , "1=Round_Start" );
	register_logevent( "logevent_RoundEnd", 2, "1=Round_End" );

	register_forward( FM_PlayerPreThink, "forward_PlayerPreThink" );
	register_forward( FM_PlayerPostThink, "forward_PlayerPostThink" );

	RegisterHam( Ham_Spawn, "player", "Ham_PlayerSpawnPost", 1 );
	RegisterHam( Ham_TakeDamage, "player", "Ham_TakeDamagePre" );
	RegisterHam( Ham_Player_ResetMaxSpeed, "player", "Ham_ResetMaxSpeedPost", 1 );

    	register_message( get_user_msgid( "ScoreAttrib" ), "MessageScoreAttrib" );
	register_message( get_user_msgid( "ScreenFade" ), "MessageScreenFade" );

	g_cvar_speed_spawn = register_cvar( "vip_speed_spawn", "400.0" );		// viteza pe care o primeste vip-ul la spawn( sa fie cu zecimala.0 )
	g_cvar_health_spawn = register_cvar( "vip_health_spawn", "200" );		// viata pe care o primeste vip-ul la spawn
	g_cvar_armor_spawn = register_cvar( "vip_armor_spawn", "150" );		// armura pe care o primeste vip-ul la spawn
	g_cvar_gravity_spawn = register_cvar( "vip_gravity_spawn", "0.85" );	// gravitatea pe care o primeste vip-ul la spawn
	g_cvar_multidmg = register_cvar( "vip_multi_dmg", "2.0" );		// vip-ul are dmg mai mare la toate armele
	g_cvar_health_kill_reward = register_cvar( "vip_hp_kill_reward", "15" );	// cata viata sa primeasca vip-ul cand face un kill
	g_cvar_health_hs_reward = register_cvar( "vip_hp_hs_reward", "25" );	// cata viata sa primeasca vip-ul cand face un headshot
	g_cvar_maxhealth = register_cvar( "vip_maxhealth", "300" );		// viata maxima a vip-ului
	g_cvar_kill_money_reward = register_cvar( "vip_kill_money", "1000" );	// Cati bani sa primeasca Vip-ul pe un frag
	g_cvar_show_msgs = register_cvar( "vip_show_messages", "30.0" );		// la ce interval de timp.0 sa apara mesajele in chat despre VIP
	g_cvar_enable_show_dmg = register_cvar( "vip_show_dmg", "1" );		// afiseaza vip-ului dmg-ul facut de victima si dmg-ul pe care i la facut victimei
	g_cvar_ebable_vip_scoreboard = register_cvar( "vip_on_scoreboard", "1" );	// 1 - vip-ii apar in scoreboard ca "VIP" | 0 - dezactivat
	g_cvar_enable_vip_noflash = register_cvar( "vip_imune_flashbang", "1" );	// 1 - Vip-ul este imun la flash-uri | 0 - Nu este
	g_cvar_enable_vip_multijump = register_cvar( "vip_enable_multijump", "1" );	// 1 - Vip-ul beneficiaza de multi jump | 0 - Nu beneficiaza
	g_cvar_enable_vip_event = register_cvar( "vip_enable_vip_event", "1" );	// 1 - Intre anumite ore toti jucatorii au VIP | 0 dezactivat
	g_cvar_enable_vip_model = register_cvar( "vip_enable_model", "1" );	// 1 - VIP-ul are alt model pe server | 0 - Nu are

	if( get_pcvar_num( g_cvar_enable_vip_event ) > 0 ) {

		check_time(  );
		set_task( 60.0, "check_time", _, _, _, "b" );
		set_task( 1.0, "hud_mess", _, _, _, "b" );
	}

	new szFile[ 64 ]
	get_configsdir( szFile, 63 );
	format( szFile, 63, "%s/vip_system.cfg", szFile );
	
	if( file_exists( szFile ) ) 
		server_cmd( "exec %s", szFile );

	g_iMaxPlayers = get_maxplayers(  );
	SyncHudMessage = CreateHudSyncObj(  );
}

public plugin_cfg(  )
	set_cvar_float( "sv_maxspeed", 1000.0 );

public plugin_precache(  ) {

	precache_model( "models/player/vip_ct/vip_ct.mdl" );
	precache_model( "models/player/vip_t/vip_t.mdl" );
}

public client_putinserver( id ) {

	g_iMultiJumps[ id ] = 0;
	iJumpNum[ id ] = 0;
	g_bUserHas[ id ][ Jump ] = false;
	g_bUserHas[ id ][ Speed ] = false;
}

public client_disconnect( id ) {

	g_iMultiJumps[ id ] = 0;
	iJumpNum[ id ] = 0;
	g_bUserHas[ id ][ Jump ] = false;
	g_bUserHas[ id ][ Speed ] = false;
}

public event_ResetModel( id ) {

	if( get_pcvar_num( g_cvar_enable_vip_model ) ) {

		if( is_user_vip( id ) ) {

			new CsTeams:userTeam = cs_get_user_team( id );

			if( userTeam == CS_TEAM_T ) {

				cs_set_user_model( id, "vip_t" );

				return 1;
			}

			else if( userTeam == CS_TEAM_CT ) {

				cs_set_user_model( id, "vip_ct" );

				return 1;
			}
		} else
			cs_reset_user_model( id );
	} else
		return 0;

	return 0;
}

public event_DeathMsg(  ) {

	new iAttacker = read_data( 1 );
	new iVictim = read_data( 2 );
	new iHeadshot = read_data( 3 );
	
	new HealthOnHeadShot = get_pcvar_num( g_cvar_health_hs_reward );
	new MaxHealth = get_pcvar_num( g_cvar_maxhealth );
	new HealthOnKill = get_pcvar_num( g_cvar_health_kill_reward );

	if( iAttacker == iVictim )
		return 0;

	if( is_user_vip( iAttacker ) && iAttacker != iVictim ) {
		
		if( get_user_health( iAttacker ) <= MaxHealth ) {

			if( iHeadshot ) {

				set_user_health( iAttacker, get_user_health( iAttacker ) + HealthOnHeadShot );

				set_hudmessage( 0, 250, 0, 0.85, 0.7, 0, 6.0, 5.0 );
				ShowSyncHudMsg( iAttacker, SyncHudMessage, "+ %i HP", HealthOnHeadShot );
			} else {

				set_user_health( iAttacker, get_user_health( iAttacker ) + HealthOnKill );

				set_hudmessage( 200, 200, 0, 0.85, 0.7, 0, 6.0, 5.0 );
				ShowSyncHudMsg( iAttacker, SyncHudMessage, "+ %i HP", HealthOnKill );
			}
		}

		if( is_user_alive( iAttacker ) && !is_user_bot( iAttacker ) )
			if( read_data( 3 ) )
				for( new w = 0; w < sizeof( g_Weapons ); w++ )
					if( get_user_weapon( iAttacker ) == g_Weapons[ w ] )
						if( find_ent_by_owner( -1, g_szWeapons[ w ], iAttacker ) )
							cs_set_weapon_ammo( find_ent_by_owner( -1, g_szWeapons[ w ], iAttacker ), g_iWeaponsAmmo[ w ] );
	}

	return 0;
}

public event_DeathMsg2(  ) {

	new iAttacker = read_data( 1 ); 
	new iVictim = read_data( 2 );

	new BonusMoney = get_pcvar_num( g_cvar_kill_money_reward );
	
	if( iAttacker == iVictim )
		return 0;

	if( is_user_vip( iAttacker ) )
		if( iAttacker && is_user_alive( iAttacker ) )
			if( cs_get_user_team( iVictim ) == CS_TEAM_T || cs_get_user_team( iVictim ) == CS_TEAM_CT )
				if( cs_get_user_money( iAttacker ) < 16000 - BonusMoney - 300 )
					cs_set_user_money( iAttacker, cs_get_user_money( iAttacker ) + BonusMoney - 300 );

	return 0;
}

public event_Damage( id ) {

	if( get_pcvar_num( g_cvar_enable_show_dmg ) > 0 ) {

		static iAttacker;
		static fDamage;
	
		iAttacker = get_user_attacker( id );
		fDamage = read_data( 2 );

		if( is_user_alive( id ) && is_user_vip( id ) ) {
			
			set_hudmessage( 255, 0, 0, 0.45, 0.50, 2, 0.1, 1.0, 0.1, 0.1, -1 );
			ShowSyncHudMsg( id, SyncHudMessage, "%i^n", fDamage );	
		}

		if( is_user_alive( iAttacker ) && is_user_vip( iAttacker ) ) {

			set_hudmessage( 0, 255, 15, -1.0, 0.55, 2, 0.1, 1.0, 0.02, 0.02, -1 );
			ShowSyncHudMsg( iAttacker, SyncHudMessage, "%i^n^n", fDamage );
		}
	}
}

public logevent_RoundStart(  ) {
	
	new szPlayers[ 32 ], iNum;
	get_players( szPlayers, iNum, "ch" );
	
	for( new i = 0; i < iNum; i++)  {

		g_bUserHas[ szPlayers[ i ] ][ Speed ] = false;
		g_bUserHas[ szPlayers[ i ] ][ Jump ] = false;
		g_iMultiJumps[ szPlayers[ i ] ] = 0;
		iJumpNum[ szPlayers[ i ] ] = 0;

		if( task_exists( szPlayers[ i ] + TASK_SECRET_MSG ) )
			remove_task( szPlayers[ i ] + TASK_SECRET_MSG );
		
		set_task( get_pcvar_float( g_cvar_show_msgs ), "task_ShowMessage", szPlayers[ i ] + TASK_SECRET_MSG );
	}
}

public logevent_RoundEnd(  ) {
	
	new szPlayers[ 32 ], iNum;
	get_players( szPlayers, iNum, "ch" );
	
	for( new i = 0; i < iNum; i++ )
		remove_task( szPlayers[ i ] );
}

public forward_PlayerPreThink( id ) {

	if( !is_user_alive( id ) || !g_iMultiJumps[ id ] )
		return 0;

	if( ( pev( id, pev_button ) & IN_JUMP ) && !( pev( id, pev_flags ) & FL_ONGROUND ) && !( pev( id, pev_oldbuttons ) & IN_JUMP ) ) {

		if( iJumpNum[ id ] < g_iMultiJumps[ id ] ) {

			g_bUserHas[ id ][ Jump ] = true;
			iJumpNum[ id ]++;

			return 0;
		}
	}

	if( ( pev( id, pev_button ) & IN_JUMP ) && ( pev( id, pev_flags ) & FL_ONGROUND ) ) {

		iJumpNum[ id ] = 0;
		return 0;
	}

	return 0;
}

public forward_PlayerPostThink( id ) {

	if( !is_user_alive( id ) || !g_iMultiJumps[ id ] )
		return 0;

	if( g_bUserHas[ id ][ Jump ] ) {

		new Float:fVelocity[ 3 ];

		pev( id, pev_velocity, fVelocity );

		fVelocity[ 2 ] = random_float( 265.0, 285.0 );

		set_pev( id, pev_velocity, fVelocity );

		g_bUserHas[ id ][ Jump ] = false;
		return 0;
	}

	return 0;
}

public Ham_PlayerSpawnPost( id ) {
	
	if( !is_user_alive( id ) && !is_user_vip( id ) )
		return HAM_IGNORED;
	
	if( is_user_vip( id ) && !is_user_bot( id ) )
		set_task( 1.0, "task_GiveSkillsAllVips", id );
	
	return HAM_IGNORED;
}

public task_GiveSkillsAllVips( id ) {

	//drop_prim( id );

	g_bUserHas[ id ][ Speed ] = true;
	fm_set_user_maxspeed( id, get_pcvar_float( g_cvar_speed_spawn ) );

	new szCommand[ 128 ];
	formatex( szCommand, sizeof( szCommand ) - 1, "cl_forwardspeed %.1f;cl_sidespeed %.1f;cl_backspeed %.1f", get_pcvar_float( g_cvar_speed_spawn ), get_pcvar_float( g_cvar_speed_spawn ), get_pcvar_float( g_cvar_speed_spawn ) );
	client_cmd( id, szCommand );

	if( get_pcvar_num( g_cvar_enable_vip_multijump ) > 0 )
		if( g_iMultiJumps[ id ] < g_iMaxJumps || !g_iMaxJumps )
			g_iMultiJumps[ id ]++;

	set_user_health( id, get_pcvar_num( g_cvar_health_spawn ) );
	set_user_armor( id, get_pcvar_num( g_cvar_armor_spawn ) );
	set_user_gravity( id, get_pcvar_float( g_cvar_gravity_spawn ) );

	fm_give_item( id, "weapon_hegrenade" );
	fm_give_item( id, "weapon_flashbang" );
	fm_give_item( id, "weapon_flashbang" );
	fm_give_item( id, "weapon_smokegrenade" );

	//GiveRifle( id );
}

public GiveRifle( id ) {

	fm_give_item( id, "weapon_m4a1" );
	cs_set_user_bpammo( id, CSW_M4A1, 300 );

	fm_give_item( id, "weapon_ak47" );
	cs_set_user_bpammo( id, CSW_AK47, 300 );

	fm_give_item( id, "weapon_awp" );
	cs_set_user_bpammo( id, CSW_AWP, 100 );

	fm_give_item( id, "weapon_deagle" );
	cs_set_user_bpammo( id, CSW_DEAGLE, 70 );
}

public task_ShowMessage( taskid ) {

	new id = taskid - TASK_SECRET_MSG;

	ColorChat( id, GREEN, "%s^x01 Vrei sa cumperi si tu^x03 Membru V.I.P^x01? Contacteaza-l pe^x03 %s^x01 la^x03 %s^x01 !!!", g_szTag, YourNick, YourMessenger );

	set_task( get_pcvar_float( g_cvar_show_msgs ) * 0.5, "task_ShowMessage2", id );

	if( task_exists( taskid ) )
		remove_task( taskid );
}

public task_ShowMessage2( id ) {

	ColorChat( id, GREEN, "%s^x01 Vrei sa faci rost de^x03 Membru VIP^x01 si nu stii cum? Tasteaza^x03 /wantvip^x01 !!!", g_szTag );

	set_task( get_pcvar_float( g_cvar_show_msgs ) * 1.2, "task_PrintVipList", id );
}

public task_PrintVipList( user ) {

	new szAdminNames[ 33 ][ 32 ];
	new szMessage[ 256 ];
	new iCount, iLen;
	
	for( new id = 1 ; id <= g_iMaxPlayers ; id++ )
		if( is_user_connected( id ) )
			if( is_user_vip( id ) )
				get_user_name( id, szAdminNames[ iCount++ ], 31 );

	iLen = format( szMessage, 255, "%sVIP's Online: ", COLORG );

	if( iCount > 0 ) {

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

			iLen += format( szMessage[ iLen ], 255 - iLen, "^x03%s^x01 | ", szAdminNames[ i ], COLORT, COLORD );

			if( iLen > 96 ) {

				print_message( user, szMessage );
				iLen = format( szMessage, 255, "%s", COLORG );
			}
		}

		print_message( user, szMessage );
	} else {

		iLen += format( szMessage[ iLen ], 255 - iLen, "^x01Nu sunt VIP-i online.", COLORD );
		print_message( user, szMessage );
	}
}

public Ham_ResetMaxSpeedPost( id ) {

	if( is_user_alive( id ) && is_user_vip( id ) && get_user_maxspeed( id ) != 1.0 ) {

  		new Float:flMaxSpeed;

  		if( g_bUserHas[ id ][ Speed ] )
   			flMaxSpeed = float( get_pcvar_num( g_cvar_speed_spawn ) );

  		if( flMaxSpeed > 0.0 )
   			set_pev( id, pev_maxspeed, flMaxSpeed );
	}
}

public Ham_TakeDamagePre( iVictim, iInflictor, iAttacker, Float:fDamage ) {

	if( iVictim == iAttacker || !is_user_player( iAttacker ) || !is_user_alive( iAttacker ) || is_user_bot( iAttacker ) )
		return HAM_HANDLED;

	if( is_user_vip( iAttacker ) && is_user_player( iAttacker ) )
		SetHamParamFloat( 4, fDamage * get_pcvar_float( g_cvar_multidmg ) );

	return HAM_IGNORED;
}

public MessageScoreAttrib( iMsgId, iMsgDest, id ) {

	if( get_pcvar_num( g_cvar_ebable_vip_scoreboard ) > 0 ) {

		new iPlayer = get_msg_arg_int( SCOREATTRIB_ARG_PLAYERID );
        
		if( access( iPlayer, read_flags( g_szVipFlags ) ) )
			set_msg_arg_int( SCOREATTRIB_ARG_FLAGS, ARG_BYTE, SCOREATTRIB_FLAG_VIP );
	}
}

public MessageScreenFade( iMsgId, iMsgDest, id ) {

	if( is_user_vip( id ) && is_user_alive( id ) && get_pcvar_num( g_cvar_enable_vip_noflash ) ) {

		static szData[ 4 ];

		szData[ 0 ] = get_msg_arg_int( 4 );
		szData[ 1 ] = get_msg_arg_int( 5 );
		szData[ 2 ] = get_msg_arg_int( 6 );
		szData[ 3 ] = get_msg_arg_int( 7 );
		
		if( szData[ 0 ] == 255 && szData[ 1 ] == 255 && szData[ 2 ] == 255 && szData[ 3] > 199 )
			return 1;
	}

	return 0;
}

public check_time(  ) {

	static preluare_ora[ 3 ], ora;
	get_time( "%H", preluare_ora, 2 );

	ora = str_to_num( preluare_ora );

	if( FIRST_HOUR >= ora || ora < LAST_HOUR ) {

		if( !VipEvent )
			ColorChat( 0, GREEN, "^x04%s^x01 Eventul^x03 Free VIP^x01 a fost activat!", g_szTag );

		VipEvent = true;
		server_cmd( "amx_default_access ^"t^"" );
	} else {

		if( VipEvent )
			ColorChat( 0, GREEN, "^x04%s^x01 Eventul^x03 Free VIP^x01 a fost activat!", g_szTag );

		VipEvent = false;
		server_cmd( "amx_default_access ^"z^"" );
	}

	server_cmd( "amx_reloadadmins" );
}

public hud_mess(  ) {

	if( VipEvent ) {

		set_hudmessage( 200, 200, 10, -1.0, 0.0, 1, 1.0, 1.0, 0.1, 0.1 );
		show_hudmessage( 0, "Toti jucatorii beneficiaza de VIP free aceasta ora!" );
	}
}

public ShowAbilityForVip( id ) {

	new iCfgDir[ 32 ], iFile[ 192 ];
        
	get_configsdir( iCfgDir, charsmax( iCfgDir ) );
	formatex( iFile, charsmax( iFile ), "%s/vip.html", iCfgDir );

	show_motd( id, iFile );
}

public ClCmdAddVips( id, level, cid ) {

	if( !cmd_access( id, level, cid, 2 ) )
		return 1;

	new szTarget[ 32 ];
	read_argv( 1, szTarget, 31 );

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

	if( !iPlayer )
		return 1;

	new szPlayerName[ 32 ], szAdminName[ 32 ];
	get_user_name( iPlayer, szPlayerName, charsmax( szPlayerName ) );
	get_user_name( id, szAdminName, charsmax( szAdminName ) );

	AddVIP( id, szPlayerName, VIP_FLAGS, VIP_PASSWORD, VIP_FLAGS_TYPE, szAdminName );
	server_cmd( "amx_reloadadmins" );

	console_print( id, "%s Vip-ul a fost adaugat in lista!", g_szTag );
	ColorChat( 0, GREEN, "^x04%s^x01 Adminul^x03 %s^x01 l-a adaugat ca VIP pe^x03 %s^x01 !", g_szTag, szAdminName, iPlayer );
	ColorChat( iPlayer, GREEN, "^x04%s^x01 Felicitari! Ai fost adaugat ca membru^x03 VIP^x01! VIP-ul se va activa harta viitoare!", g_szTag );

	return 1;
}

stock bool:is_user_vip( id ) {

	if( get_user_flags( id ) & read_flags( g_szVipFlags ) )
		return true;
	
	return false;
}

stock print_message( id, Msg[  ] ) {

	message_begin( MSG_ONE, get_user_msgid( "SayText" ), { 0, 0, 0 }, id );
	write_byte( id );
	write_string( Msg );
	message_end(  );
}

// stocks from "fakemeta_util"
stock fm_give_item( index, const item[  ] ) {

	if( !equal( item, "weapon_", 7 ) && !equal( item, "ammo_", 5 ) && !equal( item, "item_", 5 ) && !equal( item, "tf_weapon_", 10 ) )
		return 0;

	new ent = fm_create_entity( item );

	if( !pev_valid( ent ) )
		return 0;

	new Float:fOrigin[ 3 ];
	pev( index, pev_origin, fOrigin );

	set_pev( ent, pev_origin, fOrigin );
	set_pev( ent, pev_spawnflags, pev( ent, pev_spawnflags ) | SF_NORESPAWN );

	dllfunc( DLLFunc_Spawn, ent );

	new save = pev( ent, pev_solid );

	dllfunc( DLLFunc_Touch, ent, index );

	if( pev( ent, pev_solid ) != save )
		return ent;

	engfunc( EngFunc_RemoveEntity, ent );

	return -1;
}

stock fm_set_user_maxspeed( index, Float:speed = -1.0 ) {

	engfunc( EngFunc_SetClientMaxspeed, index, speed );

	set_pev( index, pev_maxspeed, speed );

	return 1;
}

stock Float:fm_get_user_maxspeed( index ) {

	new Float:speed;
	pev( index, pev_maxspeed, speed );

	return speed;
}

stock fm_set_rendering( entity, fx = kRenderFxNone, r = 255, g = 255, b = 255, render = kRenderNormal, amount = 16 ) {

	new Float:RenderColor[ 3 ];
	RenderColor[ 0 ] = float( r );
	RenderColor[ 1 ] = float( g );
	RenderColor[ 2 ] = float( b );

	set_pev( entity, pev_renderfx, fx );
	set_pev( entity, pev_rendercolor, RenderColor );
	set_pev( entity, pev_rendermode, render );
	set_pev( entity, pev_renderamt, float( amount ) );

	return 1;
}

stock fm_create_entity( const classname[  ] )
	return engfunc( EngFunc_CreateNamedEntity, engfunc( EngFunc_AllocString, classname ) );

AddVIP( id, name[  ], accessflags[  ], password[  ], flags[  ], comment[  ]="" ) {

#if defined USING_SQL
	new error[ 128 ], errno;

	new Handle:info = SQL_MakeStdTuple(  );
	new Handle:sql = SQL_Connect( info, errno, error, 127 );

	if( sql == Empty_Handle ) {

		server_print( "[AMXX] %L", LANG_SERVER, "SQL_CANT_CON", error );
#endif
		// Make sure that the users.ini file exists.
		new configsDir[ 64 ];
		get_configsdir( configsDir, 63 );
		format( configsDir, 63, "%s/users.ini", configsDir );

		if( !file_exists( configsDir ) ) {

			console_print( id, "%s File ^"%s^" doesn't exist.", g_szTag, configsDir );
			return;
		}

		// Make sure steamid isn't already in file.
		new line = 0, textline[ 256 ], len;
		const SIZE = 63;
		new line_steamid[ SIZE + 1 ], line_password[ SIZE + 1 ], line_accessflags[ SIZE + 1 ], line_flags[ SIZE + 1 ], parsedParams;

		// <name|ip|steamid> <password> <access flags> <account flags>
		while( ( line = read_file( configsDir, line, textline, 255, len ) ) ) {

			if ( len == 0 || equal( textline, ";", 1 ) )
				continue; // comment line

			parsedParams = parse( textline, line_steamid, SIZE, line_password, SIZE, line_accessflags, SIZE, line_flags, SIZE );

			if( parsedParams != 4 )
				continue;	// Send warning/error?
			
			if( containi( line_flags, flags ) != -1 && equal( line_steamid, name ) ) {

				console_print( id, "%s %s already exists!", g_szTag, name );
				return;
			}
		}
	
		// If we came here, steamid doesn't exist in users.ini. Add it.
		new linetoadd[ 512 ];
		
		if( comment[ 0 ]==0 )
			formatex( linetoadd, 511, "^r^n^"%s^" ^"%s^" ^"%s^" ^"%s^"", name, password, accessflags, flags );

		else
			formatex( linetoadd, 511, "^r^n^"%s^" ^"%s^" ^"%s^" ^"%s^" ; %s", name, password, accessflags, flags, comment );

		console_print( id, "Adding:^n%s", linetoadd );
		
		if( !write_file( configsDir, linetoadd ) )
			console_print( id, "%s Failed writing to %s!", g_szTag, configsDir );
#if defined USING_SQL
	}
	
	new table[ 32 ];

	get_cvar_string( "amx_sql_table", table, 31 );

	new Handle:query = SQL_PrepareQuery( sql, "SELECT * FROM `%s` WHERE (`auth` = '%s')", table, name );
	
	if( !SQL_Execute( query ) ) {

		SQL_QueryError( query, error, 127 );
		server_print( "[AMXX] %L", LANG_SERVER, "SQL_CANT_LOAD_ADMINS", error );
		console_print( id, "[AMXX] %L", LANG_SERVER, "SQL_CANT_LOAD_ADMINS", error );
	} 
		
	else if( SQL_NumResults( query ) )
		console_print( id, "%s %s already exists!", g_szTag, name );

	else {

		console_print( id, "Adding to database:^n^"%s^" ^"%s^" ^"%s^" ^"%s^"", name, password, accessflags, flags );

		SQL_QueryAndIgnore( sql, "REPLACE INTO `%s` (`name`, `password`, `access`, `flags`) VALUES ('%s', '%s', '%s', '%s')", table, name, password, accessflags, flags );
	}

	SQL_FreeHandle( query );
	SQL_FreeHandle( sql);
	SQL_FreeHandle( info );
#endif
}

/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1033\\ f0\\ fs16 \n\\ par }
*/
vip.html

Code: Select all

<body bgcolor=black><font color=blue><pre><bold><center>Avantajele pentru membrii <font color=green>V<font color=yellow>.</font>I<font color=yellow>.</font>P</font>:</font>
<font color=white>1.</font><font color=red> La fiecare spawn primeste setul de grenade
+ viata, armura, gravitate, viteza in plus.</font>
<font color=white>2.</font><font color=red> Multi Jump( primeste o saritura in plus cand apasa tasta "SPACE" ).</font>
<font color=white>3.</font><font color=red> Pe fiecare kill / headshot primeste un numar de viata in plus,
dar si puncte.</font>
<font color=white>4.</font><font color=red> Apare ca VIP in TAB.</font>
<font color=white>5.</font><font color=red> Skin Diferit + glow.</font>
<font color=white>6.</font><font color=red> Are acces la comenzile de Chat + Slot pe server.</font>
<font color=white>7.</font><font color=red> Isi poate reseta decesele prin comanda "/resetd".</font>
<font color=white>8.</font><font color=red> Poate vedea cat dmg face victimei in timp real.</font>
<font color=white>9.</font><font color=red> Este imun la Flashbang-uri.</font>
<font color=white>10.</font><font color=red> Are dmg-ul marit cu x2 la fiecare arma.</font>
<font color=white>11.</font><font color=red> Primeste 1.000 de puncte la cumparare.</font>
<font color=white>12.</font><font color=red> Icepand cu a 2-a runda ii apare un meniu cu doua arme gratis+deagle.</font>
<font color=white>13.</font><font color=red> Are Acces La Comanda /vmenu</font>
<font color=blue>Cum obtii VIP?</font>
<font color=yellow>Contact:<font color=blue>[email protected]</font>

<font color=white>-------------<font color=green> V.I.P</font>--------------</font>
Vreau sa micsorez in cat sa imi apara toate detaliile, dar nu stiu cum...
User avatar
Nubo
Fost moderator
Fost moderator
Posts: 2734
Joined: 11 Jul 2012, 18:45
Detinator Steam: Da
CS Status: [əˈnɒn.ɪ.məs]
Reputatie: Fost scripter eXtreamCS
Fost eXtream Mod
Has thanked: 8 times
Been thanked: 27 times

21 Feb 2015, 20:57

Am adaugat font-size. Testeaza:
| Afiseaza codul
<body bgcolor=black style="font-size: 10px"><font color=blue><pre><bold><center>Avantajele pentru membrii <font color=green>V<font color=yellow>.</font>I<font color=yellow>.</font>P</font>:</font>
<font color=white>1.</font><font color=red> La fiecare spawn primeste setul de grenade
+ viata, armura, gravitate, viteza in plus.</font>
<font color=white>2.</font><font color=red> Multi Jump( primeste o saritura in plus cand apasa tasta "SPACE" ).</font>
<font color=white>3.</font><font color=red> Pe fiecare kill / headshot primeste un numar de viata in plus,
dar si puncte.</font>
<font color=white>4.</font><font color=red> Apare ca VIP in TAB.</font>
<font color=white>5.</font><font color=red> Skin Diferit + glow.</font>
<font color=white>6.</font><font color=red> Are acces la comenzile de Chat + Slot pe server.</font>
<font color=white>7.</font><font color=red> Isi poate reseta decesele prin comanda "/resetd".</font>
<font color=white>8.</font><font color=red> Poate vedea cat dmg face victimei in timp real.</font>
<font color=white>9.</font><font color=red> Este imun la Flashbang-uri.</font>
<font color=white>10.</font><font color=red> Are dmg-ul marit cu x2 la fiecare arma.</font>
<font color=white>11.</font><font color=red> Primeste 1.000 de puncte la cumparare.</font>
<font color=white>12.</font><font color=red> Icepand cu a 2-a runda ii apare un meniu cu doua arme gratis+deagle.</font>
<font color=white>13.</font><font color=red> Are Acces La Comanda /vmenu</font>
<font color=blue>Cum obtii VIP?</font>
<font color=yellow>Contact:<font color=blue>[email protected]</font>

<font color=white>-------------<font color=green> V.I.P</font>--------------</font>
font-size: 10px schimbi aici in loc de 10 alta cifra pana cand nu va arata bine.
Cand nu merge acest forum sunt online aici:
  • * Skype: nubo_cs
    * Y!M ID: nubo_cs
User avatar
vlad340
Membru, skill +1
Membru, skill +1
Posts: 122
Joined: 08 Dec 2014, 22:04
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Fond eXtream: 0
Contact:

21 Feb 2015, 21:53

Da se modifica marimea dar nu se vede contactul si altele mai jos dupa "cum obtii vip" .. :(
The Kalu
Fost administrator
Fost administrator
Posts: 13656
Joined: 09 Oct 2010, 12:39
Detinator Steam: Da
CS Status: In grajd!
SteamID: kalulord
Reputatie: Fost Administrator
Fost membru Club eXtreamCS (6 luni)
Nume anterior: Terra
Location: Romania, Ploiesti
Has thanked: 324 times
Been thanked: 635 times
Contact:

21 Feb 2015, 22:08

Code: Select all

<body bgcolor=black style="font-size: 9px">

<div style="width: 100%; padding: 2px; height: 800px;">
<!-- Folosim width in procente pentru a afisa exact cat lungimea monitorului/ 800px,daca are 800 x 600 nu o sa vada tot textul :(-->
<font color=blue><pre><bold><center>Avantajele pentru membrii <font color=green>V<font color=yellow>.</font>I<font color=yellow>.</font>P</font>:</font>
<font color=white>1.</font><font color=red> La fiecare spawn primeste setul de grenade
+ viata, armura, gravitate, viteza in plus.</font>
<font color=white>2.</font><font color=red> Multi Jump( primeste o saritura in plus cand apasa tasta "SPACE" ).</font>
<font color=white>3.</font><font color=red> Pe fiecare kill / headshot primeste un numar de viata in plus,
dar si puncte.</font>
<font color=white>4.</font><font color=red> Apare ca VIP in TAB.</font>
<font color=white>5.</font><font color=red> Skin Diferit + glow.</font>
<font color=white>6.</font><font color=red> Are acces la comenzile de Chat + Slot pe server.</font>
<font color=white>7.</font><font color=red> Isi poate reseta decesele prin comanda "/resetd".</font>
<font color=white>8.</font><font color=red> Poate vedea cat dmg face victimei in timp real.</font>
<font color=white>9.</font><font color=red> Este imun la Flashbang-uri.</font>
<font color=white>10.</font><font color=red> Are dmg-ul marit cu x2 la fiecare arma.</font>
<font color=white>11.</font><font color=red> Primeste 1.000 de puncte la cumparare.</font>
<font color=white>12.</font><font color=red> Icepand cu a 2-a runda ii apare un meniu cu doua arme gratis+deagle.</font>
<font color=white>13.</font><font color=red> Are Acces La Comanda /vmenu</font>
<font color=blue>Cum obtii VIP?</font>
<font color=yellow>Contact:<font color=blue>[email protected]</font>

<font color=white>-------------<font color=green> V.I.P</font>--------------</font>
<div>
Image
User avatar
Nubo
Fost moderator
Fost moderator
Posts: 2734
Joined: 11 Jul 2012, 18:45
Detinator Steam: Da
CS Status: [əˈnɒn.ɪ.məs]
Reputatie: Fost scripter eXtreamCS
Fost eXtream Mod
Has thanked: 8 times
Been thanked: 27 times

21 Feb 2015, 22:15

Dimensiunile la care nu apar barele: 766x383
Cand nu merge acest forum sunt online aici:
  • * Skype: nubo_cs
    * Y!M ID: nubo_cs
User avatar
vlad340
Membru, skill +1
Membru, skill +1
Posts: 122
Joined: 08 Dec 2014, 22:04
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Fond eXtream: 0
Contact:

22 Feb 2015, 09:37

Rezolvat. Mersi!
Post Reply

Return to “Probleme la servere dedicate de Counter-Strike”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 9 guests