Furien: Knife Menu

Pluginuri facute de utilizatorii forumului eXtream.

Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com

User avatar
*BoOoM*
Membru eXtream
Membru eXtream
Posts: 2041
Joined: 15 Jul 2014, 00:25
Detinator Steam: Da
CS Status: O dau prin praf :-j
Detinator server CS: Furien.BingBang.Ro
SteamID: booom_cs
Fond eXtream: 0
Been thanked: 1 time
Contact:

02 Mar 2015, 22:04

Descriere: Acest plugin este un meniu de knife-uri care apare la spawn, contine 2 meniuri: Playeri si VIP, la playeri sunt 5 knife (diferite skin-uri) iar la vip 3 knife (Gold, diferite modele). Va puteti alege doar un knife pe runda :D in cazul in care apasati pe o tasta [ex: "0"] si va disparea meniu' scrieti in chat "/knife" si o sa reapara. :)

Descarcare: GirlShare ; ZippyShare
.SMA | Afiseaza codul
#include <amxmodx>
#include <cstrike>
#include <fakemeta>
#include <hamsandwich>
#include <fun>

new const PLUGIN[] = "Furien Weapons T";
new const VERSION[] = "1.0";
new const AUTHOR[] = "*BoOoM*";

#pragma semicolon 1

#define VIP_FLAG ADMIN_LEVEL_H

new const Knife1Model[66] = "models/furienknife/v_lava_knife.mdl";
new const Knife2Model[66] = "models/furienknife/v_karambit_knife.mdl";
new const Knife3Model[66] = "models/furienknife/v_wolverin_knife.mdl";
new const Knife4Model[66] = "models/furienknife/v_neon_knife.mdl";
new const Knife5Model[66] = "models/furienknife/v_celurit_knife.mdl";

new const KnifeGold1Model[66] = "models/furienknife/v_default_goldknife.mdl";
new const KnifeGold2Model[66] = "models/furienknife/v_hilius_goldknife.mdl";
new const KnifeGold3Model[66] = "models/furienknife/v_axe_goldknife.mdl";

new bool: Knife1[33];
new bool: Knife2[33];
new bool: Knife3[33];
new bool: Knife4[33];
new bool: Knife5[33];

new bool: KnifeGold1[33];
new bool: KnifeGold2[33];
new bool: KnifeGold3[33];

new bool: KnifeChoosen[33];

public plugin_init() {
	register_plugin(PLUGIN, VERSION, AUTHOR);
	
	register_clcmd("say /knife","SayKnife");
	
	register_event("CurWeapon", "CurentWeapon", "be", "1=1");
	RegisterHam(Ham_Spawn, "player", "Spawn", 1);
	RegisterHam(Ham_TakeDamage, "player", "DamageKnife");	

}

public Spawn(id) {
	if(is_user_alive(id))
		{
		KnifeChoosen[id] = false;
		
		Knife1[id] = false;
		Knife2[id] = false;
		Knife3[id] = false;
		Knife4[id] = false;
		Knife5[id] = false;
		
		KnifeGold1[id] = false;
		KnifeGold2[id] = false;
		KnifeGold3[id] = false;
		
		if(cs_get_user_team(id) == CS_TEAM_T) {
			MenuKnife(id);
		}
	}
}

public plugin_precache() {
	precache_model(Knife1Model);
	precache_model(Knife2Model);
	precache_model(Knife3Model);
	precache_model(Knife4Model);
	precache_model(Knife5Model);
	
	precache_model(KnifeGold1Model);	
	precache_model(KnifeGold2Model);
	precache_model(KnifeGold3Model);
}

public client_putinserver(id) {
	Knife1[id] = false;
	Knife2[id] = false;
	Knife3[id] = false;
	Knife4[id] = false;
	Knife5[id] = false;
	
	KnifeGold1[id] = false;
	KnifeGold2[id] = false;
	KnifeGold3[id] = false;
}

public MenuKnife(id)
	{
	new menu = menu_create ("\rNume\w.\yNume\w.\rRo \yKnife \rMenu", "CaseMenu");
	
	menu_additem(menu, "\yPlayer \rKnife", "1");
	menu_additem(menu, "\yV\w.\yI\w.\yP \rKnife", "2");
	
	menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);
	menu_display(id, menu, 0 );
	
	return 1; 
}

public CaseMenu(id, menu, item) {
	if(item == MENU_EXIT) {
		return 1;
	}
	
	new data [6], szName [64];
	new access, callback;
	menu_item_getinfo (menu, item, access, data,charsmax (data), szName,charsmax (szName), callback);
	new key = str_to_num (data);
	
	switch (key)
	{
		case 1:
		{
			MenuPlayeri(id);
		}
		
		case 2:
		{
			if( get_user_flags( id ) & VIP_FLAG ) {
				MenuVIP(id);
			}
			else
			{
				ChatColor(id, "!g[Furien Knife]!nAcest meniu poate fi accesat doar de membri !gVIP");
				MenuKnife(id);
			}
		}
	}
	
	menu_destroy (menu);
	return 1;
}
public MenuPlayeri(id) {
	new menu = menu_create ("\yFurien \rPlayer \yKnife \rMenu", "CaseKnifePlayeri");
	menu_additem(menu, "\yLava \rKnife", "1");
	menu_additem(menu, "\yKarambit \rKnife", "2");
	menu_additem(menu, "\yWolverin \rKnife", "3");
	menu_additem(menu, "\yNeon \rKnife", "4");
	menu_additem(menu, "\yCelurit \rKnife", "5");
	
	menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);
	menu_display(id, menu, 0 );
	
	return 1; 
}

public CaseKnifePlayeri(id, menu, item) {
	if(item == MENU_EXIT) {
		return 1;
	}
	if(!(is_user_alive(id))) {
		ChatColor(id, "!g[Furien Knife] !nNu poti alege cutitul atunci când esti mort");
		return 1;
	}
	
	new data [6], szName [64];
	new access, callback;
	menu_item_getinfo (menu, item, access, data,charsmax (data), szName,charsmax (szName), callback);
	new key = str_to_num (data);
	
	switch (key)
	{
		case 1:
		{
			KnifeChoosen[id] = true;
			Knife1[id] = true;
			CurentWeapon(id);
			ChatColor(id, "!g[Furien Knife] !nAi Ales !gLava Knife");
		}
		
		case 2:
		{
			KnifeChoosen[id] = true;
			Knife2[id] = true;
			CurentWeapon(id);
			ChatColor(id, "!g[Furien Knife] !nAi Ales !gKarambit Knife");
		}
		
		case 3:
		{
			KnifeChoosen[id] = true;
			Knife3[id] = true;
			CurentWeapon(id);
			ChatColor(id, "!g[Furien Knife] !nAi ales !gWolverin Knife");
		}
		case 4:
		{
			KnifeChoosen[id] = true;
			Knife4[id] = true;
			CurentWeapon(id);
			ChatColor(id, "!g[Furien Knife] !nAi ales !gNeon Knife");
		}
		case 5:
		{
			KnifeChoosen[id] = true;
			Knife5[id] = true;
			CurentWeapon(id);
			ChatColor(id, "!g[Furien Knife] !nAi ales !gCelurit Knife");
		}
	}
	
	menu_destroy (menu);
	return 1;
}


public MenuVIP(id) {
	new menu = menu_create ("\yFurien \rVIP \yKnife \rMenu", "CaseKnifeVIP");
	menu_additem(menu, "\wDefault \yGold \rKnife", "1");
	menu_additem(menu, "\wHilius \yGold \rKnife ", "2");
	menu_additem(menu, "\wAxe \yGold \rKnife", "3");
	
	menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);
	menu_display(id, menu, 0 );
	
	return 1; 
}

public CaseKnifeVIP(id, menu, item) {
	if(item == MENU_EXIT) {
		return 1;
	}
	
	if(!(is_user_alive(id))) {
		ChatColor(id, "!g[Furien Knife] !nNu poti alege cutitul atunci când esti mort");
		return 1;
	}
	
	new data [6], szName [64];
	new access, callback;
	menu_item_getinfo (menu, item, access, data,charsmax (data), szName,charsmax (szName), callback);
	new key = str_to_num (data);
	
	switch (key)
	{
		case 1:
		{
			KnifeChoosen[id] = true;
			KnifeGold1[id] = true;
			CurentWeapon(id);
			ChatColor(id, "!g[Furien Knife] !nAi ales !gKnife Gold");
		}
		
		case 2:
		{
			KnifeChoosen[id] = true;
			KnifeGold2[id] = true;
			CurentWeapon(id);
			ChatColor(id, "!g[Furien Knife] !nAi ales !gHilius Gold");
		}
		
		case 3:
		{
			KnifeChoosen[id] = true;
			KnifeGold3[id] = true;
			CurentWeapon(id);
			ChatColor(id, "!g[Furien Knife] !nAi ales !gAxe Gold");
		}
		
	}
	
	menu_destroy (menu);
	return 1;
}

public CurentWeapon(id) {
        if(get_user_weapon(id) == CSW_KNIFE) {

	if(Knife1[id])
	set_pev(id, pev_viewmodel2, Knife1Model);
	
	if(Knife2[id])
	set_pev(id, pev_viewmodel2, Knife2Model);
	
	if(Knife3[id])
	set_pev(id, pev_viewmodel2, Knife3Model);
	
	if(Knife4[id])
	set_pev(id, pev_viewmodel2, Knife4Model);
	
	if(Knife5[id])
	set_pev(id, pev_viewmodel2, Knife5Model);
	
	if(KnifeGold1[id])
	set_pev(id, pev_viewmodel2, KnifeGold1Model);
	
	if(KnifeGold2[id])
	set_pev(id, pev_viewmodel2, KnifeGold2Model);
	
	if(KnifeGold3[id])
	set_pev(id, pev_viewmodel2, KnifeGold3Model);
     }
}


public DamageKnife ( Victim, Inflictor, Attacker, Float:fDamage )  {
	if(is_user_connected(Attacker) && Attacker != Victim) {
                if(get_user_weapon(Attacker) == CSW_KNIFE) {

		if(Knife1[Attacker])
		SetHamParamFloat(4, fDamage * 2.0);
		
		if(Knife2[Attacker])
		SetHamParamFloat(4, fDamage * 2.0);
		
		if(Knife3[Attacker])
		SetHamParamFloat(4, fDamage * 2.0);

		if(Knife4[Attacker])
		SetHamParamFloat(4, fDamage * 2.0);
		
		if(Knife5[Attacker]) 
		SetHamParamFloat(4, fDamage * 2.0);
		
		if(KnifeGold1[Attacker]) 
		SetHamParamFloat(4, fDamage * 4.0);
		
		if(KnifeGold2[Attacker]) 
		SetHamParamFloat(4, fDamage * 4.0);
		
		if(KnifeGold3[Attacker]) 
		SetHamParamFloat(4, fDamage * 4.0);

		}
	}
}

public SayKnife(id) {
	if(KnifeChoosen[id])  {
		ChatColor(id, "!g[Furien Knife] !nAti ales deja un cutit în aceasta runda");
		return;
	}
	
	if(cs_get_user_team(id) == CS_TEAM_T)  {
		MenuKnife(id);
	}
}

stock ChatColor(const id, const input[], any:...) {
	new count = 1, players[32];
	static msg[191];
	vformat(msg, 190, input, 3);
	
	replace_all(msg, 190, "!g", "^4"); // verde
	replace_all(msg, 190, "!n", "^1"); // galben/alb/negru
	replace_all(msg, 190, "!t", "^3"); // rosu/albastru/gri
	replace_all(msg, 190, "!t2", "^0"); // rosu2/albastru2/gri2
	
	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();
			}
		}
	}
}


Nume: Furien: Knifes Menu
Versiune: 1.0
Link oficial: http://www.extreamcs.com

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

Code: Select all

furien_knife.amxx
4. Alti pasi necesari....

Cvar-uri (se adauga in fisierul amxmodx\configs\amxx.cfg):
-

Comenzi administrative (se tasteaza in consola si trebuie sa fiti administrator):
-

Comenzi publice (se tasteaza in joc prin apasarea tastei Y):
  • /knife - arata meniul
Module necesare (se sterge ; din fata modulului de mai jos; acestea le gasiti in fisierul amxmodx\configs\modules.ini):
- CStrike
- Fun
- Amxmodx
- Fekemeta
- hamsandwich
Imagini | Afiseaza codul
Image
Image
Image
Tutorial Editare | Afiseaza codul
Am trecut in sursa "knife 1 ; knife 2,etc.. | knifeGold1 ; knifeGold2,etc.. pentru a nu fi editate in functie de numele knife-ului... Acestea sunt asezate consecutiv in meniu, adica knife 1,etse primul knife din meniu si asa mai departe..
Ce trebuie sa editati daca vreti sa schimbati vre'un knife/model..:

1.Daca vreti sa schimbati doar modelul modificati aceasta linie: [ex: la primul knife(primul din meniu)]
[code]new const Knife1Model[66] = "models/furienknife/v_lava_knife.mdl";[/code]
in:
[code]new const Knife1Model[66] = "models/furienknife/v_nume_model.mdl";[/code]
Adica in loc de "v_lava_knife" (.mdl il lasati) puneti numele modelului DVS (cel nou). :)

2. Daca vreti sa schimbati atat modelul cat si numele..:
2.1 Faceti primul pas ! [1.]
2.2 Modificati linia urmatoare: [ex: tot la primul knife]
[code]menu_additem(menu, "\yLava \rKnife", "1");[/code]
in:
[code]menu_additem(menu, "\yNume \rKnife", "1");[/code]
in loc de "lava" puneti numele cutitului respectiv, daca are o denumire, daca nu atunci (si aveti doar .mdl) il redenumiti voi cum doriti. :D
2.3 Daca ati modificat [2.2] Atunci va trebui sa modificati inca o linie din:
[code]ChatColor(id, "!g[Furien Knife] !nAi Ales !gLava Knife");[/code]
in:
[code]ChatColor(id, "!g[Furien Knife] !nAi Ales !gNume Knife");[/code]
iarasi in loc de "lava" puneti numele modelului. :)
2.4 Pentru a schimba dmg-ul, cautam publicul "DamageKnife" , si editam de la knife-ul respectiv (1,2,3,etc..) "2.0" in "3.0" daca vrem sa-l marim, sau "2.5", sau daca vrem sa-l scadem: "1.0" ; "1.5" :D

Sper ca ati inteles,bafta !
Last edited by *BoOoM* on 04 Mar 2015, 23:02, edited 4 times in total.
eXtreamSHOP
User avatar
Truth
Membru, skill +1
Membru, skill +1
Posts: 215
Joined: 26 Jun 2014, 18:50
Detinator Steam: Da
CS Status: I learn ...
SteamID: Private
Fond eXtream: 0
Location: Buzau
Has thanked: 1 time
Been thanked: 9 times
Contact:

02 Mar 2015, 23:16

| Afiseaza codul
#include <amxmodx>
#include <cstrike>
#include <fakemeta>
#include <hamsandwich>
#include <fun>

new const PLUGIN[] = "Furien Weapons T";
new const VERSION[] = "1.0";
new const AUTHOR[] = "*BoOoM*";

#pragma semicolon 1

#define VIP_FLAG ADMIN_LEVEL_H
#define IsPlayer(%0)    ( 1 <= %0 <= g_iMaxPlayers ) // e pentru damage, sa nu dea erori in consola
new g_iMaxPlayers;

new const Knife1Model[66] = "models/furienknife/v_lava_knife.mdl";
new const Knife2Model[66] = "models/furienknife/v_karambit_knife.mdl";
new const Knife3Model[66] = "models/furienknife/v_wolverin_knife.mdl";
new const Knife4Model[66] = "models/furienknife/v_neon_knife.mdl";
new const Knife5Model[66] = "models/furienknife/v_celurit_knife.mdl";

new const KnifeGold1Model[66] = "models/furienknife/v_default_goldknife.mdl";
new const KnifeGold2Model[66] = "models/furienknife/v_hilius_goldknife.mdl";
new const KnifeGold3Model[66] = "models/furienknife/v_axe_goldknife.mdl";

new bool: Knife1[33];
new bool: Knife2[33];
new bool: Knife3[33];
new bool: Knife4[33];
new bool: Knife5[33];

new bool: KnifeGold1[33];
new bool: KnifeGold2[33];
new bool: KnifeGold3[33];

new bool: KnifeChoosen[33];

public plugin_init() {
	register_plugin(PLUGIN, VERSION, AUTHOR);
	
	register_clcmd("say /knife","SayKnife");
	
	register_event("CurWeapon", "CurentWeapon", "be", "1=1");
	RegisterHam(Ham_Spawn, "player", "Spawn", 1);
	RegisterHam(Ham_TakeDamage, "player", "DamageKnife");	
	
	g_iMaxPlayers = get_maxplayers ( 	);
}

public Spawn(id) {
	if(is_user_alive(id))
		{
		KnifeChoosen[id] = false;
		
		Knife1[id] = false;
		Knife2[id] = false;
		Knife3[id] = false;
		Knife4[id] = false;
		Knife5[id] = false;
		
		KnifeGold1[id] = false;
		KnifeGold2[id] = false;
		KnifeGold3[id] = false;
		
		if(cs_get_user_team(id) == CS_TEAM_T) {
			MenuKnife(id);
		}
	}
}

public plugin_precache() {
	precache_model(Knife1Model);
	precache_model(Knife2Model);
	precache_model(Knife3Model);
	precache_model(Knife4Model);
	precache_model(Knife5Model);
	
	precache_model(KnifeGold1Model);	
	precache_model(KnifeGold2Model);
	precache_model(KnifeGold3Model);
}

public client_putinserver(id) {
	Knife1[id] = false;
	Knife2[id] = false;
	Knife3[id] = false;
	Knife4[id] = false;
	Knife5[id] = false;
	
	KnifeGold1[id] = false;
	KnifeGold2[id] = false;
	KnifeGold3[id] = false;
}

public client_disconnect(id) {
	Knife1[id] = false;
	Knife2[id] = false;
	Knife3[id] = false;
	Knife4[id] = false;
	Knife5[id] = false;
	
	KnifeGold1[id] = false;
	KnifeGold2[id] = false;
	KnifeGold3[id] = false;
}

public MenuKnife(id)
	{
	new menu = menu_create ("\rNume\w.\yNume\w.\rRo \yKnife \rMenu", "CaseMenu");
	
	menu_additem(menu, "\yPlayer \rKnife", "1");
	menu_additem(menu, "\yV\w.\yI\w.\yP \rKnife", "2");
	
	menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);
	menu_display(id, menu, 0 );
	
	return 1; 
}

public CaseMenu(id, menu, item) {
	if(item == MENU_EXIT) {
		return 1;
	}
	
	new data [6], szName [64];
	new access, callback;
	menu_item_getinfo (menu, item, access, data,charsmax (data), szName,charsmax (szName), callback);
	new key = str_to_num (data);
	
	switch (key)
	{
		case 1:
		{
			MenuPlayeri(id);
		}
		
		case 2:
		{
			if( get_user_flags( id ) & VIP_FLAG ) {
				MenuVIP(id);
			}
			else
			{
				ChatColor(id, "!g[Furien Knife]!nAcest meniu poate fi accesat doar de membri !gVIP");
				MenuKnife(id);
			}
		}
	}
	
	menu_destroy (menu);
	return 1;
}
public MenuPlayeri(id) {
	new menu = menu_create ("\yFurien \rPlayer \yKnife \rMenu", "CaseKnifePlayeri");
	menu_additem(menu, "\yLava \rKnife", "1");
	menu_additem(menu, "\yKarambit \rKnife", "2");
	menu_additem(menu, "\yWolverin \rKnife", "3");
	menu_additem(menu, "\yNeon \rKnife", "4");
	menu_additem(menu, "\yCelurit \rKnife", "5");
	
	menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);
	menu_display(id, menu, 0 );
	
	return 1; 
}

public CaseKnifePlayeri(id, menu, item) {
	if(item == MENU_EXIT) {
		return 1;
	}
	if(!(is_user_alive(id))) {
		ChatColor(id, "!g[Furien Knife] !nNu poti alege cutitul atunci când esti mort");
		return 1;
	}
	
	new data [6], szName [64];
	new access, callback;
	menu_item_getinfo (menu, item, access, data,charsmax (data), szName,charsmax (szName), callback);
	new key = str_to_num (data);
	
	switch (key)
	{
		case 1:
		{
			KnifeChoosen[id] = true;
			Knife1[id] = true;
			CurentWeapon(id);
			ChatColor(id, "!g[Furien Knife] !nAi Ales !gLava Knife");
		}
		
		case 2:
		{
			KnifeChoosen[id] = true;
			Knife2[id] = true;
			CurentWeapon(id);
			ChatColor(id, "!g[Furien Knife] !nAi Ales !gKarambit Knife");
		}
		
		case 3:
		{
			KnifeChoosen[id] = true;
			Knife3[id] = true;
			CurentWeapon(id);
			ChatColor(id, "!g[Furien Knife] !nAi ales !gWolverin Knife");
		}
		case 4:
		{
			KnifeChoosen[id] = true;
			Knife4[id] = true;
			CurentWeapon(id);
			ChatColor(id, "!g[Furien Knife] !nAi ales !gNeon Knife");
		}
		case 5:
		{
			KnifeChoosen[id] = true;
			Knife5[id] = true;
			CurentWeapon(id);
			ChatColor(id, "!g[Furien Knife] !nAi ales !gCelurit Knife");
		}
	}
	
	menu_destroy (menu);
	return 1;
}


public MenuVIP(id) {
	new menu = menu_create ("\yFurien \rVIP \yKnife \rMenu", "CaseKnifeVIP");
	menu_additem(menu, "\wDefault \yGold \rKnife", "1");
	menu_additem(menu, "\wHilius \yGold \rKnife ", "2");
	menu_additem(menu, "\wAxe \yGold \rKnife", "3");
	
	menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);
	menu_display(id, menu, 0 );
	
	return 1; 
}

public CaseKnifeVIP(id, menu, item) {
	if(item == MENU_EXIT) {
		return 1;
	}
	
	if(!(is_user_alive(id))) {
		ChatColor(id, "!g[Furien Knife] !nNu poti alege cutitul atunci când esti mort");
		return 1;
	}
	
	new data [6], szName [64];
	new access, callback;
	menu_item_getinfo (menu, item, access, data,charsmax (data), szName,charsmax (szName), callback);
	new key = str_to_num (data);
	
	switch (key)
	{
		case 1:
		{
			KnifeChoosen[id] = true;
			KnifeGold1[id] = true;
			CurentWeapon(id);
			ChatColor(id, "!g[Furien Knife] !nAi ales !gKnife Gold");
		}
		
		case 2:
		{
			KnifeChoosen[id] = true;
			KnifeGold2[id] = true;
			CurentWeapon(id);
			ChatColor(id, "!g[Furien Knife] !nAi ales !gHilius Gold");
		}
		
		case 3:
		{
			KnifeChoosen[id] = true;
			KnifeGold3[id] = true;
			CurentWeapon(id);
			ChatColor(id, "!g[Furien Knife] !nAi ales !gAxe Gold");
		}
		
	}
	
	menu_destroy (menu);
	return 1;
}

public CurentWeapon(id) {
	if(Knife1[id] && get_user_weapon(id) == CSW_KNIFE)
		set_pev(id, pev_viewmodel2, Knife1Model);
	
	if(Knife2[id] && get_user_weapon(id) == CSW_KNIFE)
		set_pev(id, pev_viewmodel2, Knife2Model);
	
	if(Knife3[id] && get_user_weapon(id) == CSW_KNIFE)
		set_pev(id, pev_viewmodel2, Knife3Model);
	
	if(Knife4[id] && get_user_weapon(id) == CSW_KNIFE)
		set_pev(id, pev_viewmodel2, Knife4Model);
	
	if(Knife5[id] && get_user_weapon(id) == CSW_KNIFE)
		set_pev(id, pev_viewmodel2, Knife5Model);
	
	if(KnifeGold1[id] && get_user_weapon(id) == CSW_KNIFE)
		set_pev(id, pev_viewmodel2, KnifeGold1Model);
	
	if(KnifeGold2[id] && get_user_weapon(id) == CSW_KNIFE)
		set_pev(id, pev_viewmodel2, KnifeGold2Model);
	
	if(KnifeGold3[id] && get_user_weapon(id) == CSW_KNIFE)
		set_pev(id, pev_viewmodel2, KnifeGold3Model);
}


public DamageKnife ( iVictim, iInflictor, iAttacker, Float:fDamage, iDamageBits )  {
	if ( IsPlayer ( iAttacker ) ) {
		if(iInflictor == iAttacker && Knife1[iAttacker] && is_user_alive(iAttacker) && get_user_weapon(iAttacker) == CSW_KNIFE && cs_get_user_team(iAttacker) == CS_TEAM_T) {
			SetHamParamFloat(4, fDamage * 2.0);
			return HAM_HANDLED;
		}
		
		if(iInflictor == iAttacker && Knife2[iAttacker] && is_user_alive(iAttacker) && get_user_weapon(iAttacker) == CSW_KNIFE && cs_get_user_team(iAttacker) == CS_TEAM_T )  {
			SetHamParamFloat(4, fDamage * 2.0);
			return HAM_HANDLED;
		}
		
		if(iInflictor == iAttacker && Knife3[iAttacker] && is_user_alive(iAttacker) && get_user_weapon(iAttacker) == CSW_KNIFE && cs_get_user_team(iAttacker) == CS_TEAM_T) {
			SetHamParamFloat(4, fDamage * 2.0);
			return HAM_HANDLED;
		}
		if(iInflictor == iAttacker && Knife4[iAttacker] && is_user_alive(iAttacker) && get_user_weapon(iAttacker) == CSW_KNIFE && cs_get_user_team(iAttacker) == CS_TEAM_T) {
			SetHamParamFloat(4, fDamage * 2.0);
			return HAM_HANDLED;
		}
		
		if(iInflictor == iAttacker && Knife5[iAttacker] && is_user_alive(iAttacker) && get_user_weapon(iAttacker) == CSW_KNIFE && cs_get_user_team(iAttacker) == CS_TEAM_T) {
			SetHamParamFloat(4, fDamage * 2.0);
			return HAM_HANDLED;
		}
		
		if(iInflictor == iAttacker && KnifeGold1[iAttacker] && is_user_alive(iAttacker) && get_user_weapon(iAttacker) == CSW_KNIFE && cs_get_user_team(iAttacker) == CS_TEAM_T) {
			SetHamParamFloat(4, fDamage * 4.0);
			return HAM_HANDLED;
		}
		
		if(iInflictor == iAttacker && KnifeGold2[iAttacker] && is_user_alive(iAttacker) && get_user_weapon(iAttacker) == CSW_KNIFE && cs_get_user_team(iAttacker) == CS_TEAM_T) {
			SetHamParamFloat(4, fDamage * 4.0);
			return HAM_HANDLED;
		}
		
		if(iInflictor == iAttacker && KnifeGold3[iAttacker] && is_user_alive(iAttacker) && get_user_weapon(iAttacker) == CSW_KNIFE && cs_get_user_team(iAttacker) == CS_TEAM_T) {
			SetHamParamFloat(4, fDamage * 4.0);
			return HAM_HANDLED;
		}
	}
	return HAM_IGNORED;
}

public SayKnife(id) {
	if(KnifeChoosen[id])  {
		ChatColor(id, "!g[Furien Knife] !nAti ales deja un cutit în aceasta runda");
		return;
	}
	
	if(cs_get_user_team(id) == CS_TEAM_T)  {
		MenuKnife(id);
	}
}

stock ChatColor(const id, const input[], any:...) {
	new count = 1, players[32];
	static msg[191];
	vformat(msg, 190, input, 3);
	
	replace_all(msg, 190, "!g", "^4"); // verde
	replace_all(msg, 190, "!n", "^1"); // galben/alb/negru
	replace_all(msg, 190, "!t", "^3"); // rosu/albastru/gri
	replace_all(msg, 190, "!t2", "^0"); // rosu2/albastru2/gri2
	
	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();
			}
		}
	}
}

Ți-am corectat niște greseli sper că nu te superi.
Probabil te întrebi de ce am modificat...
Pai așa cum scrie și în comentariu este pentru a evita posibilele erori în consola.

Code: Select all

#define IsPlayer(%0)    ( 1 <= %0 <= g_iMaxPlayers ) // e pentru damage, sa nu dea erori in consola
Alta ar fi că ai pus verificarea de mai jos la fiecare case când puteai să o pui la început pentru a nu mai scrie de 10 ori aceași verificare. În fine asta ține de alegerea fiecăruia.

Code: Select all

			if(!is_user_alive(id))
			{
				ChatColor(id, "!g[Furien Knife] !nNu poti alege cutitul atunci când esti mort");
				return 1;
			}
			
			else
			{
				KnifeChoosen[id] = true;
				Knife1[id] = true;
				CurentWeapon(id);
				ChatColor(id, "!g[Furien Knife] !nAi Ales !gLava Knife");
			}
În rest totul e okey.
Felicitări pentru plugin.

P.S. Am observat aceași problemă și la pluginul de weapons. Ai putea sa îi faci aceleași modificări ;)
Image

Pluginuri Publicate:

- Furien XP System #1 | #2 | #3 | #4 | #5 | #6
User avatar
*BoOoM*
Membru eXtream
Membru eXtream
Posts: 2041
Joined: 15 Jul 2014, 00:25
Detinator Steam: Da
CS Status: O dau prin praf :-j
Detinator server CS: Furien.BingBang.Ro
SteamID: booom_cs
Fond eXtream: 0
Been thanked: 1 time
Contact:

02 Mar 2015, 23:35

@Truth, Merci :"> , nu m-am gandit la eroare :O cat despre verificare (am creat primul knife, meniu,case cu o singura verificare, dp am continuat luand prima si editando de aceea a aparut la fiecare) chiar am vrut s-o scot dar am uitat :))

ON: Am dat Edit :D [imd si dincolo]
User avatar
Nubo
Fost moderator
Fost moderator
Posts: 2744
Joined: 11 Jul 2012, 17:45
Detinator Steam: Da
CS Status: [əˈnɒn.ɪ.məs]
Reputatie: Fost scripter eXtreamCS
Fost eXtream Mod
Has thanked: 8 times
Been thanked: 26 times
Contact:

03 Mar 2015, 16:02

Vad ca verifici echipa in Ham_TakeDamage, dar acel bool:Knife doar Tero il pot avea pe true, fiindca doar ei pot accesa meniul.
Cand nu merge acest forum sunt online aici:
  • * Skype: nubo_cs
    * Y!M ID: nubo_cs
User avatar
*BoOoM*
Membru eXtream
Membru eXtream
Posts: 2041
Joined: 15 Jul 2014, 00:25
Detinator Steam: Da
CS Status: O dau prin praf :-j
Detinator server CS: Furien.BingBang.Ro
SteamID: booom_cs
Fond eXtream: 0
Been thanked: 1 time
Contact:

03 Mar 2015, 17:32

Nubo wrote:Vad ca verifici echipa in Ham_TakeDamage, dar acel bool:Knife doar Tero il pot avea pe true, fiindca doar ei pot accesa meniul.
Done. :D
DwightPnn
Membru, skill 0
Membru, skill 0
Posts: 4
Joined: 16 Aug 2013, 17:25
Detinator Steam: Da
CS Status: Nu citesc forumul eXtreamCS.com...!
Contact:

03 Mar 2015, 23:11

Code: Select all

new const Knife1Model[66] = "models/furienknife/v_lava_knife.mdl";
new const Knife2Model[66] = "models/furienknife/v_karambit_knife.mdl";
new const Knife3Model[66] = "models/furienknife/v_wolverin_knife.mdl";
new const Knife4Model[66] = "models/furienknife/v_neon_knife.mdl";
new const Knife5Model[66] = "models/furienknife/v_celurit_knife.mdl";

