Skins Menu (Disable for VIP)

Coding Help/Re-API Supported
Post Reply
User avatar
Spir0x
Veteran Member
Veteran Member
Tunisia
Posts: 620
Joined: 2 Years Ago
Location: Tunisia
Has thanked: 14 times
Been thanked: 7 times
Age: 19
Contact:

Skins Menu (Disable for VIP)

#1

Post by Spir0x » 7 Months Ago

Hi, i wanna change my skins menu to only normal players and disable it for VIP's who have flag "A" cuz they have their own skin.
I just wanna turn this plugin for normal players and disable it for vips. with flag "A"

Code:

Code: Select all

#include <zombie_escape>
 
 
new g_pCvarUseTimes
new g_iUsedTimes[33]
new bool:g_bHaloO[33], bool:g_bHaloW[33], bool:g_bHaloB[33], bool:g_bHaloR[33]
 
public plugin_natives()
{
    register_native("ze_open_skin_menu", "native_ze_open_skin_menu", 1)
}
 
public plugin_init()
{
    register_plugin("[ZE] Skins", "1.1", "Spi")
    g_pCvarUseTimes = register_cvar("ze_skin_menu_used", "1")
}
public plugin_precache()
{
        precache_model("models/player/Halo_O/Halo_O.mdl")
        precache_model("models/player/Halo_W/Halo_W.mdl")
        precache_model("models/player/Halo_B/Halo_B.mdl")
        precache_model("models/player/Halo_R/Halo_R.mdl")
}
 
public ze_user_humanized(id)
{
  g_iUsedTimes[id] = 0
 
  if (g_bHaloO[id])
  {
      rg_set_user_model(id, "Halo_O")
  }
  else if (g_bHaloW[id])
  {
      rg_set_user_model(id, "Halo_W")
  }
  else if (g_bHaloB[id])
  {
      rg_set_user_model(id, "Halo_B")
  }
  else if (g_bHaloR[id])
  {
      rg_set_user_model(id, "Halo_R")
  }
}
 
public model_menu(id)
{
    if (ze_is_user_zombie(id))
    {
        ze_colored_print(id, "!tYou can't change your skin while you are zombie!y.")
        return PLUGIN_HANDLED
    }
    if (g_iUsedTimes[id] >= get_pcvar_num(g_pCvarUseTimes))
    {
        ze_colored_print(id, "!tYou have already changed your !gskin!y!")
        return PLUGIN_HANDLED
    }
    else
    {
        new menu = menu_create("\r[\wSkins Menu\r]\r", "menu_wybierz")
   
        menu_additem(menu, "\wHalo \y| \rOrange", "1", 0)
        menu_additem(menu, "\wHalo \y| \rWhite", "2", 0)
        menu_additem(menu, "\wHalo \y| \rBlue", "3", 0)
        menu_additem(menu, "\wHalo \y| \rRed", "4", 0)
 
   
        menu_setprop(menu, MPROP_EXIT, MEXIT_ALL)
        menu_display(id, menu, 0)
    }
    return PLUGIN_HANDLED
}
public menu_wybierz(id, menu, item)
{
    if (item == MENU_EXIT)
    {
        menu_destroy(menu)
        return PLUGIN_HANDLED
    }
    new data[20], iName[500]
    new acces, callback
    menu_item_getinfo(menu, item, acces, data,20, iName, 500, callback)
   
    new key = str_to_num(data)
   
    switch(key)
    {
       case 1 : {
        rg_set_user_model(id, "Halo_O")
        ze_colored_print(id, "!tYou picked the !gOrange Halo Skin!y!", id)
        g_iUsedTimes[id]++
        g_bHaloO[id] = true
        g_bHaloW[id] = false
        g_bHaloB[id] = false
        g_bHaloR[id] = false
        }
       case 2 : {
        rg_set_user_model(id, "Halo_W")
        ze_colored_print(id, "!tYou picked the !gWhite Halo Skin!y!", id)
        g_iUsedTimes[id]++
        g_bHaloO[id] = false
        g_bHaloW[id] = true
        g_bHaloB[id] = false
        g_bHaloR[id] = false
        }
       case 3 : {
        rg_set_user_model(id, "Halo_B")
        ze_colored_print(id, "!tYou picked the !gBlue Halo Skin!y!", id)
        g_iUsedTimes[id]++
        g_bHaloO[id] = false
        g_bHaloW[id] = false
        g_bHaloB[id] = true
        g_bHaloR[id] = false
        }
       case 4 : {
        rg_set_user_model(id, "Halo_R")
        ze_colored_print(id, "!tYou picked the !gRed Halo Skin!y!", id)
        g_iUsedTimes[id]++
        g_bHaloO[id] = false
        g_bHaloW[id] = false
        g_bHaloB[id] = false
        g_bHaloR[id] = true
        }
    }
    menu_destroy(menu)
    return PLUGIN_HANDLED
}  
public native_ze_open_skin_menu(id)
{
    model_menu(id)
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1036\\ f0\\ fs16 \n\\ par }
*/
I trynna make money, not friends.

User avatar
Jack GamePlay
Mod Developer
Mod Developer
Egypt
Posts: 576
Joined: 2 Years Ago
Location: Egypt
Has thanked: 34 times
Been thanked: 47 times
Age: 19
Contact:

#2

Post by Jack GamePlay » 7 Months Ago

Code: Select all

#include <zombie_escape>
#include <ze_vip>
 
new g_pCvarUseTimes
new g_iUsedTimes[33]
new bool:g_bHaloO[33], bool:g_bHaloW[33], bool:g_bHaloB[33], bool:g_bHaloR[33]
 
public plugin_natives()
{
    register_native("ze_open_skin_menu", "native_ze_open_skin_menu", 1)
}
 
public plugin_init()
{
    register_plugin("[ZE] Skins", "1.1", "Spi")
    g_pCvarUseTimes = register_cvar("ze_skin_menu_used", "1")
}
public plugin_precache()
{
    precache_model("models/player/Halo_O/Halo_O.mdl")
    precache_model("models/player/Halo_W/Halo_W.mdl")
    precache_model("models/player/Halo_B/Halo_B.mdl")
    precache_model("models/player/Halo_R/Halo_R.mdl")
}
 
public ze_user_humanized(id)
{
  g_iUsedTimes[id] = 0
 
  if (g_bHaloO[id])
  {
      rg_set_user_model(id, "Halo_O")
  }
  else if (g_bHaloW[id])
  {
      rg_set_user_model(id, "Halo_W")
  }
  else if (g_bHaloB[id])
  {
      rg_set_user_model(id, "Halo_B")
  }
  else if (g_bHaloR[id])
  {
      rg_set_user_model(id, "Halo_R")
  }
}
 
public model_menu(id)
{
    if (ze_is_user_zombie(id))
    {
        ze_colored_print(id, "!tYou can't change your skin while you are zombie!y.")
        return PLUGIN_HANDLED
    }
    if (g_iUsedTimes[id] >= get_pcvar_num(g_pCvarUseTimes))
    {
        ze_colored_print(id, "!tYou have already changed your !gskin!y!")
        return PLUGIN_HANDLED
    }
    else if (ze_get_vip_flags(id) & VIP_A)
    {
        ze_colored_print(id, "!tNo access!y.")
        return PLUGIN_HANDLED
    }
    else
    {
        new menu = menu_create("\r[\wSkins Menu\r]\r", "menu_wybierz")
   
        menu_additem(menu, "\wHalo \y| \rOrange", "1", 0)
        menu_additem(menu, "\wHalo \y| \rWhite", "2", 0)
        menu_additem(menu, "\wHalo \y| \rBlue", "3", 0)
        menu_additem(menu, "\wHalo \y| \rRed", "4", 0)
 
   
        menu_setprop(menu, MPROP_EXIT, MEXIT_ALL)
        menu_display(id, menu, 0)
    }
    return PLUGIN_HANDLED
}
public menu_wybierz(id, menu, item)
{
    if (item == MENU_EXIT)
    {
        menu_destroy(menu)
        return PLUGIN_HANDLED
    }
    new data[20], iName[500]
    new acces, callback
    menu_item_getinfo(menu, item, acces, data,20, iName, 500, callback)
   
    new key = str_to_num(data)
   
    switch(key)
    {
       case 1 : {
        rg_set_user_model(id, "Halo_O")
        ze_colored_print(id, "!tYou picked the !gOrange Halo Skin!y!", id)
        g_iUsedTimes[id]++
        g_bHaloO[id] = true
        g_bHaloW[id] = false
        g_bHaloB[id] = false
        g_bHaloR[id] = false
        }
       case 2 : {
        rg_set_user_model(id, "Halo_W")
        ze_colored_print(id, "!tYou picked the !gWhite Halo Skin!y!", id)
        g_iUsedTimes[id]++
        g_bHaloO[id] = false
        g_bHaloW[id] = true
        g_bHaloB[id] = false
        g_bHaloR[id] = false
        }
       case 3 : {
        rg_set_user_model(id, "Halo_B")
        ze_colored_print(id, "!tYou picked the !gBlue Halo Skin!y!", id)
        g_iUsedTimes[id]++
        g_bHaloO[id] = false
        g_bHaloW[id] = false
        g_bHaloB[id] = true
        g_bHaloR[id] = false
        }
       case 4 : {
        rg_set_user_model(id, "Halo_R")
        ze_colored_print(id, "!tYou picked the !gRed Halo Skin!y!", id)
        g_iUsedTimes[id]++
        g_bHaloO[id] = false
        g_bHaloW[id] = false
        g_bHaloB[id] = false
        g_bHaloR[id] = true
        }
    }
    menu_destroy(menu)
    return PLUGIN_HANDLED
}  
public native_ze_open_skin_menu(id)
{
    model_menu(id)
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1036\\ f0\\ fs16 \n\\ par }
*/
Not interested in CS/Pawn anymore.
Accepting web projects.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest