Peršokti į turinį
SwaQeN

Kodel neveikia?

Recommended Posts

Gal galit pasakyt delko compilinant meta error?

#include 
#include 
#include 
#include 
#include 
#include 

#define VIP_LEVEL ADMIN_LEVEL_H

new const PREFIX[] = { "!g[VIP]!n" };

new VipUsed[33];

public plugin_init()
{
  register_plugin("VIP Menu", "1.0.0", "Nezinomas");

  RegisterHam(Ham_Spawn, "player", "OnSpawn");

  register_clcmd("say /vipmenu", "cmdVmenu");
}

public OnSpawn(id)
{
  VipUsed[id] = false;
  set_user_rendering( id, _, 0, 0, 0, _, 0 );  
}

public cmdVmenu(id)
{
  if(!(get_user_flags(id) & VIP_LEVEL))
  {
     client_printc(id, "%s Tu nesi vip narys.", PREFIX);
     return PLUGIN_HANDLED;
  }

  if(!VipUsed[id])
  {
     switch(cs_get_user_team(id))
     {
        case 'CS_TEAM_CT': VipCTMenu(id);
        case 'CS_TEAM_T': VipTMenu(id);
     }
  }
  else if (VipUsed[id])
  {
     client_printc(id, "%s Palaukite kito round'o.", PREFIX);
  }
  return PLUGIN_HANDLED;
}

public VipCTMenu(id)
{
  new menu = menu_create("\rV\wIP \rM\wenu:", "VipCTMenu_handler");

  menu_additem(menu, "\wScout be kulku", "1", 0);
  menu_additem(menu, "\wRespawn (Jeigu esi mires)", "2", 0);
  menu_additem(menu, "\w+75HP", "3", 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;
  }

  switch(item)
  {
     case 0:
     {
        give_item(id, "weapon_scout");
        cs_set_user_bpammo(id, CSW_SCOUT, 0);
        cs_set_weapon_ammo(find_ent_by_owner(1, "weapon_scout", id), 0);
        VipUsed[id] = true;
     }
     case 1:
     {
        ExecuteHamB(Ham_CS_RoundRespawn, id);
        VipUsed[id] = true;
     }
     case 2:
     {
        set_user_health(id, get_user_health(id) + 75);
        VipUsed[id] = true;
     }
  }

  menu_destroy(menu);
  return PLUGIN_HANDLED;
}

public VipTMenu(id)
{
  new menu = menu_create("\rV\wIP \rM\wenu:", "VipTMenu_handler");

  menu_additem(menu, "\wRespawn (Jeigu esi mires)", "1", 0);
  menu_additem(menu, "\wGlock su 1 kulka", "2", 0);
  menu_additem(menu, "\wNematomumas 50%", "3", 0);
  menu_additem(menu, "\w+100HP", "4", 0);
  menu_additem(menu, "\wScout be kulku", "5", 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;
  }

  switch(item)
  {
     case 0:
     {
        ExecuteHamB(Ham_CS_RoundRespawn, id);
        VipUsed[id] = true;
     }
     case 1:
     {
        give_item(id, "weapon_glock18");
        cs_set_user_bpammo(id, CSW_GLOCK18, 0);
        cs_set_weapon_ammo(find_ent_by_owner(1, "weapon_glock18", id), 1);
        VipUsed[id] = true;
     }      
     case 2:
     {
        set_user_rendering(id, kRenderFxGlowShell, 0, 0, 0, kRenderTransAlpha, 50);
        VipUsed[id] = true;             
     }  
     case 3: 
     { 
        set_user_health(id, get_user_health(id) + 100);
        VipUsed[id] = true;
     }
     case 4: 
     { 
        give_item(id, "weapon_scout");
        cs_set_user_bpammo(id, CSW_SCOUT, 0);
        cs_set_weapon_ammo(find_ent_by_owner(1, "weapon_scout", id), 0);
        VipUsed[id] = true;
     }
  }

  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[i]))
           {
               message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i]);
               write_byte(players[i]);
               write_string(msg);
               message_end();
           }
       }
   }
}

Dalintis šį pranešimą


Nuoroda iki šio pranešimo
Dalintis per kitą puslapį

Komentuoti gali tik prisijungę nariai

Jeigu turite paskyrą, prisijunkite

Sukurti paskyrą

Sukurkite paskyrą mūsų forume

Registruotis

Prisijungti

Turite paskyrą? Prisijunkite

Prisijungti dabar

  • Narių peržiūri šį forumą:   0 nariai

    Nėra registruotų narių peržiūrinčių šį forumą.


  • SuperGames programele
  • SuperGames programele


×