Problema vmenu

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

Moderators: Moderatori ajutatori, Moderatori

Post Reply
X-D3$[T]Ro!
Membru, skill 0
Membru, skill 0
Posts: 22
Joined: 13 Aug 2018, 19:19
Detinator Steam: Da
CS Status: Citesc forumul eXtreamCS.com...!
Detinator server CS: NU
Fond eXtream: 0
Contact:

03 Oct 2018, 19:50

dupa cum Spune si titlul am o problema cu Vip-meniul gen: Scot M249 +Degale si adaug acesta arma https://drive.google.com/file/d/0B-pMKT ... pTbUU/view si cand dau sa o iau imi da dor modelul la arma si tot Trage cu arma Respectiva daca Va pricepeti Ajutatima va rog mult !!
| Afiseaza codul
[code]#pragma semicolon 1 
#include <amxmodx> 
#include <cstrike> 
#include <engine> 
#include <fun> 
#include <hamsandwich> 

#define ADMIN_JBVIP ADMIN_LEVEL_H

// Define the Plugin Version 
new const VERSION[] = { "1.0" }; 

// PREFIX 
new const PREFIX[] = { "!g[ Base Builder ]!n" }; 

new VipUsed[33]; 
new HasSpeed[33]; 

new Float:fast_speed = 400.0; 
new Float:normal_speed = 250.0; 

public plugin_init() 
{ 
   register_plugin("BaseBuilder: VIP Menu", VERSION, ""); 

   RegisterHam(Ham_Spawn, "player", "FwdHamSpawn_Post", 1); 
   RegisterHam(Ham_Item_PreFrame, "player", "FwdPreFrame_Post", 1); 
    
   register_clcmd("say vmenu", "cmdVmenu"); 
   register_clcmd("say /vmenu", "cmdVmenu"); 
   register_clcmd("say_team vmenu", "cmdVmenu"); 
   register_clcmd("say_team /vmenu", "cmdVmenu"); 
} 

public FwdPreFrame_Post(id) 
{ 
   if(is_user_alive(id) && HasSpeed[id]) 
      set_user_maxspeed(id, fast_speed); 
} 

public FwdHamSpawn_Post(id) 
{ 
   HasSpeed[id] = false; 
   VipUsed[id] = false; 
   set_user_maxspeed(id, normal_speed); 
   set_user_rendering( id, _, 0, 0, 0, _, 0 );  
} 

public cmdVmenu(id) 
{ 
   if(!(get_user_flags(id) & ADMIN_JBVIP)) 
   { 
      client_printc(id, "%s Menu apenas para !gVIP !n,Queres ser vip?, Escreve !g/vip !npara comprares.", PREFIX); 
       
      return PLUGIN_HANDLED; 
   } 
    
   if(VipUsed[id]) 
   { 
      client_printc(id, "%s Tu ja usaste !gVIP Menu!n nesta ronda. Por favor, Espera ate proxima ronda", PREFIX); 
       
      return PLUGIN_HANDLED; 
   } 
    
   switch(cs_get_user_team(id)) 
   { 
      case CS_TEAM_T: 
         VipTMenu(id); 
       
      case CS_TEAM_CT: 
         VipCTMenu(id); 
   } 
    
   return PLUGIN_HANDLED; 
} 

public VipCTMenu(id) 
{ 
   new menu = menu_create("\yVIP Menu \r(CT):^n", "VipCTMenu_handler"); 

   menu_additem(menu, "\w150 Hp + 100 Colete", "1", 0); 
   menu_additem(menu, "\wM249 + Deagle", "2", 0); 
   menu_additem(menu, "\wSpeed", "3", 0); 
   menu_additem(menu, "\wRevive", "4", 0); 
   menu_additem(menu, "\wG3SG1", "5", 0); 
    
   menu_setprop(menu, MPROP_EXIT, MEXIT_ALL); 
   menu_display(id, menu, 0); 
} 

