Mine sisusse
Otsi siit
  • Rohkem valikuid...
Otsi tulemusi mis sisaldab...
Otsi tulemusi...
  • 0
Jälgi teemat sisse logides  

Surfi Vipmenüü

Küsimus

Probleem selles, et kätte jääb mitu relva. Kuidas saaksin teha nii, et kätte jääb üks relv ning teise dropib.

 

#include #include 
#include 
#include 


#define ADMIN_VIP    ADMIN_LEVEL_H


new g_iMenuId


public plugin_init()
{
   register_plugin("surfvip", "1.0", "test");

   RegisterHam(Ham_Spawn, "player", "FwdPlayerSpawnPost", 1);

   g_iMenuId = menu_create("\yVali relv:", "HandleMenu");
   menu_additem(g_iMenuId, "M3 + Deagle + He + Armor", "1");
   menu_additem(g_iMenuId, "M4a1 + Deagle + He + Armor", "2");
   menu_additem(g_iMenuId, "Ak47 + Deagle + He + Armor", "3");
}


public FwdPlayerSpawnPost(id)
{
   if(is_user_alive(id) && get_user_flags(id) & ADMIN_VIP || get_user_flags(id) & ADMIN_KICK)
       menu_display(id, g_iMenuId);
}


public HandleMenu(id, iMenuId, iItem)
{
   if(iItem == MENU_EXIT || !is_user_alive(id))
       return PLUGIN_HANDLED;

   switch(iItem)
   {
       case 0: 
       {
           give_item(id, "weapon_m3");
           give_item(id, "weapon_deagle");
           give_item(id, "weapon_hegrenade");
           set_user_armor(id, 100);
           cs_set_user_bpammo(id, CSW_DEAGLE, 35);
           cs_set_user_bpammo(id, CSW_M3, 32);
       }

       case 1:
       {
           give_item(id, "weapon_m4a1");
           give_item(id, "weapon_deagle");
           give_item(id, "weapon_hegrenade");
           set_user_armor(id, 100);
           cs_set_user_bpammo(id, CSW_DEAGLE, 35);
           cs_set_user_bpammo(id, CSW_M4A1, 90);
       }

       case 2:
       {
           give_item(id, "weapon_ak47");
           give_item(id, "weapon_deagle");
           give_item(id, "weapon_hegrenade");
           set_user_armor(id, 100);
           cs_set_user_bpammo(id, CSW_DEAGLE, 35);
           cs_set_user_bpammo(id, CSW_M4A1, 90);
           cs_set_user_bpammo(id, CSW_AK47, 90);
       }
   }

   give_item(id, "weapon_hegrenade");
   cs_set_user_armor(id, 100, CS_ARMOR_VESTHELM);

   return PLUGIN_HANDLED;
}  

 

Miski pärast tuli kaks samasugust postitust, Vabandust. Palun kustutage üks ära.

Jaga seda postitust


Postituse link
Share on other sites

Soovitatud postitused

  • 0
VIP

Pole proovinud, kuid peaks töötama.

#include 
#include 
#include 
#include 

#define ADMIN_VIP    ADMIN_LEVEL_H

new const PrimaryWeapons[][] = {    "weapon_shield",    "weapon_scout",    "weapon_xm1014",    "weapon_mac10",    "weapon_aug",    "weapon_ump45",    "weapon_sg550",    "weapon_galil",    "weapon_famas",    "weapon_awp",    "weapon_mp5navy",    "weapon_m249",    "weapon_m3",    "weapon_m4a1",    "weapon_tmp",    "weapon_g3sg1",    "weapon_sg552",    "weapon_ak47",    "weapon_p90"}

new const SecondaryWeapons[][] = {    "weapon_p228",    "weapon_elite",    "weapon_fiveseven",    "weapon_usp",    "weapon_glock18",    "weapon_deagle"}
new g_iMenuId


public plugin_init()
{
   register_plugin("surfvip", "1.0", "test");

   RegisterHam(Ham_Spawn, "player", "FwdPlayerSpawnPost", 1);

   g_iMenuId = menu_create("\yVali relv:", "HandleMenu");
   menu_additem(g_iMenuId, "M3 + Deagle + He + Armor", "1");
   menu_additem(g_iMenuId, "M4a1 + Deagle + He + Armor", "2");
   menu_additem(g_iMenuId, "Ak47 + Deagle + He + Armor", "3");
}


public FwdPlayerSpawnPost(id)
{
   if(is_user_alive(id) && get_user_flags(id) & ADMIN_VIP || get_user_flags(id) & ADMIN_KICK)
       menu_display(id, g_iMenuId);
}


public HandleMenu(id, iMenuId, iItem)
{
   if(iItem == MENU_EXIT || !is_user_alive(id))
       return PLUGIN_HANDLED;

   for(new i = 0; i          client_cmd(id, "drop", PrimaryWeapons[i])
   }

   for(new j = 0; j          client_cmd(id, "drop", SecondaryWeapons[j])
   }

   switch(iItem)
   {
       case 0: 
       {
           give_item(id, "weapon_m3");
           give_item(id, "weapon_deagle");
           give_item(id, "weapon_hegrenade");
           set_user_armor(id, 100);
           cs_set_user_bpammo(id, CSW_DEAGLE, 35);
           cs_set_user_bpammo(id, CSW_M3, 32);
       }

       case 1:
       {
           give_item(id, "weapon_m4a1");
           give_item(id, "weapon_deagle");
           give_item(id, "weapon_hegrenade");
           set_user_armor(id, 100);
           cs_set_user_bpammo(id, CSW_DEAGLE, 35);
           cs_set_user_bpammo(id, CSW_M4A1, 90);
       }

       case 2:
       {
           give_item(id, "weapon_ak47");
           give_item(id, "weapon_deagle");
           give_item(id, "weapon_hegrenade");
           set_user_armor(id, 100);
           cs_set_user_bpammo(id, CSW_DEAGLE, 35);
           cs_set_user_bpammo(id, CSW_M4A1, 90);
           cs_set_user_bpammo(id, CSW_AK47, 90);
       }
   }

   give_item(id, "weapon_hegrenade");
   cs_set_user_armor(id, 100, CS_ARMOR_VESTHELM);

   return PLUGIN_HANDLED;
}


Live

Work

Create

Jaga seda postitust


Postituse link
Share on other sites

Kommentaari lisamiseks loo konto või logi sisse

Kommenteerimiseks peate olema liige

Loo konto

Liituge meie kommuuni uue kontoga. See on lihtne!

Loo uus konto

Logi sisse

On juba konto? Logi sisse siit.

Logi sisse nüüd
Jälgi teemat sisse logides  

×
×
  • Loo uus...

Oluline informatsioon

Selle veebisaidi paremaks muutmiseks oleme teie seadmesse paigutanud küpsised . Võite kohandada oma küpsiste seadeid , vastasel juhul eeldame, et te olete küpsiste kasutamisega nõus kui jätkate veebisaidil sirvimist.. Palun lugege läbi Kasutustingimused ja Privaatsuspoliitika.