Problema la compilare

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

Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com

Post Reply
User avatar
xPasion ;x
Membru, skill 0
Membru, skill 0
Posts: 47
Joined: 18 May 2014, 10:01
Detinator Steam: Nu
CS Status: RESPAWN.CSOUTSTANDING.RO # RESPAWN + Fun
Detinator server CS: Da
Discord: Hopsin#3313
Contact:

11 Oct 2022, 16:19

| Afiseaza codul
#include < amxmodx >
#include < amxmisc >
#include < fun >
#include < fakemeta_util >
#include < cstrike >
#include < hamsandwich >

#define PLUGIN "[VIP]Weapons"
#define VERSION "1.0"

#define VIP	ADMIN_LEVEL_H
#define IsPlayer(%0)    ( 1 <= %0 <= g_iMaxPlayers )
new g_iMaxPlayers;


// -- || Variabil's || -- //
new HasPower[33];
new Have[33];
new AK47[33];
new M4A1[33];
new MP5[33];
new D[33];


// -- || Constant's || -- //
new const vAK47[66] = "v_golden_ak47";
new const pAK47[66] = "p_golden_ak47";

new const vM4A1[66] = "v_golden_m4a1";
new const pM4A1[66] = "p_golden_m4a1";

new const vMP5[66] = "v_golden_mp5";
new const pMP5[66] = "p_golden_mp5";

new const vD[66] = "v_golden_deagle";
new const pD[66] = "p_golden_deagle";

//--| GodMode |--//
new GodMode_Cooldown[33] = 0;
new GodMode_DurationCooldown[33] = 0;

//--| NoRecoil |--//
new Float: cl_pushangle[33][3]
const WEAPONS_BITSUM = (1<<CSW_KNIFE|1<<CSW_HEGRENADE|1<<CSW_FLASHBANG|1<<CSW_SMOKEGRENADE|1<<CSW_C4)
//--| Cvars |--//
new CvarHPAmount, CvarAPAmount, CvarGodModeCooldown, CvarGodModeDuration;

public plugin_init() {
	register_plugin(PLUGIN, VERSION, "Truth");
	
	// -- || Power - > by sDs|Argon*
	register_clcmd("power", "Power");
	
	CvarHPAmount = register_cvar("vip_hp_amount", "255");         // Health
	CvarAPAmount = register_cvar("vip_ap_amount", "255");         // Armor
	CvarGodModeCooldown = register_cvar("vip_godmode_cooldown", "25");   // GodMode Cooldown
	CvarGodModeDuration = register_cvar("vip_godmode_duration", "2");   // GodMode Duration
	
	new weapon_name[24]
	for (new i = 1; i <= 30; i++) {
		if (!(WEAPONS_BITSUM & 1 << i) && get_weaponname(i, weapon_name, 23)) {
			RegisterHam(Ham_Weapon_PrimaryAttack, weapon_name, "Weapon_PrimaryAttack_Pre")
			RegisterHam(Ham_Weapon_PrimaryAttack, weapon_name, "Weapon_PrimaryAttack_Post", 1)
		}
	}
	
	// -- || ClCMD - > Register
	register_clcmd("say /vipmenu", "VipWeapons");
	register_clcmd("say_team /vipmenu", "VipWeapons");
	
	// -- || Event - > Register
	register_event("CurWeapon", "CurrWeapon", "be", "1=1");
	
	// -- || HamSandwich - > Register
	RegisterHam(Ham_Spawn, "player", "Spawn", true);
	RegisterHam ( Ham_TakeDamage, "player", "Player_TakeDamage" );
	g_iMaxPlayers = get_maxplayers ( 	);
	
	// Add your code here...
}

public plugin_precache() {
	
	// -- | | Weapons
	precache_model( vAK47 );
	precache_model( vAK47 );
	
	precache_model( vM4A1 );
	precache_model( vM4A1 );
	
	precache_model( vMP5 );
	precache_model( vMP5 );
	
	precache_model( vD );
	precache_model( vD );
}

public Spawn ( id ) {
	Remove(id);
	VipWeapons(id);
	GodMode_Cooldown[id] = 0;
	GodMode_DurationCooldown[id] = 0;
}

public Remove(id) {
	Have[id] = false;
	AK47[id] = false;
	M4A1[id] = false;
	MP5[id] = false;
	D[id] = false;
}

public CurrWeapon ( id ) {
	new Weapon = get_user_weapon(id);
	
	if(Weapon == CSW_AK47 && AK47[id]) {
		set_pev(id, pev_viewmodel2, vAK47);
		set_pev(id, pev_weaponmodel2, pAK47);
	}
	if(Weapon == CSW_M4A1 && M4A1[id]) {
		set_pev(id, pev_viewmodel2, vM4A1);
		set_pev(id, pev_weaponmodel2, pM4A1);
	}
	if(Weapon == CSW_MP5NAVY && MP5[id]) {
		set_pev(id, pev_viewmodel2, vMP5);
		set_pev(id, pev_weaponmodel2, pMP5);
	}
	if(Weapon == CSW_DEAGLE && D[id]) {
		set_pev(id, pev_viewmodel2, vD);
		set_pev(id, pev_weaponmodel2, pD);
	}
}

