Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <amxmodx>
- #include <amxmisc>
- #include <nvault>
- #include <csstats>
- #include <fun>
- #include <cstrike>
- #include <colorchat>
- #include <engine>
- #include <hamsandwich>
- #define PLUGIN "Knife System"
- #define VERSION "1.0"
- #define AUTHOR "Pićunak"
- #define HUD 672
- new model_noza[33];
- new noz[33][33];
- new ubistva_igraca[33];
- new osvojeno_nozeva[33];
- new energija_igraca[33];
- new g_vault;
- new g_msgHideWeapon;
- new SyncHudObj;
- new const imena_nozeva[28][] = {
- "Default",
- "Machete",
- "Back",
- "Pocket",
- "Butcher",
- "Wooden",
- "Dragon",
- "Ninja",
- "Black",
- "Hitman",
- "Daedric",
- "Ice",
- "Katana",
- "Rusty",
- "Crowbar",
- "Celurit",
- "Kabar",
- "Karambit",
- "Omega",
- "Metal Machete",
- "Plunger",
- "Rambo",
- "Toporiaka",
- "Candy",
- "Elite",
- "Traker",
- "Bayonet",
- "Triple"
- }
- new const potrebno_ubistava[] = {
- 0,
- 10,
- 20,
- 30,
- 40,
- 50,
- 60,
- 70,
- 80,
- 90,
- 100,
- 150,
- 200,
- 250,
- 300,
- 350,
- 400,
- 450,
- 500,
- 550,
- 600,
- 650,
- 700,
- 750,
- 800,
- 850,
- 900,
- 950
- }
- public plugin_precache() {
- precache_model("models/v_knife.mdl")
- precache_model("models/knife-system/v_machete.mdl")
- precache_model("models/knife-system/v_back.mdl")
- precache_model("models/knife-system/v_pocket.mdl")
- precache_model("models/knife-system/v_butcher.mdl")
- precache_model("models/knife-system/v_wooden.mdl")
- precache_model("models/knife-system/v_dragon.mdl")
- precache_model("models/knife-system/v_ninja.mdl")
- precache_model("models/knife-system/v_black.mdl")
- precache_model("models/knife-system/v_hitman.mdl")
- precache_model("models/knife-system/v_daedric.mdl")
- precache_model("models/knife-system/v_ice.mdl")
- precache_model("models/knife-system/v_katana.mdl")
- precache_model("models/knife-system/v_rusty.mdl")
- precache_model("models/knife-system/v_crowbar.mdl")
- precache_model("models/knife-system/v_celurit.mdl")
- precache_model("models/knife-system/v_kabar.mdl")
- precache_model("models/knife-system/v_karambit.mdl")
- precache_model("models/knife-system/v_domega.mdl")
- precache_model("models/knife-system/v_mmachete.mdl")
- precache_model("models/knife-system/v_plunger.mdl")
- precache_model("models/knife-system/v_rambo.mdl")
- precache_model("models/knife-system/v_toporiaka.mdl")
- precache_model("models/knife-system/v_candy.mdl")
- precache_model("models/knife-system/v_elite.mdl")
- precache_model("models/knife-system/v_traker.mdl")
- precache_model("models/knife-system/v_bayonet.mdl")
- precache_model("models/knife-system/v_kunai.mdl")
- precache_model("models/knife-system/p_machete.mdl")
- precache_model("models/knife-system/p_back.mdl")
- precache_model("models/knife-system/p_pocket.mdl")
- precache_model("models/knife-system/p_butcher.mdl")
- precache_model("models/knife-system/p_wooden.mdl")
- precache_model("models/knife-system/p_dragon.mdl")
- precache_model("models/knife-system/p_ninja.mdl")
- precache_model("models/knife-system/p_black.mdl")
- precache_model("models/knife-system/p_hitman.mdl")
- precache_model("models/knife-system/p_daedric.mdl")
- precache_model("models/knife-system/p_ice.mdl")
- precache_model("models/knife-system/p_katana.mdl")
- precache_model("models/knife-system/p_rusty.mdl")
- precache_model("models/knife-system/p_crowbar.mdl")
- precache_model("models/knife-system/p_celurit.mdl")
- precache_model("models/knife-system/p_kabar.mdl")
- precache_model("models/knife-system/p_karambit.mdl")
- precache_model("models/knife-system/p_domega.mdl")
- precache_model("models/knife-system/p_mmachete.mdl")
- precache_model("models/knife-system/p_plunger.mdl")
- precache_model("models/knife-system/p_rambo.mdl")
- precache_model("models/knife-system/p_toporiaka.mdl")
- precache_model("models/knife-system/p_candy.mdl")
- precache_model("models/knife-system/p_elite.mdl")
- precache_model("models/knife-system/p_traker.mdl")
- precache_model("models/knife-system/p_bayonet.mdl")
- precache_model("models/knife-system/p_kunai.mdl")
- }
- public plugin_init() {
- register_plugin(PLUGIN, VERSION, AUTHOR)
- register_clcmd("say /knife", "PromeniNoz");
- register_clcmd("say_team /knife", "PromeniNoz");
- register_clcmd("say /noz", "PromeniNoz");
- register_clcmd("say_team /noz", "PromeniNoz");
- register_clcmd("say /resetall", "RestartUbistava");
- register_clcmd("say_team /resetall", "RestartUbistava");
- register_clcmd("say /reset", "Resetovanje");
- register_clcmd("say_team /reset", "Resetovanje");
- register_event("CurWeapon", "CurWeapon", "be", "1=1");
- register_event("ResetHUD", "eResetHUD", "be");
- RegisterHam(Ham_Spawn, "player", "fwHamPlayerSpawnPost", 1);
- set_task(1.0, "Pomoc");
- g_vault = nvault_open("KnifeSystem");
- if(g_vault== INVALID_HANDLE) set_fail_state("Greska pri otvaranju gVaulta");
- SyncHudObj = CreateHudSyncObj();
- g_msgHideWeapon = get_user_msgid("HideWeapon");
- }
- public PromeniNoz(id)
- {
- new menu = menu_create("Izaberite Noz" , "izaberite_noz_handle");
- new MeniNozevi[64]
- for(new i; i<sizeof(imena_nozeva) && i<sizeof(potrebno_ubistava); i++)
- {
- if(ubistva_igraca[id] < potrebno_ubistava[i])
- {
- formatex(MeniNozevi, charsmax(MeniNozevi), "%s \r[Ubistva %i/%i]", imena_nozeva[i], ubistva_igraca[id], potrebno_ubistava[i])
- }
- else
- formatex(MeniNozevi, charsmax(MeniNozevi), "%s \y[Otkljucano]", imena_nozeva[i])
- menu_additem(menu, MeniNozevi)
- }
- menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);
- menu_setprop(menu, MPROP_BACKNAME, "Prethodna stranica");
- menu_setprop(menu, MPROP_NEXTNAME, "Sledeca stranica");
- menu_setprop(menu, MPROP_EXITNAME, "Izlaz");
- menu_display(id, menu);
- return PLUGIN_HANDLED;
- }
- public izaberite_noz_handle(id, menu, item)
- {
- if(item == MENU_EXIT)
- {
- menu_destroy(menu);
- return PLUGIN_HANDLED;
- }
- if(item == model_noza[id])
- {
- ColorChat(id,GREEN,"[Knife Mod] ^1Vec koristis taj noz.");
- return PLUGIN_HANDLED;
- }
- new command[6], name[64], access, callback;
- menu_item_getinfo(menu, item, access, command, sizeof command - 1, name, sizeof name - 1, callback);
- switch(item)
- {
- case 0: PostaviNoz(id , 0), ColorChat(id,GREEN,"[Knife Mod] ^1Promenio si noz, sada koristis default.");
- case 1:
- if(ubistva_igraca[id] < 10)
- ColorChat(id,GREEN,"[Knife Mod] ^1Nemas potreban broj ubistava za ovaj noz.");
- else
- PostaviNoz(id , 1), ColorChat(id,GREEN,"[Knife Mod] ^1Promenio si noz, sada koristis machete.");
- case 2:
- if(ubistva_igraca[id] < 20)
- ColorChat(id,GREEN,"[Knife Mod] ^1Nemas potreban broj ubistava za ovaj noz.");
- else
- PostaviNoz(id, 2), ColorChat(id,GREEN,"[Knife Mod] ^1Promenio si noz, sada koristis back.");
- case 3:
- if(ubistva_igraca[id] < 30)
- ColorChat(id,GREEN,"[Knife Mod] ^1Nemas potreban broj ubistava za ovaj noz.");
- else
- PostaviNoz(id, 3), ColorChat(id,GREEN,"[Knife Mod] ^1Promenio si noz, sada koristis pocket.");
- case 4:
- if(ubistva_igraca[id] < 40)
- ColorChat(id,GREEN,"[Knife Mod] ^1Nemas potreban broj ubistava za ovaj noz.");
- else
- PostaviNoz(id, 4), ColorChat(id,GREEN,"[Knife Mod] ^1Promenio si noz, sada koristis butcher.");
- case 5:
- if(ubistva_igraca[id] < 50)
- ColorChat(id,GREEN,"[Knife Mod] ^1Nemas potreban broj ubistava za ovaj noz.");
- else
- PostaviNoz(id, 5), ColorChat(id,GREEN,"[Knife Mod] ^1Promenio si noz, sada koristis wooden.");
- case 6:
- if(ubistva_igraca[id] < 60)
- ColorChat(id,GREEN,"[Knife Mod] ^1Nemas potreban broj ubistava za ovaj noz.");
- else
- PostaviNoz(id, 6), ColorChat(id,GREEN,"[Knife Mod] ^1Promenio si noz, sada koristis dragon.");
- case 7:
- if(ubistva_igraca[id] < 70)
- ColorChat(id,GREEN,"[Knife Mod] ^1Nemas potreban broj ubistava za ovaj noz.");
- else
- PostaviNoz(id, 7), ColorChat(id,GREEN,"[Knife Mod] ^1Promenio si noz, sada koristis ninja.");
- case 8:
- if(ubistva_igraca[id] < 80)
- ColorChat(id,GREEN,"[Knife Mod] ^1Nemas potreban broj ubistava za ovaj noz.");
- else
- PostaviNoz(id, 8), ColorChat(id,GREEN,"[Knife Mod] ^1Promenio si noz, sada koristis black.");
- case 9:
- if(ubistva_igraca[id] < 90)
- ColorChat(id,GREEN,"[Knife Mod] ^1Nemas potreban broj ubistava za ovaj noz.");
- else
- PostaviNoz(id, 9), ColorChat(id,GREEN,"[Knife Mod] ^1Promenio si noz, sada koristis hitman.");
- case 10:
- if(ubistva_igraca[id] < 100)
- ColorChat(id,GREEN,"[Knife Mod] ^1Nemas potreban broj ubistava za ovaj noz.");
- else
- PostaviNoz(id, 10), ColorChat(id,GREEN,"[Knife Mod] ^1Promenio si noz, sada koristis daedric.");
- case 11:
- if(ubistva_igraca[id] < 150)
- ColorChat(id,GREEN,"[Knife Mod] ^1Nemas potreban broj ubistava za ovaj noz.");
- else
- PostaviNoz(id, 11), ColorChat(id,GREEN,"[Knife Mod] ^1Promenio si noz, sada koristis ice.");
- case 12:
- if(ubistva_igraca[id] < 200)
- ColorChat(id,GREEN,"[Knife Mod] ^1Nemas potreban broj ubistava za ovaj noz.");
- else
- PostaviNoz(id, 12), ColorChat(id,GREEN,"[Knife Mod] ^1Promenio si noz, sada koristis katane.");
- case 13:
- if(ubistva_igraca[id] < 250)
- ColorChat(id,GREEN,"[Knife Mod] ^1Nemas potreban broj ubistava za ovaj noz.");
- else
- PostaviNoz(id, 13), ColorChat(id,GREEN,"[Knife Mod] ^1Promenio si noz, sada koristis rusty.");
- case 14:
- if(ubistva_igraca[id] < 300)
- ColorChat(id,GREEN,"[Knife Mod] ^1Nemas potreban broj ubistava za ovaj noz.");
- else
- PostaviNoz(id, 14), ColorChat(id,GREEN,"[Knife Mod] ^1Promenio si noz, sada koristis crowbar.");
- case 15:
- if(ubistva_igraca[id] < 350)
- ColorChat(id,GREEN,"[Knife Mod] ^1Nemas potreban broj ubistava za ovaj noz.");
- else
- PostaviNoz(id, 15), ColorChat(id,GREEN,"[Knife Mod] ^1Promenio si noz, sada koristis celurit.");
- case 16:
- if(ubistva_igraca[id] < 400)
- ColorChat(id,GREEN,"[Knife Mod] ^1Nemas potreban broj ubistava za ovaj noz.");
- else
- PostaviNoz(id, 16), ColorChat(id,GREEN,"[Knife Mod] ^1Promenio si noz, sada koristis kabar.");
- case 17:
- if(ubistva_igraca[id] < 450)
- ColorChat(id,GREEN,"[Knife Mod] ^1Nemas potreban broj ubistava za ovaj noz.");
- else
- PostaviNoz(id, 17), ColorChat(id,GREEN,"[Knife Mod] ^1Promenio si noz, sada koristis karambit.");
- case 18:
- if(ubistva_igraca[id] < 500)
- ColorChat(id,GREEN,"[Knife Mod] ^1Nemas potreban broj ubistava za ovaj noz.");
- else
- PostaviNoz(id, 18), ColorChat(id,GREEN,"[Knife Mod] ^1Promenio si noz, sada koristis omega.");
- case 19:
- if(ubistva_igraca[id] < 550)
- ColorChat(id,GREEN,"[Knife Mod] ^1Nemas potreban broj ubistava za ovaj noz.");
- else
- PostaviNoz(id, 19), ColorChat(id,GREEN,"[Knife Mod] ^1Promenio si noz, sada koristis metal machete.");
- case 20:
- if(ubistva_igraca[id] < 600)
- ColorChat(id,GREEN,"[Knife Mod] ^1Nemas potreban broj ubistava za ovaj noz.");
- else
- PostaviNoz(id, 20), ColorChat(id,GREEN,"[Knife Mod] ^1Promenio si noz, sada koristis plunger.");
- case 21:
- if(ubistva_igraca[id] < 650)
- ColorChat(id,GREEN,"[Knife Mod] ^1Nemas potreban broj ubistava za ovaj noz.");
- else
- PostaviNoz(id, 21), ColorChat(id,GREEN,"[Knife Mod] ^1Promenio si noz, sada koristis rambo.");
- case 22:
- if(ubistva_igraca[id] < 700)
- ColorChat(id,GREEN,"[Knife Mod] ^1Nemas potreban broj ubistava za ovaj noz.");
- else
- PostaviNoz(id, 22), ColorChat(id,GREEN,"[Knife Mod] ^1Promenio si noz, sada koristis toporiaku.");
- case 23:
- if(ubistva_igraca[id] < 750)
- ColorChat(id,GREEN,"[Knife Mod] ^1Nemas potreban broj ubistava za ovaj noz.");
- else
- PostaviNoz(id, 23), ColorChat(id,GREEN,"[Knife Mod] ^1Promenio si noz, sada koristis candy.");
- case 24:
- if(ubistva_igraca[id] < 800)
- ColorChat(id,GREEN,"[Knife Mod] ^1Nemas potreban broj ubistava za ovaj noz.");
- else
- PostaviNoz(id, 24), ColorChat(id,GREEN,"[Knife Mod] ^1Promenio si noz, sada koristis elite.");
- case 25:
- if(ubistva_igraca[id] < 850)
- ColorChat(id,GREEN,"[Knife Mod] ^1Nemas potreban broj ubistava za ovaj noz.");
- else
- PostaviNoz(id, 25), ColorChat(id,GREEN,"[Knife Mod] ^1Promenio si noz, sada koristis traker.");
- case 26:
- if(ubistva_igraca[id] < 900)
- ColorChat(id,GREEN,"[Knife Mod] ^1Nemas potreban broj ubistava za ovaj noz.");
- else
- PostaviNoz(id, 26), ColorChat(id,GREEN,"[Knife Mod] ^1Promenio si noz, sada koristis bayonet.");
- case 27:
- if(ubistva_igraca[id] < 950)
- ColorChat(id,GREEN,"[Knife Mod] ^1Nemas potreban broj ubistava za ovaj noz.");
- else
- PostaviNoz(id, 27), ColorChat(id,GREEN,"[Knife Mod] ^1Promenio si noz, sada koristis triple.");
- }
- menu_destroy(menu);
- return PLUGIN_HANDLED;
- }
- public PostaviNoz(id , Knife)
- {
- model_noza[id] = Knife
- new Clip, Ammo, Weapon = get_user_weapon(id, Clip, Ammo)
- if(Weapon != CSW_KNIFE)
- return PLUGIN_HANDLED
- new vModel[56]
- new pModel[56]
- switch(Knife)
- {
- case 0: format(vModel,55,"models/v_knife.mdl"),format(pModel,55,"models/p_knife.mdl")
- case 1: format(vModel,55,"models/knife-system/v_machete.mdl"),format(pModel,55,"models/knife-system/p_machete.mdl")
- case 2: format(vModel,55,"models/knife-system/v_back.mdl"),format(pModel,55,"models/knife-system/p_back.mdl")
- case 3: format(vModel,55,"models/knife-system/v_pocket.mdl"),format(pModel,55,"models/knife-system/p_pocket.mdl")
- case 4: format(vModel,55,"models/knife-system/v_butcher.mdl"),format(pModel,55,"models/knife-system/p_butcher.mdl")
- case 5: format(vModel,55,"models/knife-system/v_wooden.mdl"),format(pModel,55,"models/knife-system/p_wooden.mdl")
- case 6: format(vModel,55,"models/knife-system/v_dragon.mdl"),format(pModel,55,"models/knife-system/p_dragon.mdl")
- case 7: format(vModel,55,"models/knife-system/v_ninja.mdl"),format(pModel,55,"models/knife-system/p_ninja.mdl")
- case 8: format(vModel,55,"models/knife-system/v_black.mdl"),format(pModel,55,"models/knife-system/p_black.mdl")
- case 9: format(vModel,55,"models/knife-system/v_hitman.mdl"),format(pModel,55,"models/knife-system/p_hitman.mdl")
- case 10: format(vModel,55,"models/knife-system/v_daedric.mdl"),format(pModel,55,"models/knife-system/p_daedric.mdl")
- case 11: format(vModel,55,"models/knife-system/v_ice.mdl"),format(pModel,55,"models/knife-system/p_ice.mdl")
- case 12: format(vModel,55,"models/knife-system/v_katana.mdl"),format(pModel,55,"models/knife-system/p_katana.mdl")
- case 13: format(vModel,55,"models/knife-system/v_rusty.mdl"),format(pModel,55,"models/knife-system/p_rusty.mdl")
- case 14: format(vModel,55,"models/knife-system/v_crowbar.mdl"),format(pModel,55,"models/knife-system/p_crowbar.mdl")
- case 15: format(vModel,55,"models/knife-system/v_celurit.mdl"),format(pModel,55,"models/knife-system/p_celurit.mdl")
- case 16: format(vModel,55,"models/knife-system/v_kabar.mdl"),format(pModel,55,"models/knife-system/p_kabar.mdl")
- case 17: format(vModel,55,"models/knife-system/v_karambit.mdl"),format(pModel,55,"models/knife-system/p_karambit.mdl")
- case 18: format(vModel,55,"models/knife-system/v_domega.mdl"),format(pModel,55,"models/knife-system/p_domega.mdl")
- case 19: format(vModel,55,"models/knife-system/v_mmachete.mdl"),format(pModel,55,"models/knife-system/p_mmachete.mdl")
- case 20: format(vModel,55,"models/knife-system/v_plunger.mdl"),format(pModel,55,"models/knife-system/p_plunger.mdl")
- case 21: format(vModel,55,"models/knife-system/v_rambo.mdl"),format(pModel,55,"models/knife-system/p_rambo.mdl")
- case 22: format(vModel,55,"models/knife-system/v_toporiaka.mdl"),format(pModel,55,"models/knife-system/p_toporiaka.mdl")
- case 23: format(vModel,55,"models/knife-system/v_candy.mdl"),format(pModel,55,"models/knife-system/p_candy.mdl")
- case 24: format(vModel,55,"models/knife-system/v_elite.mdl"),format(pModel,55,"models/knife-system/p_elite.mdl")
- case 25: format(vModel,55,"models/knife-system/v_traker.mdl"),format(pModel,55,"models/knife-system/p_traker.mdl")
- case 26: format(vModel,55,"models/knife-system/v_bayonet.mdl"),format(pModel,55,"models/knife-system/p_bayonet.mdl")
- case 27: format(vModel,55,"models/knife-system/v_kunai.mdl"),format(pModel,55,"models/knife-system/p_kunai.mdl")
- }
- entity_set_string(id, EV_SZ_viewmodel, vModel)
- entity_set_string(id, EV_SZ_weaponmodel, pModel)
- return PLUGIN_CONTINUE;
- }
- public CurWeapon(id)
- {
- PostaviNoz(id, model_noza[id])
- return PLUGIN_HANDLED
- }
- public Pomoc()
- {
- switch(random(4))
- {
- case 0: ColorChat(0, NORMAL, "^4[Knife Mod] ^1Da promenis noz kucaj /noz ili /knife.");
- case 1: ColorChat(0, NORMAL, "^4[Knife Mod] ^1Za uzimanje svakog noza potreban je odredjen broj ubistava.");
- case 2: ColorChat(0, NORMAL, "^4[Knife Mod] ^1Da bi otkljucao sve nozeve potrebno je da ubijes 950 ljudi.");
- case 3: ColorChat(0, NORMAL, "^4[Knife Mod] ^1Da restartujes svoja ubistva kucaj /reset.");
- }
- set_task(16.0, "Pomoc");
- }
- public pokazi_podatke(id)
- {
- id -= HUD
- if(model_noza[id] == 0) noz[id] = "Default";
- if(model_noza[id] == 1) noz[id] = "Machete";
- if(model_noza[id] == 2) noz[id] = "Back";
- if(model_noza[id] == 3) noz[id] = "Pocket";
- if(model_noza[id] == 4) noz[id] = "Butcher";
- if(model_noza[id] == 5) noz[id] = "Wooden";
- if(model_noza[id] == 6) noz[id] = "Dragon";
- if(model_noza[id] == 7) noz[id] = "Ninja";
- if(model_noza[id] == 8) noz[id] = "Black";
- if(model_noza[id] == 9) noz[id] = "Hitman";
- if(model_noza[id] == 10) noz[id] = "Daedric";
- if(model_noza[id] == 11) noz[id] = "Ice";
- if(model_noza[id] == 12) noz[id] = "Katana";
- if(model_noza[id] == 13) noz[id] = "Rusty";
- if(model_noza[id] == 14) noz[id] = "Crowbar";
- if(model_noza[id] == 15) noz[id] = "Celurit";
- if(model_noza[id] == 16) noz[id] = "Kabar";
- if(model_noza[id] == 17) noz[id] = "Karambit";
- if(model_noza[id] == 18) noz[id] = "Omega";
- if(model_noza[id] == 19) noz[id] = "Metal Machete";
- if(model_noza[id] == 20) noz[id] = "Plunger";
- if(model_noza[id] == 21) noz[id] = "Rambo";
- if(model_noza[id] == 22) noz[id] = "Toporiaka";
- if(model_noza[id] == 23) noz[id] = "Candy";
- if(model_noza[id] == 24) noz[id] = "Elite";
- if(model_noza[id] == 25) noz[id] = "Traker";
- if(model_noza[id] == 26) noz[id] = "Bayonet";
- if(model_noza[id] == 27) noz[id] = "Triple";
- if(ubistva_igraca[id] < 10) osvojeno_nozeva[id] = 1;
- if(ubistva_igraca[id] >= 10) osvojeno_nozeva[id] = 2;
- if(ubistva_igraca[id] >= 20) osvojeno_nozeva[id] = 3;
- if(ubistva_igraca[id] >= 30) osvojeno_nozeva[id] = 4;
- if(ubistva_igraca[id] >= 40) osvojeno_nozeva[id] = 5;
- if(ubistva_igraca[id] >= 50) osvojeno_nozeva[id] = 6;
- if(ubistva_igraca[id] >= 60) osvojeno_nozeva[id] = 7;
- if(ubistva_igraca[id] >= 70) osvojeno_nozeva[id] = 8;
- if(ubistva_igraca[id] >= 80) osvojeno_nozeva[id] = 9;
- if(ubistva_igraca[id] >= 90) osvojeno_nozeva[id] = 10;
- if(ubistva_igraca[id] >= 100) osvojeno_nozeva[id] = 11;
- if(ubistva_igraca[id] >= 150) osvojeno_nozeva[id] = 12;
- if(ubistva_igraca[id] >= 200) osvojeno_nozeva[id] = 13;
- if(ubistva_igraca[id] >= 250) osvojeno_nozeva[id] = 14;
- if(ubistva_igraca[id] >= 300) osvojeno_nozeva[id] = 15;
- if(ubistva_igraca[id] >= 350) osvojeno_nozeva[id] = 16;
- if(ubistva_igraca[id] >= 400) osvojeno_nozeva[id] = 17;
- if(ubistva_igraca[id] >= 450) osvojeno_nozeva[id] = 18;
- if(ubistva_igraca[id] >= 500) osvojeno_nozeva[id] = 19;
- if(ubistva_igraca[id] >= 550) osvojeno_nozeva[id] = 20;
- if(ubistva_igraca[id] >= 600) osvojeno_nozeva[id] = 21;
- if(ubistva_igraca[id] >= 650) osvojeno_nozeva[id] = 22;
- if(ubistva_igraca[id] >= 700) osvojeno_nozeva[id] = 23;
- if(ubistva_igraca[id] >= 750) osvojeno_nozeva[id] = 24;
- if(ubistva_igraca[id] >= 800) osvojeno_nozeva[id] = 25;
- if(ubistva_igraca[id] >= 850) osvojeno_nozeva[id] = 26;
- if(ubistva_igraca[id] >= 900) osvojeno_nozeva[id] = 27;
- if(ubistva_igraca[id] >= 950) osvojeno_nozeva[id] = 28;
- set_task(0.2, "pokazi_podatke", id+HUD);
- energija_igraca[id] = get_user_health(id);
- if(energija_igraca[id] < 0)
- {
- energija_igraca[id] = 0;
- }
- if(!is_user_alive(id))
- {
- new target = entity_get_int(id, EV_INT_iuser2);
- if(target == 0)
- return PLUGIN_CONTINUE;
- set_hudmessage(0, 127, 255, 0.02, 0.22, 0, 0.0, 0.21, 0.0, 0.0, 2);
- ShowSyncHudMsg(id, SyncHudObj, "[Trenutni noz: %s]^n[Ubistva : %i]^n[Otkljucano nozeva : %i]^n[Energija : %i]", noz[target], ubistva_igraca[target], osvojeno_nozeva[target], energija_igraca[target]);
- return PLUGIN_CONTINUE;
- }
- else if(cs_get_user_team(id) == CS_TEAM_SPECTATOR)
- {
- new target = entity_get_int(id, EV_INT_iuser2);
- if(target == 0)
- return PLUGIN_CONTINUE;
- set_hudmessage(0, 127, 255, 0.02, 0.22, 0, 0.0, 0.21, 0.0, 0.0, 2);
- ShowSyncHudMsg(id, SyncHudObj, "[Trenutni noz: %s]^n[Ubistva : %i]^n[Otkljucano nozeva : %i]^n[Energija : %i]", noz[target], ubistva_igraca[target], osvojeno_nozeva[target], energija_igraca[target]);
- return PLUGIN_CONTINUE;
- }
- else
- {
- set_hudmessage(0, 127, 255, 0.02, 0.02, 0, 0.0, 0.21, 0.0, 0.0, 2);
- ShowSyncHudMsg(id, SyncHudObj, "[Trenutni noz: %s]^n[Ubistva : %i]^n[Otkljucano nozeva : %i]^n[Energija : %i]", noz[id], ubistva_igraca[id], osvojeno_nozeva[id], energija_igraca[id]);
- }
- return PLUGIN_CONTINUE;
- }
- public client_putinserver(id)
- {
- LoadData(id)
- set_task(3.0, "pokazi_podatke", id+HUD);
- }
- public client_disconnect(id)
- {
- SaveData(id)
- }
- public client_death(killer,victim)
- {
- if(killer != victim)
- {
- ubistva_igraca[killer] ++;
- }
- SaveData(killer)
- return PLUGIN_CONTINUE;
- }
- public SaveData(id)
- {
- new AuthID[35]
- get_user_authid(id,AuthID,34)
- new vaultkey[64],vaultdata[256]
- format(vaultkey,63,"%s-Knife",AuthID)
- format(vaultdata,255,"%i",ubistva_igraca[id])
- nvault_set(g_vault,vaultkey,vaultdata)
- return PLUGIN_CONTINUE
- }
- public LoadData(id)
- {
- new AuthID[35]
- get_user_authid(id,AuthID,34)
- new vaultkey[64],vaultdata[256]
- format(vaultkey,63,"%s-Knife",AuthID)
- format(vaultdata,255,"%i",ubistva_igraca[id])
- nvault_get(g_vault,vaultkey,vaultdata,255)
- replace_all(vaultdata, 255, "#", " ")
- new ubistva[32]
- parse(vaultdata, ubistva, 31)
- ubistva_igraca[id] = str_to_num(ubistva)
- return PLUGIN_CONTINUE
- }
- public plugin_end()
- {
- nvault_close(g_vault)
- }
- public eResetHUD(id)
- {
- if(!is_user_bot(id)) {
- message_begin(MSG_ONE_UNRELIABLE, g_msgHideWeapon, _, id);
- write_byte((1 << 3));
- message_end();
- }
- }
- public fwHamPlayerSpawnPost(iPlayer)
- {
- /*
- TREBAO JE BITI KOD OVDE ALI SAM PRONAŠAO DRUGI NAČIN
- */
- }
- public RestartUbistava(id)
- {
- new flags = get_user_flags(id)
- if(flags & ADMIN_RCON)
- {
- ColorChat(0, NORMAL, "^4[Knife Mod] ^1Restart svih ubistava će se izvršiti za 10 sekundi.");
- set_task(10.0, "RestartujUbistva");
- }
- else
- {
- return PLUGIN_HANDLED
- }
- return PLUGIN_CONTINUE
- }
- public RestartujUbistva()
- {
- new iPlayer[32], iNum
- get_players(iPlayer, iNum)
- for(new i; i < iNum; i++)
- {
- ubistva_igraca[iPlayer[i]] = 0;
- }
- nvault_prune(g_vault, 0, get_systime() + 1)
- server_cmd("changelevel de_dust2");
- return PLUGIN_CONTINUE
- }
- public Resetovanje(id)
- {
- ubistva_igraca[id] = 0;
- PostaviNoz(id, 0)
- ColorChat(0, NORMAL, "^4[Knife Mod] ^1Restartovao si svoja ubistva, sada su vracena na 0.");
- SaveData(id);
- return PLUGIN_HANDLED;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement