#include <amxmodx>
#include <cstrike>
#include <fakemeta>
#include <hamsandwich>
#include <fun>
new const PLUGIN[] = "Furien Knife Spawn";
new const VERSION[] = "1.0";
new const AUTHOR[] = "Editat by Tipu"; trebuia sa fie puNx dar ma rog..
#pragma semicolon 1
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: 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 /engame","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;
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(KnifeGold1Model);
precache_model(KnifeGold2Model);
precache_model(KnifeGold3Model);
}
public client_putinserver(id) {
KnifeGold1[id] = false;
KnifeGold2[id] = false;
KnifeGold3[id] = false;
}
public MenuKnife(id) {
new menu = menu_create ("\rFurien\w.\yEngame\w.\rRo \yKnife \rMenu", "CaseMenu");
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 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;
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(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(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();
}
}
}
}