public Player_TakeDamage ( iVictim, iInflictor, iAttacker, Float:fDamage, iDamageBits )  {
	if ( IsPlayer ( iAttacker ) ) {
		if( iInflictor == iAttacker && AK47 [ iAttacker ] && is_user_alive( iAttacker ) && get_user_weapon( iAttacker ) == CSW_AK47) {
			SetHamParamFloat( 4, fDamage * 2.0);
			return HAM_HANDLED;
		}
		if( iInflictor == iAttacker && M4A1 [ iAttacker ] && is_user_alive( iAttacker ) && get_user_weapon( iAttacker ) == CSW_M4A1 ) {
			SetHamParamFloat( 4, fDamage * 2.0);
			return HAM_HANDLED;
		}
		if( iInflictor == iAttacker && MP5 [ iAttacker ] && is_user_alive( iAttacker ) && get_user_weapon( iAttacker ) == CSW_MP5NAVY) {
			SetHamParamFloat( 4, fDamage * 2.0);
			return HAM_HANDLED;
		}
		if( iInflictor == iAttacker && D [ iAttacker ] && is_user_alive( iAttacker ) && get_user_weapon( iAttacker ) == CSW_DEAGLE ) {
			SetHamParamFloat( 4, fDamage * 2.0);
			return HAM_HANDLED;
		}
	}
	
	return HAM_IGNORED;
}


public VipWeapons ( id ) {
	if( !is_user_alive(id)) {
		ColorChat(id, "^x04[VIP]^x01 Trebuie sa fii in viata pentru a folosi meniul");
		return;
	}
	else if( Have[id] ) {
		ColorChat(id, "^x04[VIP]^x01 Ai ales folosit deja meniul.");
		return;
	}
	else
	{
		WeaponsMenu(id);
	}
	return;
}

public WeaponsMenu( id ) {
	new VIPMenu = menu_create("\yVip Weapons Menu", "giver_menu");
	
	menu_additem(VIPMenu, "M4A1 Golden + Deagle Golden [ X2 Damage ]", "1", 0);
	menu_additem(VIPMenu, "AK47 Golden + Deagle Golden [ X2 Damage ]", "2", 0);
	menu_additem(VIPMenu, "MP5 Golden + Deagle Golden [ X2 Damage ]", "3", 0);
	if(HasPower[id] == 1) {
		new buffer[256];
		formatex(buffer,sizeof(buffer)-1,"\wNoRecoil \y[ \rActivat\y ]");
		menu_additem(VIPMenu, buffer, "4", 0);
	}
	else {
		new buffer[256];
		formatex(buffer,sizeof(buffer)-1,"\wNoRecoil \y[ \dDezactivat\y ]");
		menu_additem(VIPMenu, buffer, "4", 0);
	}
	if(HasPower[id] == 2) {
		new buffer[256];
		formatex(buffer,sizeof(buffer)-1,"\y%dHP & %dAP", get_pcvar_num(CvarHPAmount), get_pcvar_num(CvarAPAmount));
		menu_additem(VIPMenu, buffer, "5", 0);   
	}
	else {
		new buffer[256];
		formatex(buffer,sizeof(buffer)-1,"\w%dHP & %dAP", get_pcvar_num(CvarHPAmount), get_pcvar_num(CvarAPAmount));
		menu_additem(VIPMenu, buffer, "5", 0);   
	}
	menu_additem(VIPMenu, "God Mode", "6", 0);
	
	menu_setprop(VIPMenu, MPROP_EXIT, MEXIT_ALL);
	menu_display(id, VIPMenu, 0);
	return 1;
}