public VipCTMenu_handler(id, menu, item) 
{ 
   if( item == MENU_EXIT ) 
   { 
      menu_destroy(menu); 
      return PLUGIN_HANDLED; 
   } 

   new data[6], iName[64]; 
   new access, callback; 
   menu_item_getinfo(menu, item, access, data,5, iName, 63, callback); 

   new key = str_to_num(data); 

   switch(key) 
   { 
      case 1: 
      { 
         set_user_health(id, get_user_health(id) + 150); 
         set_user_armor(id, get_user_armor(id) + 100); 
         VipUsed[id] = true; 
          
         client_printc(id, "%s Tu recebeste !g150 Hp!n + !g100 Colete!n", PREFIX); 
      } 
      case 2: 
      { 
            give_item(id, "weapon_m249"); 
            give_item(id, "weapon_deagle"); 
            cs_set_user_bpammo(id, CSW_M249, 200); 
            cs_set_user_bpammo(id, CSW_DEAGLE, 100); 
          
         VipUsed[id] = true; 
          
         client_printc(id, "%s Tu recebeste !gM249!n + !gDeagle!n", PREFIX); 
      } 
      case 3: 
      { 
         VipUsed[id] = true; 
         HasSpeed[id] = true; 
          
         set_user_maxspeed(id, fast_speed); 
          
         client_printc(id, "%s Tu recebeste !gSpeed!n", PREFIX); 
   } 
          
        case 4: 
        { 
                
            ExecuteHamB(Ham_CS_RoundRespawn, id); 
  
            VipUsed[id] = true; 

            client_printc(id, "%s Tu recebeste !gRevive", PREFIX); 
        } 
            
              case 5: 
        { 
            give_item(id, "weapon_g3sg1"); 
            cs_set_user_bpammo(id, CSW_G3SG1, 200); 

            VipUsed[id] = true; 

            client_printc(id, "%s Tu recebeste !gG3sg1", PREFIX); 
      } 
   } 

   menu_destroy(menu); 
   return PLUGIN_HANDLED; 
} 

public VipTMenu(id) 
{ 
   new menu = menu_create("\yVIP Menu \r(TR):^n", "VipTMenu_handler"); 

   menu_additem(menu, "\w5000 Hp + 5000 Colete", "1", 0); 
   menu_additem(menu, "\wSpeed", "2", 0); 
    
   menu_setprop(menu, MPROP_EXIT, MEXIT_ALL); 
   menu_display(id, menu, 0); 
} 

public VipTMenu_handler(id, menu, item) 
{ 
   if( item == MENU_EXIT ) 
   { 
      menu_destroy(menu); 
      return PLUGIN_HANDLED; 
   } 

   new data[6], iName[64]; 
   new access, callback; 
   menu_item_getinfo(menu, item, access, data,5, iName, 63, callback); 

   new key = str_to_num(data); 

   switch(key) 
   { 
      case 1: 
      { 
            set_user_health(id, get_user_health(id) + 5000); 
                                         set_user_armor(id, get_user_armor(id) + 5000); 
                                         VipUsed[id] = true; 

          
         client_printc(id, "%s Tu recebeste !g5000 HP + !g5000 Colete!n", PREFIX); 
          
         VipUsed[id] = true; 
      } 
      case 2: 
      { 
         VipUsed[id] = true; 
         HasSpeed[id] = true; 
          
         set_user_maxspeed(id, fast_speed); 
          
         client_printc(id, "%s Tu recebeste !gSpeed!n", PREFIX); 
      } 
       
      case 3: 
      { 
         set_user_health(id, get_user_health(id) + 50); 
         set_user_armor(id, get_user_armor(id) + 150); 
         VipUsed[id] = true; 
          
         client_printc(id, "%s Tu recebeste !g50 Hp!n + !g150 Colete!n", PREFIX); 
      } 
   } 

   menu_destroy(menu); 
   return PLUGIN_HANDLED; 
} 

// Colour Chat 
stock client_printc(const id, const input[], any:...) 
{ 
    new count = 1, players[32]; 
    static msg[191]; 
    vformat(msg, 190, input, 3); 
    
    replace_all(msg, 190, "!g", "^x04"); // Green Color 
    replace_all(msg, 190, "!n", "^x01"); // Default Color 
    replace_all(msg, 190, "!t", "^x03"); // Team Color 
    
    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(); 
            } 
        } 
    } 
}[/code]
Last edited by VLD00 on 03 Oct 2018, 20:13, edited 1 time in total.
Reason: Data viitoare adauga "sursa"
Post Reply

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

  • Information