VIP System( SQL Version ) [Support for Nobs] [16.02.2014]

Pluginuri facute de utilizatorii forumului eXtream.

Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com

Post Reply
User avatar
Fantasy1
Utilizator neserios (tepar)
Utilizator neserios (tepar)
Posts: 4836
Joined: 05 Jul 2012, 01:26
Detinator Steam: Da
Reputatie: Membru Club eXtreamCS (1 Mar)
Utilizator neserios (TEPAR!)
Has thanked: 278 times
Been thanked: 217 times
Contact:

07 Feb 2014, 22:37

Frumos si bine pus la punct , felicitari!
CLICK AICI pentru FORUM
- Un Forum Care Nu Poate Fi Spart -
- Un Forum Care Nu Modifica Topicurile Cu Tepari -
- Vrei Indexare In Google? Posteaza Tzeparii La Noi -

- Daca ai nevoie sa te ajut cu un addons/plugin etc se plateste, nu ajut cu nimic pe GRATIS -
User avatar
YONTU
Scripter eXtreamCS
Scripter eXtreamCS
Posts: 2466
Joined: 10 May 2013, 14:25
Detinator Steam: Nu
CS Status: Everyone is looking at ur shoes
Reputatie: Moderator ajutator
Fost scripter eXtreamCS
Location: Gura Humorului
Has thanked: 256 times
Been thanked: 288 times
Contact:

07 Feb 2014, 23:00

Tot respectul baieti. Se pare ca mereu exista o persoana ofticata care strica mereu totul. Cunosc multi ca tine fatule care au doua fete si se dau mari scripteri ca tine. Sper sa nu mai avem tangente altfel te raportez. :-j Comentatorii ca tine nu au ce cauta in topicul asta.
„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ș


Bio.LeagueCs.Ro - Biohazard v4.4 Xmas Edition
discord: IonutC#5114

Experinta in: Java/Spring boot/Angular/C/C++/C#/Javascript/Python/HTML/CSS/Pawn/SQL
Ai nevoie de ajutorul meu? Ma poti gasi doar la adresa de discord de mai sus.
LyMoN
Membru, skill 0
Membru, skill 0
Posts: 6
Joined: 20 Nov 2013, 21:13
Detinator Steam: Da
Has thanked: 2 times
Contact:

08 Feb 2014, 00:56

Frumos si bafta in continuare,o sa il adaug si eu pe sv meu :D
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

08 Feb 2014, 10:35

The YONTU wrote:Tot respectul baieti. Se pare ca mereu exista o persoana ofticata care strica mereu totul. Cunosc multi ca tine fatule care au doua fete si se dau mari scripteri ca tine. Sper sa nu mai avem tangente altfel te raportez. :-j Comentatorii ca tine nu au ce cauta in topicul asta.
N-am spus niciodata ca sunt mare scripter /:) , doar ca eu nu imi fac publice scripturile .
A fool's brain digests philosophy into folly, science into superstition, and art into pedantry.

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

08 Feb 2014, 11:03

The YONTU wrote:Da te ajut da' maine! Daca lle primeste a treia runda sa le aiba pana moare sau sa li primeasca mereu la spawn incepand di a treia runda?
La fiecare spawn sa le apara dupa a3-a runda :)
User avatar
YONTU
Scripter eXtreamCS
Scripter eXtreamCS
Posts: 2466
Joined: 10 May 2013, 14:25
Detinator Steam: Nu
CS Status: Everyone is looking at ur shoes
Reputatie: Moderator ajutator
Fost scripter eXtreamCS
Location: Gura Humorului
Has thanked: 256 times
Been thanked: 288 times
Contact:

08 Feb 2014, 13:06

MrFunk wrote:
The YONTU wrote:Da te ajut da' maine! Daca lle primeste a treia runda sa le aiba pana moare sau sa li primeasca mereu la spawn incepand di a treia runda?
La fiecare spawn sa le apara dupa a3-a runda :)
| 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 < CC_ColorChat >
#include < message_const >

//#define USING_SQL

#if defined USING_SQL
#include < sqlx >
#endif

#pragma semicolon 1

#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		2139

new const PLUGIN_VERSION[  ] = "1.0.0",
	 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[  ] = "[Classic VIP]";	// TAG
new const g_szVipFlags[  ] = "bit";		// flagurile vip-ului: b - slot | i - acces la comenzile de chat | t - flagul defalt al oricarui vip

new const YourNick[  ] = "YONTU", 
	 YourMessenger[  ] = "[email protected]";

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

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_enable_glow,
	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;

new Round = 0;

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_clcmd( "say /resetd", "ClCmdSayResetDeath" );
	register_clcmd( "say_team /resetd", "ClCmdSayResetDeath" );

	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_event( "CurWeapon", "event_CurWeapon", "be", "1=1" );

	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_ultra_speed", "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_enable_glow = register_cvar( "vip_enable_glow", "1" );		// 1 - Fiecare VIP are glow in functie de echipa( CT - Blue ) | ( T - Red )
	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 ) == 1 ) {

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

	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 ) == 1 ) {

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

	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 ) ) {
		
		if( get_user_health( iAttacker ) <= MaxHealth ) {

			if( iHeadshot ) {

				fm_set_user_health( iAttacker, fm_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 {

				fm_set_user_health( iAttacker, fm_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 );
			}
		}
	}

	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 ) == 1 ) {

		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 );

		if( Round >= 3 ) {
			
			GiveRifle( szPlayers[ i ] );
		}

	}

	Round++;
}

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 ]/* = true*/ ) {

		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 ) == 1 )
		if( g_iMultiJumps[ id ] < g_iMaxJumps || !g_iMaxJumps )
			g_iMultiJumps[ id ]++;

	fm_set_user_health( id, get_pcvar_num( g_cvar_health_spawn ) );
	fm_set_user_armor( id, get_pcvar_num( g_cvar_armor_spawn ) );
	fm_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 );

	if( get_pcvar_num( g_cvar_enable_glow ) == 1 ) {
				
		switch( get_user_team( id ) ) {
	
			case 1: fm_set_rendering( id, kRenderFxGlowShell, 200, 10, 20, kRenderNormal, 0 );
			case 2: fm_set_rendering( id, kRenderFxGlowShell, 10, 240, 200, kRenderNormal, 0 );
		}
	}
}

public GiveRifle( id ) {

	if( !is_user_vip( id ) )
		return 1;

	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 );

	return 0;
}

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 ) && fm_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 ) == 1 ) {

		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( 10 >= ora || ora < 12 ) {

		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 ClCmdSayResetDeath( id ) {

	if( !is_user_vip( id ) ) {

		ColorChat( id, GREEN, "%s^x01 Nu esti^x03 Membru VIP^x01 !!!", g_szTag );
		return 1;
	}

	else if( cs_get_user_deaths( id ) == 0 ) {

		ColorChat( id, GREEN, "%s^x01 Ai deja^x03 0^x01 decese !!!", g_szTag );
		return 1;
	}

	else {

		cs_set_user_deaths( id, 0 );
		ColorChat( id, GREEN, "%s^x01 Tocmai ti-ai resetat decesele! Acum ai^x03 0^x01 decese^x01 si^x03 %i^x01 fraguri !!!", g_szTag, get_user_frags( id ) );
	}

	return 0;
}

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 drop_prim( id ) {

	new szWeapons[ 32 ], iNum;
	get_user_weapons( id, szWeapons, iNum );

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

		if( WeaponAK47 & ( 1<<szWeapons[ i ] ) || WeaponM4a1 & ( 1<<szWeapons[ i ] ) || WeaponDeagle & ( 1<<szWeapons[ i ] ) || WeaponAWP & ( 1<<szWeapons[ i ] ) ) {

			static szWeaponName[ 32 ];

			get_weaponname( szWeapons[ i ], szWeaponName, sizeof szWeaponName - 1 );
			engclient_cmd( id, "drop", szWeaponName );
		}
	}
}

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(  );
}

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

// 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_armor( index, armor ) {

	set_pev( index, pev_armorvalue, float( armor ) );

	return 1;
}

stock fm_set_user_health( index, health ) {

	health > 0 ? set_pev( index, pev_health, float( health ) ) : dllfunc( DLLFunc_ClientKill, index );

	return 1;
}

stock fm_get_user_health( index )
	return pev( index, pev_health );

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_user_gravity( index, Float:gravity = 1.0 ) {

	set_pev( index, pev_gravity, gravity );

	return 1;
}

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 }
*/
„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ș


Bio.LeagueCs.Ro - Biohazard v4.4 Xmas Edition
discord: IonutC#5114