new const KnifeGold1Model[66] = "models/furienknife/v_default_goldknife.mdl";
new const KnifeGold2Model[66] = "models/furienknife/v_hilius_goldknife.mdl";
new const KnifeGold3Model[66] = "models/furienknife/v_axe_goldknife.mdl";

new bool: Knife1[33];
new bool: Knife2[33];
new bool: Knife3[33];
new bool: Knife4[33];
new bool: Knife5[33];

new bool: KnifeGold1[33];
new bool: KnifeGold2[33];
new bool: KnifeGold3[33];
Decat sa folosesti 8 vectori a cate 33 celule in care sa inregistrezi care jucator primeste cutit, mai bine folosesti unul singur dand valori in functie de cutit (ex: Knife[id]=3 (3-al treilea cutit)) sau, in cazul in care te pricepi, folosesti un vector cu 8 celule (8 cutite ai) si setezi cu operatiile de mutare pe biti, fiecare jucator care foloseste cutitul (ex marcare: Knife[3] |= (1 << (id & 31));, ex stergere Knife[3] &= ~(1<<(id&31)); astea pentru al trilea cutit..)

Meniurile fiind statice, ar trebui create o singura data la incarcarea plugin-ului si doar afisate la comanda /knife.
User avatar
*BoOoM*
Membru eXtream
Membru eXtream
Posts: 2041
Joined: 15 Jul 2014, 00:25
Detinator Steam: Da
CS Status: O dau prin praf :-j
Detinator server CS: Furien.BingBang.Ro
SteamID: booom_cs
Fond eXtream: 0
Been thanked: 1 time
Contact:

04 Mar 2015, 22:23

@DwightPnn nu ma stiu cu d'alea :))
User avatar
dRaGoNeLy^ ;x
Membru, skill +3
Membru, skill +3
Posts: 1425
Joined: 27 Jun 2014, 14:42
Detinator Steam: Da
CS Status: PR0 Than Y0U!
Detinator server CS: Nu.
SteamID: PM!
Reputatie: Castigator Membru Club eXtream @ Mos Nicolae (doua luni)
Fost Membru Club eXtreamCS (patru luni)
Fond eXtream: 0
Location: București
Has thanked: 23 times
Been thanked: 11 times
Contact:

07 Mar 2015, 15:00

Schimba linia asta

Code: Select all

menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);
Cu asta la fiecare meniu:

Code: Select all

menu_setprop(menu, MPROP_EXIT, MEXIT_NEVER);
In acest fel, butonul '0' (Exit) o sa dispara.
Image
User avatar
*BoOoM*
Membru eXtream
Membru eXtream
Posts: 2041
Joined: 15 Jul 2014, 00:25
Detinator Steam: Da
CS Status: O dau prin praf :-j
Detinator server CS: Furien.BingBang.Ro
SteamID: booom_cs
Fond eXtream: 0
Been thanked: 1 time
Contact:

07 Mar 2015, 15:23

@dRaGoNeLy^ ;x , tocmai ca eu vreau sa apara :D (pentru ca: daca am un knife din shop, care ramane pana la dead, poate vreau sa joc tot cu el, nu ma intereseaza meniul.. si vreau sa-l inchid ca ma deranjeaza pe dekstop, intelegi...? :P )
Rio*
Membru, skill 0
Membru, skill 0
Posts: 62
Joined: 01 Mar 2015, 12:41
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Fond eXtream: 0
Contact:

07 Mar 2015, 21:56

Nu ami mai apar grenezile ori de la acest PLUGIN ori de-la cel c arme nu stiu sigur de la care
phpBB [media]
User avatar
*BoOoM*
Membru eXtream
Membru eXtream
Posts: 2041
Joined: 15 Jul 2014, 00:25
Detinator Steam: Da
CS Status: O dau prin praf :-j
Detinator server CS: Furien.BingBang.Ro
SteamID: booom_cs
Fond eXtream: 0
Been thanked: 1 time
Contact:

08 Mar 2015, 02:41

Rio* wrote:Nu ami mai apar grenezile ori de la acest PLUGIN ori de-la cel c arme nu stiu sigur de la care
Ca nu iti apar nu este vina acestor pluginuri, probabil la vechiul plugin de weapons care-l aveai, primeai si setul de grenazi+knife default, de obicei grenazile le primeai de la shop, acum depinde :D, zi ce grenazi vrei si cate :D
Rio*
Membru, skill 0
Membru, skill 0
Posts: 62
Joined: 01 Mar 2015, 12:41
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Fond eXtream: 0
Contact:

08 Mar 2015, 20:38

Daca ai schimba si tu DMG la cutite ar fi tare.Cutitu de VIP ia 730 prin spate.Baga si tu la VIP sa ia 230 HP. Si cele de player cate 150.
phpBB [media]
Post Reply

Return to “Pluginuri eXtream”

  • Information