public giver_menu ( id, VIPMenu, item) {
	if(item == MENU_EXIT) {
		menu_destroy(VIPMenu);
		return 1;
	}
	if(!(get_user_flags(id) & VIP)) {
		ColorChat(id, "^x04[VIP]^x01 Acest meniu poate fi accesat doar de cei cu VIP.");
		menu_destroy(VIPMenu);
		return 1;
	}
	
	switch(item)
	{
		case 0:
		{
			Have[id] = true;
			strip_user_weapons(id);
			give_item(id, "weapon_knife");
			give_item(id, "weapon_deagle");
			give_item(id, "weapon_ak47");
			cs_set_user_bpammo(id, CSW_DEAGLE, 250);
			cs_set_user_bpammo(id, CSW_AK47, 250);
			
			AK47[id] = true;
			D[id] = true;
			CurrWeapon(id);
		}
		case 1:
		{
			Have[id] = true;
			strip_user_weapons(id);
			give_item(id, "weapon_knife");
			give_item(id, "weapon_deagle");
			give_item(id, "weapon_m4a1");
			cs_set_user_bpammo(id, CSW_DEAGLE, 250);
			cs_set_user_bpammo(id, CSW_M4A1, 250);
			
			M4A1[id] = true;
			D[id] = true;
			CurrWeapon(id);
		}
		case 2:
		{
			Have[id] = true;
			strip_user_weapons(id);
			give_item(id, "weapon_knife");
			give_item(id, "weapon_deagle");
			give_item(id, "weapon_mp5navy");
			cs_set_user_bpammo(id, CSW_DEAGLE, 250);
			cs_set_user_bpammo(id, CSW_MP5NAVY, 250);
			
			MP5[id] = true;
			D[id] = true;
			CurrWeapon(id);
		}
		case 3:
		{
			if(HasPower[id] == 1) {
				ColorChat(id,"^x03[VIP]^x04 Ai dezactviat NoRecoil.");
				HasPower[id] = 0;
				menu_destroy(VIPMenu);
				return PLUGIN_HANDLED;
			}
			ColorChat(id,"^x03[VIP]^x04 Power:^x03 NoRecoil.");
			remove_task(id);
			if(HasPower[id] == 2 && get_user_health(id) > 100) {
				set_user_health(id, 100)
				set_user_armor(id, 0);
			}
			if(HasPower[id] == 3 && get_user_godmode(id)) {
				set_user_godmode(id, 0);
			}
			HasPower[id] = 1;
		}
		case 4:
		{
			if(HasPower[id] == 2) {
				ColorChat(id,"^x03[VIP]^x04 Ai deja aceasta putere.");
				menu_destroy(VIPMenu);
				return PLUGIN_HANDLED;
			}
			ColorChat(id,"^x03[VIP]^x04 Power:^x03 Vei primi %d HP si %d AP.", get_pcvar_num(CvarHPAmount), get_pcvar_num(CvarAPAmount));
			remove_task(id);
			if(HasPower[id] == 3 && get_user_godmode(id)) {
				set_user_godmode(id, 0);
			}
			HasPower[id] = 2;
			set_task(0.1, "Give_HP_AP", id);
			Have[id] = true;
		}
		case 5:
		{
			if(HasPower[id] == 3) {
				ColorChat(id,"^x03[VIP]^x04 Ai deja aceasta putere.");
				menu_destroy(VIPMenu);
				return PLUGIN_HANDLED;
			}
			ColorChat(id,"^x03[VIP]^x04 Power:^x03 GodMode^x04 Duration:^x03 %d^x04 Cooldown;^x03 %d.", get_pcvar_num(CvarGodModeDuration), get_pcvar_num(CvarGodModeCooldown));
			ColorChat(id,"^x03[VIP]^x04 Pentru a activa GodMode apasa tasta^x03 V.");
			remove_task(id);
			if(GodMode_Cooldown[id]) {
				GodModeShowHUD2(id);
			}
			if(HasPower[id] == 2 && get_user_health(id) > 100) {
				set_user_health(id, 100)
				set_user_armor(id, 0);
			}
			if(HasPower[id] == 3 && get_user_godmode(id)) {
				set_user_godmode(id, 0);
			}
			HasPower[id] = 3;
			Have[id] = true;
		}
	}
	menu_destroy(VIPMenu);
	return 1;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Health and Armor |
//==========================================================================================================   
public Give_HP_AP(id) {
	if(get_user_flags(id) & VIP && HasPower[id] == 2) {
		fm_set_user_health(id, get_pcvar_num(CvarHPAmount));
		cs_set_user_armor(id, get_pcvar_num(CvarAPAmount), CS_ARMOR_VESTHELM);
	}
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////
// GodMode |
//==========================================================================================================   
public GodModeShowHUD(id) {
	if (!is_user_alive(id) || HasPower[id] != 3) {
		remove_task(id);
		GodMode_DurationCooldown[id] = 0;
		set_user_godmode(id, 0);
		return PLUGIN_HANDLED;
	}
	set_hudmessage(0, 100, 200, 0.05, 0.60, 0, 1.0, 1.1, 0.0, 0.0, -11);
	if(is_user_alive(id) && GodMode_DurationCooldown[id] == 1) {
		GodMode_DurationCooldown[id] --;
		show_hudmessage(id, "Ai GodMode pentru: %d secunda",GodMode_DurationCooldown[id]);
	}
	if(is_user_alive(id) && GodMode_DurationCooldown[id] > 1) {
		GodMode_DurationCooldown[id] --;
		show_hudmessage(id, "Ai GodMode pentru: %d secunde",GodMode_DurationCooldown[id]);
	}
	if(GodMode_DurationCooldown[id] <= 0) {
		show_hudmessage(id, "Nu mai ai GodMode");
		ColorChat(id,"^x03[VIP]^x04 Nu mai ai GodMode.");
		remove_task(id);
		set_user_godmode(id, 0);
		GodMode_DurationCooldown[id] = 0;
		GodMode_Cooldown[id] = get_pcvar_num(CvarGodModeCooldown);
		set_task(1.0, "GodModeShowHUD2", id, _, _, "b");
		set_hudmessage(0, 100, 200, 0.05, 0.60, 0, 1.0, 1.1, 0.0, 0.0, -11);
		if(get_pcvar_num(CvarGodModeCooldown) != 1) {
			show_hudmessage(id, "Puterea iti va reveni in: %d secunde",get_pcvar_num(CvarGodModeCooldown));
		}
		if(get_pcvar_num(CvarGodModeCooldown) == 1) {
			show_hudmessage(id, "Puterea iti va reveni in: %d secunda",get_pcvar_num(CvarGodModeCooldown));
		}
		return PLUGIN_HANDLED;
	}
	return PLUGIN_HANDLED;
}

public GodModeShowHUD2(id) {
	if (!is_user_alive(id) || HasPower[id] != 3) {
		remove_task(id);
		GodMode_Cooldown[id] = 0;
		return PLUGIN_HANDLED;
	}
	set_hudmessage(0, 100, 200, 0.05, 0.60, 0, 1.0, 1.1, 0.0, 0.0, -11);
	if(is_user_alive(id) && GodMode_Cooldown[id] == 1) {
		GodMode_Cooldown[id] --;
		show_hudmessage(id, "Puterea iti va reveni in: %d secunda",GodMode_Cooldown[id]);
	}
	if(is_user_alive(id) && GodMode_Cooldown[id] > 1) {
		GodMode_Cooldown[id] --;
		show_hudmessage(id, "Puterea iti va reveni in: %d secunde",GodMode_Cooldown[id]);
	}
	if(GodMode_Cooldown[id] <= 0) {
		show_hudmessage(id, "Ti-a revenit puterea");
		ColorChat(id,"^x03[VIP]^x04 Iti poti folosi din nou puterea.");
		remove_task(id);
		GodMode_Cooldown[id] = 0;
	}
	return PLUGIN_HANDLED;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////
// NoRecoil |
//==========================================================================================================
public Weapon_PrimaryAttack_Pre(entity) {
	new id = pev(entity, pev_owner)
	
	if (get_user_flags(id) & VIP && HasPower[id] == 1) {
		pev(id, pev_punchangle, cl_pushangle[id])
		return HAM_IGNORED;
	}
	return HAM_IGNORED;
}

public Weapon_PrimaryAttack_Post(entity) {
	new id = pev(entity, pev_owner)
	
	if (get_user_flags(id) & VIP && HasPower[id] == 1) {
		new Float: push[3]
		pev(id, pev_punchangle, push)
		xs_vec_sub(push, cl_pushangle[id], push)
		xs_vec_mul_scalar(push, 0.0, push)
		xs_vec_add(push, cl_pushangle[id], push)
		set_pev(id, pev_punchangle, push)
		return HAM_IGNORED;
	}
	return HAM_IGNORED;
}

//------| Client Power |------//
public Power(id)  {
	if (get_user_flags(id) & VIP && is_user_alive(id) && HasPower[id] == 3 && !GodMode_DurationCooldown[id]) {
		
		if (GodMode_Cooldown[id]) {
			ColorChat(id,"^x03[VIP]^x04 Puterea iti va reveni in^x03 %d secunde.",GodMode_Cooldown[id]);
			return PLUGIN_CONTINUE;
		}
		set_user_godmode(id, 1);
		GodMode_DurationCooldown[id] = get_pcvar_num(CvarGodModeDuration)
		set_task(1.0, "GodModeShowHUD", id, _, _, "b");
		set_hudmessage(0, 100, 200, 0.05, 0.60, 0, 1.0, 1.1, 0.0, 0.0, -11);
		if(get_pcvar_num(CvarGodModeDuration) != 1) {
			show_hudmessage(id, "Ai GodMode pentru: %d secunde",get_pcvar_num(CvarGodModeDuration));
		}
		if(get_pcvar_num(CvarGodModeDuration) == 1) {
			show_hudmessage(id, "Ai GodMode pentru: %d secunda",get_pcvar_num(CvarGodModeDuration));
		}
		return PLUGIN_HANDLED;
	}
	return PLUGIN_CONTINUE;
}
///////// ----------- ||| Stock's ||| ------------ //////////
stock ColorChat(const id, const input[], any:...) {
	new count = 1, players[32];
	static msg[191];
	vformat(msg, 190, input, 3);
	
	replace_all(msg, 190, "!x04", "^4");
	replace_all(msg, 190, "!x01", "^1");
	replace_all(msg, 190, "!x03", "^3");
	
	if(id) players[0] = id;
	else get_players(players, count, "ch"); {
		for(new i = 0; i < count; i++) {
			if(is_user_connected(players)) {
				message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players);
				write_byte(players);
				write_string(msg);
				message_end();
			}
		}
	}
}
Am o problema la compilare imi da aceste 3 errori
AMX Mod X Compiler 1.8.3-manual
Copyright (c) 1997-2006 ITB CompuPhase
Copyright (c) 2004-2013 AMX Mod X Team

plugin.sma(461) : error 035: argument type mismatch (argument 1)
plugin.sma(462) : error 035: argument type mismatch (argument 4)
plugin.sma(463) : error 035: argument type mismatch (argument 1)

3 Errors.
Could not locate output file plugin.amx (compile failed).
RESPAWN.CSOUTSTANDING.RO - Respawn + Fun Server Cautam admini !
RoyalServer 2
lexz
Scripter eXtreamCS
Scripter eXtreamCS
Posts: 917
Joined: 02 Nov 2020, 01:57
Detinator Steam: Da
Fond eXtream: 0
Discord: lexzor#0630
Has thanked: 71 times
Been thanked: 136 times

11 Oct 2022, 20:34

Code: Select all

#include < amxmodx >
#include < amxmisc >
#include < fun >
#include < fakemeta_util >
#include < cstrike >
#include < hamsandwich >

#define PLUGIN "[VIP]Weapons"
#define VERSION "1.0"

#define VIP	ADMIN_LEVEL_H
#define IsPlayer(%0)    ( 1 <= %0 <= g_iMaxPlayers )
new g_iMaxPlayers;


// -- || Variabil's || -- //
new HasPower[33];
new Have[33];
new AK47[33];
new M4A1[33];
new MP5[33];
new D[33];


// -- || Constant's || -- //
new const vAK47[66] = "v_golden_ak47";
new const pAK47[66] = "p_golden_ak47";

new const vM4A1[66] = "v_golden_m4a1";
new const pM4A1[66] = "p_golden_m4a1";

new const vMP5[66] = "v_golden_mp5";
new const pMP5[66] = "p_golden_mp5";

new const vD[66] = "v_golden_deagle";
new const pD[66] = "p_golden_deagle";

//--| GodMode |--//
new GodMode_Cooldown[33] = 0;
new GodMode_DurationCooldown[33] = 0;

//--| NoRecoil |--//
new Float: cl_pushangle[33][3]
const WEAPONS_BITSUM = (1<<CSW_KNIFE|1<<CSW_HEGRENADE|1<<CSW_FLASHBANG|1<<CSW_SMOKEGRENADE|1<<CSW_C4)
//--| Cvars |--//
new CvarHPAmount, CvarAPAmount, CvarGodModeCooldown, CvarGodModeDuration;

public plugin_init() {
	register_plugin(PLUGIN, VERSION, "Truth");
	
	// -- || Power - > by sDs|Argon*
	register_clcmd("power", "Power");
	
	CvarHPAmount = register_cvar("vip_hp_amount", "255");         // Health
	CvarAPAmount = register_cvar("vip_ap_amount", "255");         // Armor
	CvarGodModeCooldown = register_cvar("vip_godmode_cooldown", "25");   // GodMode Cooldown
	CvarGodModeDuration = register_cvar("vip_godmode_duration", "2");   // GodMode Duration
	
	new weapon_name[24]
	for (new i = 1; i <= 30; i++) {
		if (!(WEAPONS_BITSUM & 1 << i) && get_weaponname(i, weapon_name, 23)) {
			RegisterHam(Ham_Weapon_PrimaryAttack, weapon_name, "Weapon_PrimaryAttack_Pre")
			RegisterHam(Ham_Weapon_PrimaryAttack, weapon_name, "Weapon_PrimaryAttack_Post", 1)
		}
	}
	
	// -- || ClCMD - > Register
	register_clcmd("say /vipmenu", "VipWeapons");
	register_clcmd("say_team /vipmenu", "VipWeapons");
	
	// -- || Event - > Register
	register_event("CurWeapon", "CurrWeapon", "be", "1=1");
	
	// -- || HamSandwich - > Register
	RegisterHam(Ham_Spawn, "player", "Spawn", true);
	RegisterHam ( Ham_TakeDamage, "player", "Player_TakeDamage" );
	g_iMaxPlayers = get_maxplayers ( 	);
	
	// Add your code here...
}

public plugin_precache() {
	
	// -- | | Weapons
	precache_model( vAK47 );
	precache_model( vAK47 );
	
	precache_model( vM4A1 );
	precache_model( vM4A1 );
	
	precache_model( vMP5 );
	precache_model( vMP5 );
	
	precache_model( vD );
	precache_model( vD );
}

public Spawn ( id ) {
	Remove(id);
	VipWeapons(id);
	GodMode_Cooldown[id] = 0;
	GodMode_DurationCooldown[id] = 0;
}

public Remove(id) {
	Have[id] = false;
	AK47[id] = false;
	M4A1[id] = false;
	MP5[id] = false;
	D[id] = false;
}

public CurrWeapon ( id ) {
	new Weapon = get_user_weapon(id);
	
	if(Weapon == CSW_AK47 && AK47[id]) {
		set_pev(id, pev_viewmodel2, vAK47);
		set_pev(id, pev_weaponmodel2, pAK47);
	}
	if(Weapon == CSW_M4A1 && M4A1[id]) {
		set_pev(id, pev_viewmodel2, vM4A1);
		set_pev(id, pev_weaponmodel2, pM4A1);
	}
	if(Weapon == CSW_MP5NAVY && MP5[id]) {
		set_pev(id, pev_viewmodel2, vMP5);
		set_pev(id, pev_weaponmodel2, pMP5);
	}
	if(Weapon == CSW_DEAGLE && D[id]) {
		set_pev(id, pev_viewmodel2, vD);
		set_pev(id, pev_weaponmodel2, pD);
	}
}

public Player_TakeDamage ( iVictim, iInflictor, iAttacker, Float:fDamage, iDamageBits )  {
	if ( IsPlayer ( iAttacker ) ) {
		if( iInflictor == iAttacker && AK47 [ iAttacker ] && is_user_alive( iAttacker ) && get_user_weapon( iAttacker ) == CSW_AK47) {
			SetHamParamFloat( 4, fDamage * 2.0);
			return HAM_HANDLED;
		}
		if( iInflictor == iAttacker && M4A1 [ iAttacker ] && is_user_alive( iAttacker ) && get_user_weapon( iAttacker ) == CSW_M4A1 ) {
			SetHamParamFloat( 4, fDamage * 2.0);
			return HAM_HANDLED;
		}
		if( iInflictor == iAttacker && MP5 [ iAttacker ] && is_user_alive( iAttacker ) && get_user_weapon( iAttacker ) == CSW_MP5NAVY) {
			SetHamParamFloat( 4, fDamage * 2.0);
			return HAM_HANDLED;
		}
		if( iInflictor == iAttacker && D [ iAttacker ] && is_user_alive( iAttacker ) && get_user_weapon( iAttacker ) == CSW_DEAGLE ) {
			SetHamParamFloat( 4, fDamage * 2.0);
			return HAM_HANDLED;
		}
	}
	
	return HAM_IGNORED;
}


public VipWeapons ( id ) {
	if( !is_user_alive(id)) {
		client_print_color(id, print_team_default, "^x04[VIP]^x01 Trebuie sa fii in viata pentru a folosi meniul");
		return;
	}
	else if( Have[id] ) {
		client_print_color(id, print_team_default, "^x04[VIP]^x01 Ai ales folosit deja meniul.");
		return;
	}
	else
	{
		WeaponsMenu(id);
	}
	return;
}

public WeaponsMenu( id ) {
	new VIPMenu = menu_create("\yVip Weapons Menu", "giver_menu");
	
	menu_additem(VIPMenu, "M4A1 Golden + Deagle Golden [ X2 Damage ]", "1", 0);
	menu_additem(VIPMenu, "AK47 Golden + Deagle Golden [ X2 Damage ]", "2", 0);
	menu_additem(VIPMenu, "MP5 Golden + Deagle Golden [ X2 Damage ]", "3", 0);
	if(HasPower[id] == 1) {
		new buffer[256];
		formatex(buffer,sizeof(buffer)-1,"\wNoRecoil \y[ \rActivat\y ]");
		menu_additem(VIPMenu, buffer, "4", 0);
	}
	else {
		new buffer[256];
		formatex(buffer,sizeof(buffer)-1,"\wNoRecoil \y[ \dDezactivat\y ]");
		menu_additem(VIPMenu, buffer, "4", 0);
	}
	if(HasPower[id] == 2) {
		new buffer[256];
		formatex(buffer,sizeof(buffer)-1,"\y%dHP & %dAP", get_pcvar_num(CvarHPAmount), get_pcvar_num(CvarAPAmount));
		menu_additem(VIPMenu, buffer, "5", 0);   
	}
	else {
		new buffer[256];
		formatex(buffer,sizeof(buffer)-1,"\w%dHP & %dAP", get_pcvar_num(CvarHPAmount), get_pcvar_num(CvarAPAmount));
		menu_additem(VIPMenu, buffer, "5", 0);   
	}
	menu_additem(VIPMenu, "God Mode", "6", 0);
	
	menu_setprop(VIPMenu, MPROP_EXIT, MEXIT_ALL);
	menu_display(id, VIPMenu, 0);
	return 1;
}

public giver_menu ( id, VIPMenu, item) {
	if(item == MENU_EXIT) {
		menu_destroy(VIPMenu);
		return 1;
	}
	if(!(get_user_flags(id) & VIP)) {
		client_print_color(id, print_team_default, "^x04[VIP]^x01 Acest meniu poate fi accesat doar de cei cu VIP.");
		menu_destroy(VIPMenu);
		return 1;
	}
	
	switch(item)
	{
		case 0:
		{
			Have[id] = true;
			strip_user_weapons(id);
			give_item(id, "weapon_knife");
			give_item(id, "weapon_deagle");
			give_item(id, "weapon_ak47");
			cs_set_user_bpammo(id, CSW_DEAGLE, 250);
			cs_set_user_bpammo(id, CSW_AK47, 250);
			
			AK47[id] = true;
			D[id] = true;
			CurrWeapon(id);
		}
		case 1:
		{
			Have[id] = true;
			strip_user_weapons(id);
			give_item(id, "weapon_knife");
			give_item(id, "weapon_deagle");
			give_item(id, "weapon_m4a1");
			cs_set_user_bpammo(id, CSW_DEAGLE, 250);
			cs_set_user_bpammo(id, CSW_M4A1, 250);
			
			M4A1[id] = true;
			D[id] = true;
			CurrWeapon(id);
		}
		case 2:
		{
			Have[id] = true;
			strip_user_weapons(id);
			give_item(id, "weapon_knife");
			give_item(id, "weapon_deagle");
			give_item(id, "weapon_mp5navy");
			cs_set_user_bpammo(id, CSW_DEAGLE, 250);
			cs_set_user_bpammo(id, CSW_MP5NAVY, 250);
			
			MP5[id] = true;
			D[id] = true;
			CurrWeapon(id);
		}
		case 3:
		{
			if(HasPower[id] == 1) {
				client_print_color(id, print_team_default, "^x03[VIP]^x04 Ai dezactviat NoRecoil.");
				HasPower[id] = 0;
				menu_destroy(VIPMenu);
				return PLUGIN_HANDLED;
			}
			client_print_color(id, print_team_default, "^x03[VIP]^x04 Power:^x03 NoRecoil.");
			remove_task(id);
			if(HasPower[id] == 2 && get_user_health(id) > 100) {
				set_user_health(id, 100)
				set_user_armor(id, 0);
			}
			if(HasPower[id] == 3 && get_user_godmode(id)) {
				set_user_godmode(id, 0);
			}
			HasPower[id] = 1;
		}
		case 4:
		{
			if(HasPower[id] == 2) {
				client_print_color(id, print_team_default, "^x03[VIP]^x04 Ai deja aceasta putere.");
				menu_destroy(VIPMenu);
				return PLUGIN_HANDLED;
			}
			client_print_color(id, print_team_default, "^x03[VIP]^x04 Power:^x03 Vei primi %d HP si %d AP.", get_pcvar_num(CvarHPAmount), get_pcvar_num(CvarAPAmount));
			remove_task(id);
			if(HasPower[id] == 3 && get_user_godmode(id)) {
				set_user_godmode(id, 0);
			}
			HasPower[id] = 2;
			set_task(0.1, "Give_HP_AP", id);
			Have[id] = true;
		}
		case 5:
		{
			if(HasPower[id] == 3) {
				client_print_color(id, print_team_default, "^x03[VIP]^x04 Ai deja aceasta putere.");
				menu_destroy(VIPMenu);
				return PLUGIN_HANDLED;
			}
			client_print_color(id, print_team_default, "^x03[VIP]^x04 Power:^x03 GodMode^x04 Duration:^x03 %d^x04 Cooldown;^x03 %d.", get_pcvar_num(CvarGodModeDuration), get_pcvar_num(CvarGodModeCooldown));
			client_print_color(id, print_team_default, "^x03[VIP]^x04 Pentru a activa GodMode apasa tasta^x03 V.");
			remove_task(id);
			if(GodMode_Cooldown[id]) {
				GodModeShowHUD2(id);
			}
			if(HasPower[id] == 2 && get_user_health(id) > 100) {
				set_user_health(id, 100)
				set_user_armor(id, 0);
			}
			if(HasPower[id] == 3 && get_user_godmode(id)) {
				set_user_godmode(id, 0);
			}
			HasPower[id] = 3;
			Have[id] = true;
		}
	}
	menu_destroy(VIPMenu);
	return 1;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Health and Armor |
//==========================================================================================================   
public Give_HP_AP(id) {
	if(get_user_flags(id) & VIP && HasPower[id] == 2) {
		fm_set_user_health(id, get_pcvar_num(CvarHPAmount));
		cs_set_user_armor(id, get_pcvar_num(CvarAPAmount), CS_ARMOR_VESTHELM);
	}
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////
// GodMode |
//==========================================================================================================   
public GodModeShowHUD(id) {
	if (!is_user_alive(id) || HasPower[id] != 3) {
		remove_task(id);
		GodMode_DurationCooldown[id] = 0;
		set_user_godmode(id, 0);
		return PLUGIN_HANDLED;
	}
	set_hudmessage(0, 100, 200, 0.05, 0.60, 0, 1.0, 1.1, 0.0, 0.0, -11);
	if(is_user_alive(id) && GodMode_DurationCooldown[id] == 1) {
		GodMode_DurationCooldown[id] --;
		show_hudmessage(id, "Ai GodMode pentru: %d secunda",GodMode_DurationCooldown[id]);
	}
	if(is_user_alive(id) && GodMode_DurationCooldown[id] > 1) {
		GodMode_DurationCooldown[id] --;
		show_hudmessage(id, "Ai GodMode pentru: %d secunde",GodMode_DurationCooldown[id]);
	}
	if(GodMode_DurationCooldown[id] <= 0) {
		show_hudmessage(id, "Nu mai ai GodMode");
		client_print_color(id, print_team_default, "^x03[VIP]^x04 Nu mai ai GodMode.");
		remove_task(id);
		set_user_godmode(id, 0);
		GodMode_DurationCooldown[id] = 0;
		GodMode_Cooldown[id] = get_pcvar_num(CvarGodModeCooldown);
		set_task(1.0, "GodModeShowHUD2", id, _, _, "b");
		set_hudmessage(0, 100, 200, 0.05, 0.60, 0, 1.0, 1.1, 0.0, 0.0, -11);
		if(get_pcvar_num(CvarGodModeCooldown) != 1) {
			show_hudmessage(id, "Puterea iti va reveni in: %d secunde",get_pcvar_num(CvarGodModeCooldown));
		}
		if(get_pcvar_num(CvarGodModeCooldown) == 1) {
			show_hudmessage(id, "Puterea iti va reveni in: %d secunda",get_pcvar_num(CvarGodModeCooldown));
		}
		return PLUGIN_HANDLED;
	}
	return PLUGIN_HANDLED;
}

public GodModeShowHUD2(id) {
	if (!is_user_alive(id) || HasPower[id] != 3) {
		remove_task(id);
		GodMode_Cooldown[id] = 0;
		return PLUGIN_HANDLED;
	}
	set_hudmessage(0, 100, 200, 0.05, 0.60, 0, 1.0, 1.1, 0.0, 0.0, -11);
	if(is_user_alive(id) && GodMode_Cooldown[id] == 1) {
		GodMode_Cooldown[id] --;
		show_hudmessage(id, "Puterea iti va reveni in: %d secunda",GodMode_Cooldown[id]);
	}
	if(is_user_alive(id) && GodMode_Cooldown[id] > 1) {
		GodMode_Cooldown[id] --;
		show_hudmessage(id, "Puterea iti va reveni in: %d secunde",GodMode_Cooldown[id]);
	}
	if(GodMode_Cooldown[id] <= 0) {
		show_hudmessage(id, "Ti-a revenit puterea");
		client_print_color(id, print_team_default, "^x03[VIP]^x04 Iti poti folosi din nou puterea.");
		remove_task(id);
		GodMode_Cooldown[id] = 0;
	}
	return PLUGIN_HANDLED;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////
// NoRecoil |
//==========================================================================================================
public Weapon_PrimaryAttack_Pre(entity) {
	new id = pev(entity, pev_owner)
	
	if (get_user_flags(id) & VIP && HasPower[id] == 1) {
		pev(id, pev_punchangle, cl_pushangle[id])
		return HAM_IGNORED;
	}
	return HAM_IGNORED;
}

public Weapon_PrimaryAttack_Post(entity) {
	new id = pev(entity, pev_owner)
	
	if (get_user_flags(id) & VIP && HasPower[id] == 1) {
		new Float: push[3]
		pev(id, pev_punchangle, push)
		xs_vec_sub(push, cl_pushangle[id], push)
		xs_vec_mul_scalar(push, 0.0, push)
		xs_vec_add(push, cl_pushangle[id], push)
		set_pev(id, pev_punchangle, push)
		return HAM_IGNORED;
	}
	return HAM_IGNORED;
}

//------| Client Power |------//
public Power(id)  {
	if (get_user_flags(id) & VIP && is_user_alive(id) && HasPower[id] == 3 && !GodMode_DurationCooldown[id]) {
		
		if (GodMode_Cooldown[id]) {
			client_print_color(id, print_team_default, "^x03[VIP]^x04 Puterea iti va reveni in^x03 %d secunde.",GodMode_Cooldown[id]);
			return PLUGIN_CONTINUE;
		}
		set_user_godmode(id, 1);
		GodMode_DurationCooldown[id] = get_pcvar_num(CvarGodModeDuration)
		set_task(1.0, "GodModeShowHUD", id, _, _, "b");
		set_hudmessage(0, 100, 200, 0.05, 0.60, 0, 1.0, 1.1, 0.0, 0.0, -11);
		if(get_pcvar_num(CvarGodModeDuration) != 1) {
			show_hudmessage(id, "Ai GodMode pentru: %d secunde",get_pcvar_num(CvarGodModeDuration));
		}
		if(get_pcvar_num(CvarGodModeDuration) == 1) {
			show_hudmessage(id, "Ai GodMode pentru: %d secunda",get_pcvar_num(CvarGodModeDuration));
		}
		return PLUGIN_HANDLED;
	}
	return PLUGIN_CONTINUE;
}
///////// ----------- ||| Stock's ||| ------------ //////////
Post Reply

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

  • Information
  • Who is online

    Users browsing this forum: No registered users and 82 guests