Experinta in: Java/Spring boot/Angular/C/C++/C#/Javascript/Python/HTML/CSS/Pawn/SQL
Ai nevoie de ajutorul meu? Ma poti gasi doar la adresa de discord de mai sus.
User avatar
-Turbo-
Membru, skill +4
Membru, skill +4
Posts: 1664
Joined: 11 Nov 2012, 01:28
Detinator Steam: Da
CS Status: Bored !
Detinator server CS: Da
SteamID: kingforbidden
Reputatie: Utilizator neserios ( tepar )
Restrictie moderator
Ban scos ( achitat )
Nume anterior: Turbo19973
Location: Botosani
Has thanked: 49 times
Been thanked: 212 times

09 Feb 2014, 20:46

| Afiseaza codul
public check_time(  ) {

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

	ora = str_to_num( preluare_ora );

	if( 10 >= ora || ora < 12 ) {

		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" );
}
Modifica, pentru ca uni booti o sa creada ca este activat, si or sa-ti zica ca este bug :))
Last edited by YONTU on 09 Feb 2014, 22:15, edited 1 time in total.
Reason: Mersi! Rezolvat!
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:27

frumos , felicitari prietene
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
User avatar
cyby
Scripter eXtreamCS
Scripter eXtreamCS
Posts: 1777
Joined: 16 Jul 2011, 21:46
Detinator Steam: Da
Detinator server CS: Da
Reputatie: Scripter eXtreamCS
Fost Moderator ajutator
Has thanked: 146 times
Been thanked: 396 times

10 Feb 2014, 17:29

-Turbo- wrote:
| Afiseaza codul
public check_time(  ) {

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

	ora = str_to_num( preluare_ora );

	if( 10 >= ora || ora < 12 ) {

		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" );
}
Modifica, pentru ca uni booti o sa creada ca este activat, si or sa-ti zica ca este bug :))
Vezi ca tu esti unul dintre ei, in sursa e totul okay.
Last edited by YONTU on 10 Feb 2014, 17:32, edited 1 time in total.
Reason: Mersi cyby! Am modificat eu sursa! Turbo avea dreptate!
93.114.82.17:27015 - Monster Invasion CO-OP Mod
User avatar
Good.
Membru, skill +2
Membru, skill +2
Posts: 848
Joined: 17 Aug 2012, 10:04
Detinator Steam: Da
Reputatie: Restrictie moderator!
Membru Club eXtreamCS (2 luni)
Nume anterior: []GooD[]
Location: Bucuresti
Has thanked: 188 times
Been thanked: 34 times
Contact:

10 Feb 2014, 17:50

Nu functioneaza cvar-ul "vip_enable_model" , tot am model la vip.
User avatar
YONTU
Scripter eXtreamCS
Scripter eXtreamCS
Posts: 2466
Joined: 10 May 2013, 14:25
Detinator Steam: Nu
CS Status: Everyone is looking at ur shoes
Reputatie: Moderator ajutator
Fost scripter eXtreamCS
Location: Gura Humorului
Has thanked: 256 times
Been thanked: 288 times
Contact:

10 Feb 2014, 17:56

Good. wrote:Nu functioneaza cvar-ul "vip_enable_model" , tot am model la vip.
Da-mi sursa PM !
„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ș


Bio.LeagueCs.Ro - Biohazard v4.4 Xmas Edition
discord: IonutC#5114

Experinta in: Java/Spring boot/Angular/C/C++/C#/Javascript/Python/HTML/CSS/Pawn/SQL
Ai nevoie de ajutorul meu? Ma poti gasi doar la adresa de discord de mai sus.
User avatar
Good.
Membru, skill +2
Membru, skill +2
Posts: 848
Joined: 17 Aug 2012, 10:04
Detinator Steam: Da
Reputatie: Restrictie moderator!
Membru Club eXtreamCS (2 luni)
Nume anterior: []GooD[]
Location: Bucuresti
Has thanked: 188 times
Been thanked: 34 times
Contact:

10 Feb 2014, 19:20

Am descarcat direct amxx pus de tine. Poti sterge tu sa nu-mi mai ceara modelele din sursa si sa-mi dai direct amxx (adica sa-l faci fara modele), multumesc.
Post Reply

Return to “Pluginuri eXtream”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 6 guests