Raised This Month: $51 Target: $400
 12% 

Solved [HELP] Change plugin for all users!


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ComedyShotsGamer
Senior Member
Join Date: Mar 2016
Old 02-11-2017 , 06:21   [HELP] Change plugin for all users!
Reply With Quote #1

Hi all,

im using this plugin on my private server but only admins can see the glove models and the normal users cannot see the gloves but only the gun?

Can anyone help me?

PHP Code:
#include <sourcemod>
#include <cstrike>
#include <sdktools>
#include <morecolors>
#include <clientprefs>
#include <smlib>

public Plugin:myinfo =
{
    
name "e-Sports Team Glove Models Menu",
    
author "ChrisPaokiG4",
    
description "Choose your favorite e-Sport Team Glove Model",
    
version "1.0.1",
    
url "URL"
}

public 
OnPluginStart()
{
    
//Events
    
HookEvent("player_spawn"ps);
    
    
//Register Commands
    
RegConsoleCmd("sm_glove"GloveMenu);
    
RegConsoleCmd("sm_gloves"GloveMenu);
}

public 
void download()
{
    
//Dignitas
    
AddFileToDownloadsTable("models/gloves/gga/dignitas/dignitas.mdl");
    
AddFileToDownloadsTable("models/gloves/gga/dignitas/dignitas.vvd");
    
AddFileToDownloadsTable("models/gloves/gga/dignitas/dignitas.dx90.vtx");
    
AddFileToDownloadsTable("materials/gloves/gga/dignitas/dignitas.vmt");
    
AddFileToDownloadsTable("materials/gloves/gga/dignitas/dignitas_color.vtf");
    
    
//Fnatic
    
AddFileToDownloadsTable("models/gloves/gga/fnatic/fnatic.mdl");
    
AddFileToDownloadsTable("models/gloves/gga/fnatic/fnatic.vvd");
    
AddFileToDownloadsTable("models/gloves/gga/fnatic/fnatic.dx90.vtx");
    
AddFileToDownloadsTable("materials/gloves/gga/fnatic/fnatic.vmt");
    
AddFileToDownloadsTable("materials/gloves/gga/fnatic/fnatic_color.vtf");
    
    
//NAVI
    
AddFileToDownloadsTable("models/gloves/gga/navi/navi.mdl");
    
AddFileToDownloadsTable("models/gloves/gga/navi/navi.vvd");
    
AddFileToDownloadsTable("models/gloves/gga/navi/navi.dx90.vtx");
    
AddFileToDownloadsTable("materials/gloves/gga/navi/navi.vmt");
    
AddFileToDownloadsTable("materials/gloves/gga/navi/navi_color.vtf");
    
    
//Envyus
    
AddFileToDownloadsTable("models/gloves/gga/envyus/envyus.mdl");
    
AddFileToDownloadsTable("models/gloves/gga/envyus/envyus.vvd");
    
AddFileToDownloadsTable("models/gloves/gga/envyus/envyus.dx90.vtx");
    
AddFileToDownloadsTable("materials/gloves/gga/envyus/envyus.vmt");
    
AddFileToDownloadsTable("materials/gloves/gga/envyus/envyus_color.vtf");
    
    
//FaZe
    
AddFileToDownloadsTable("models/gloves/gga/faze/faze.mdl");
    
AddFileToDownloadsTable("models/gloves/gga/faze/faze.vvd");
    
AddFileToDownloadsTable("models/gloves/gga/faze/faze.dx90.vtx");
    
AddFileToDownloadsTable("materials/gloves/gga/faze/faze.vmt");
    
AddFileToDownloadsTable("materials/gloves/gga/faze/faze_color.vtf");
    
    
//Flipside
    
AddFileToDownloadsTable("models/gloves/gga/flipside/flipside.mdl");
    
AddFileToDownloadsTable("models/gloves/gga/flipside/flipside.vvd");
    
AddFileToDownloadsTable("models/gloves/gga/flipside/flipside.dx90.vtx");
    
AddFileToDownloadsTable("materials/gloves/gga/flipside/flipside.vmt");
    
AddFileToDownloadsTable("materials/gloves/gga/flipside/flipside_color.vtf");
    
    
//G2
    
AddFileToDownloadsTable("models/gloves/gga/g2/g2.mdl");
    
AddFileToDownloadsTable("models/gloves/gga/g2/g2.vvd");
    
AddFileToDownloadsTable("models/gloves/gga/g2/g2.dx90.vtx");
    
AddFileToDownloadsTable("materials/gloves/gga/g2/g2.vmt");
    
AddFileToDownloadsTable("materials/gloves/gga/g2/g2_color.vtf")
    
    
//IBP
    
AddFileToDownloadsTable("models/gloves/gga/ibp/ibp.mdl");
    
AddFileToDownloadsTable("models/gloves/gga/ibp/ibp.vvd");
    
AddFileToDownloadsTable("models/gloves/gga/ibp/ibp.dx90.vtx");
    
AddFileToDownloadsTable("materials/gloves/gga/ibp/ibp.vmt");
    
AddFileToDownloadsTable("materials/gloves/gga/ibp/ibp_color.vtf")
    
    
//Liquid
    
AddFileToDownloadsTable("models/gloves/gga/liquid/liquid.mdl");
    
AddFileToDownloadsTable("models/gloves/gga/liquid/liquid.vvd");
    
AddFileToDownloadsTable("models/gloves/gga/liquid/liquid.dx90.vtx");
    
AddFileToDownloadsTable("materials/gloves/gga/liquid/liquid.vmt");
    
AddFileToDownloadsTable("materials/gloves/gga/liquid/liquid_color.vtf")
    
    
//Mousesports
    
AddFileToDownloadsTable("models/gloves/gga/mousesports/mousesports.mdl");
    
AddFileToDownloadsTable("models/gloves/gga/mousesports/mousesports.vvd");
    
AddFileToDownloadsTable("models/gloves/gga/mousesports/mousesports.dx90.vtx");
    
AddFileToDownloadsTable("materials/gloves/gga/mousesports/mousesports.vmt");
    
AddFileToDownloadsTable("materials/gloves/gga/mousesports/mousesports_color.vtf")
    
    
//NIP
    
AddFileToDownloadsTable("models/gloves/gga/nip/nip.mdl");
    
AddFileToDownloadsTable("models/gloves/gga/nip/nip.vvd");
    
AddFileToDownloadsTable("models/gloves/gga/nip/nip.dx90.vtx");
    
AddFileToDownloadsTable("materials/gloves/gga/nip/nip.vmt");
    
AddFileToDownloadsTable("materials/gloves/gga/nip/nip_color.vtf")
    
    
//SK
    
AddFileToDownloadsTable("models/gloves/gga/sk/sk.mdl");
    
AddFileToDownloadsTable("models/gloves/gga/sk/sk.vvd");
    
AddFileToDownloadsTable("models/gloves/gga/sk/sk.dx90.vtx");
    
AddFileToDownloadsTable("materials/gloves/gga/sk/sk.vmt");
    
AddFileToDownloadsTable("materials/gloves/gga/sk/sk_color.vtf")
    
    
//Virtus Pro
    
AddFileToDownloadsTable("models/gloves/gga/vp/vp.mdl");
    
AddFileToDownloadsTable("models/gloves/gga/vp/vp.vvd");
    
AddFileToDownloadsTable("models/gloves/gga/vp/vp.dx90.vtx");
    
AddFileToDownloadsTable("materials/gloves/gga/vp/vp.vmt");
    
AddFileToDownloadsTable("materials/gloves/gga/vp/vp_color.vtf");
}

bool Dignitas[33] = false;
bool Fnatic[33] = false;
bool NaVi[33] = false;
bool EnvyUs[33] = false;
bool FaZe[33] = false;
bool Flipside[33] = false;
bool G2[33] = false;
bool iBuyPower[33] = false;
bool Liquid[33] = false;
bool Mousesports[33] = false;
bool NiP[33] = false;
bool SKGaming[33] = false;
bool VirtusPro[33] = false;

public 
void Precache()
{
    
PrecacheModel("models/gloves/gga/dignitas/dignitas.mdl");
    
PrecacheModel("models/gloves/gga/fnatic/fnatic.mdl");
    
PrecacheModel("models/gloves/gga/navi/navi.mdl");
    
PrecacheModel("models/gloves/gga/envyus/envyus.mdl");
    
PrecacheModel("models/gloves/gga/faze/faze.mdl");
    
PrecacheModel("models/gloves/gga/flipside/flipside.mdl");
    
PrecacheModel("models/gloves/gga/g2/g2.mdl");
    
PrecacheModel("models/gloves/gga/ibp/ibp.mdl");
    
PrecacheModel("models/gloves/gga/liquid/liquid.mdl");
    
PrecacheModel("models/gloves/gga/mousesports/mousesports.mdl");
    
PrecacheModel("models/gloves/gga/nip/nip.mdl");
    
PrecacheModel("models/gloves/gga/sk/sk.mdl");
    
PrecacheModel("models/gloves/gga/vp/vp.mdl");
}

public 
void OnMapStart()
{
    
//Download the Models
    
download();
    
    
//Precache the Models
    
Precache();
}

public 
Action:GloveMenu(clientargs)
{
    
GloveMenuHandler(client);
}

public 
void GloveMenuHandler(client)
{
    
Menu glove = new Menu(GloveMenuHandler2);
    
    
glove.SetTitle("Glove Menu");
    
glove.AddItem("Default""Default");
    
glove.AddItem("Dignitas""Dignitas");
    
glove.AddItem("Fnatic""Fnatic");
    
glove.AddItem("NaVi""NaVi");
    
glove.AddItem("EnvyUs""EnvyUs");
    
glove.AddItem("FaZe""FaZe");
    
glove.AddItem("Flipside""Flipside");
    
glove.AddItem("G2""G2");
    
glove.AddItem("iBuyPower""iBuyPower");
    
glove.AddItem("Liquid""Liquid");
    
glove.AddItem("Mousesports""Mousesports");
    
glove.AddItem("NiP""NiP");
    
glove.AddItem("SKGaming""SKGaming");
    
glove.AddItem("VirtusPro""VirtusPro");
    
glove.ExitButton true;
    
glove.Display(clientMENU_TIME_FOREVER);
}

public 
int GloveMenuHandler2(Menu gloveMenuAction actionint param1int param2)
{
    if(
action == MenuAction_Select)
    {
        
char iteam[32];
        
glove.GetItem(param2iteamsizeof(iteam));
        if(
StrEqual(iteam"Default"))
        {
            
Dignitas[param1] = false;
            
Fnatic[param1] = false;
            
NaVi[param1] = false;
            
EnvyUs[param1] = false;
            
FaZe[param1] = false;
            
Flipside[param1] = false;
            
G2[param1] = false;
            
iBuyPower[param1] = false;
            
Liquid[param1] = false;
            
Mousesports[param1] = false;
            
NiP[param1] = false;
            
SKGaming[param1] = false;
            
VirtusPro[param1] = false;
        }
        if(
StrEqual(iteam"Dignitas"))
        {
            
Dignitas[param1] = true;
            
Fnatic[param1] = false;
            
NaVi[param1] = false;
            
EnvyUs[param1] = false;
            
FaZe[param1] = false;
            
Flipside[param1] = false;
            
G2[param1] = false;
            
iBuyPower[param1] = false;
            
Liquid[param1] = false;
            
Mousesports[param1] = false;
            
NiP[param1] = false;
            
SKGaming[param1] = false;
            
VirtusPro[param1] = false;
        }
        if(
StrEqual(iteam"Fnatic"))
        {
            
Dignitas[param1] = false;
            
Fnatic[param1] = true;
            
NaVi[param1] = false;
            
EnvyUs[param1] = false;
            
FaZe[param1] = false;
            
Flipside[param1] = false;
            
G2[param1] = false;
            
iBuyPower[param1] = false;
            
Liquid[param1] = false;
            
Mousesports[param1] = false;
            
NiP[param1] = false;
            
SKGaming[param1] = false;
            
VirtusPro[param1] = false;
        }
        if(
StrEqual(iteam"Astralis"))
        {
            
Dignitas[param1] = false;
            
Fnatic[param1] = false;
            
NaVi[param1] = false;
            
EnvyUs[param1] = false;
            
FaZe[param1] = false;
            
Flipside[param1] = false;
            
G2[param1] = false;
            
iBuyPower[param1] = false;
            
Liquid[param1] = false;
            
Mousesports[param1] = false;
            
NiP[param1] = false;
            
SKGaming[param1] = false;
            
VirtusPro[param1] = false;
        }
        if(
StrEqual(iteam"NaVi"))
        {
            
Dignitas[param1] = false;
            
Fnatic[param1] = false;
            
NaVi[param1] = true;
            
EnvyUs[param1] = false;
            
FaZe[param1] = false;
            
Flipside[param1] = false;
            
G2[param1] = false;
            
iBuyPower[param1] = false;
            
Liquid[param1] = false;
            
Mousesports[param1] = false;
            
NiP[param1] = false;
            
SKGaming[param1] = false;
            
VirtusPro[param1] = false;
        }
        if(
StrEqual(iteam"EnvyUs"))
        {
            
Dignitas[param1] = false;
            
Fnatic[param1] = false;
            
NaVi[param1] = false;
            
EnvyUs[param1] = true;
            
FaZe[param1] = false;
            
Flipside[param1] = false;
            
G2[param1] = false;
            
iBuyPower[param1] = false;
            
Liquid[param1] = false;
            
Mousesports[param1] = false;
            
NiP[param1] = false;
            
SKGaming[param1] = false;
            
VirtusPro[param1] = false;
        }
        if(
StrEqual(iteam"FaZe"))
        {
            
Dignitas[param1] = false;
            
Fnatic[param1] = false;
            
NaVi[param1] = false;
            
EnvyUs[param1] = false;
            
FaZe[param1] = true;
            
Flipside[param1] = false;
            
G2[param1] = false;
            
iBuyPower[param1] = false;
            
Liquid[param1] = false;
            
Mousesports[param1] = false;
            
NiP[param1] = false;
            
SKGaming[param1] = false;
            
VirtusPro[param1] = false;
        }
        if(
StrEqual(iteam"Flipside"))
        {
            
Dignitas[param1] = false;
            
Fnatic[param1] = false;
            
NaVi[param1] = false;
            
EnvyUs[param1] = false;
            
FaZe[param1] = false;
            
Flipside[param1] = true;
            
G2[param1] = false;
            
iBuyPower[param1] = false;
            
Liquid[param1] = false;
            
Mousesports[param1] = false;
            
NiP[param1] = false;
            
SKGaming[param1] = false;
            
VirtusPro[param1] = false;
        }
        if(
StrEqual(iteam"G2"))
        {
            
Dignitas[param1] = false;
            
Fnatic[param1] = false;
            
NaVi[param1] = false;
            
EnvyUs[param1] = false;
            
FaZe[param1] = false;
            
Flipside[param1] = false;
            
G2[param1] = true;
            
iBuyPower[param1] = false;
            
Liquid[param1] = false;
            
Mousesports[param1] = false;
            
NiP[param1] = false;
            
SKGaming[param1] = false;
            
VirtusPro[param1] = false;
        }
        if(
StrEqual(iteam"iBuyPower"))
        {
            
Dignitas[param1] = false;
            
Fnatic[param1] = false;
            
NaVi[param1] = false;
            
EnvyUs[param1] = false;
            
FaZe[param1] = false;
            
Flipside[param1] = false;
            
G2[param1] = false;
            
iBuyPower[param1] = true;
            
Liquid[param1] = false;
            
Mousesports[param1] = false;
            
NiP[param1] = false;
            
SKGaming[param1] = false;
            
VirtusPro[param1] = false;
        }
        if(
StrEqual(iteam"Liquid"))
        {
            
Dignitas[param1] = false;
            
Fnatic[param1] = false;
            
NaVi[param1] = false;
            
EnvyUs[param1] = false;
            
FaZe[param1] = false;
            
Flipside[param1] = false;
            
G2[param1] = false;
            
iBuyPower[param1] = false;
            
Liquid[param1] = true;
            
Mousesports[param1] = false;
            
NiP[param1] = false;
            
SKGaming[param1] = false;
            
VirtusPro[param1] = false;
        }
        if(
StrEqual(iteam"Mousesports"))
        {
            
Dignitas[param1] = false;
            
Fnatic[param1] = false;
            
NaVi[param1] = false;
            
EnvyUs[param1] = false;
            
FaZe[param1] = false;
            
Flipside[param1] = false;
            
G2[param1] = false;
            
iBuyPower[param1] = false;
            
Liquid[param1] = false;
            
Mousesports[param1] = true;
            
NiP[param1] = false;
            
SKGaming[param1] = false;
            
VirtusPro[param1] = false;
        }
        if(
StrEqual(iteam"NiP"))
        {
            
Dignitas[param1] = false;
            
Fnatic[param1] = false;
            
NaVi[param1] = false;
            
EnvyUs[param1] = false;
            
FaZe[param1] = false;
            
Flipside[param1] = false;
            
G2[param1] = false;
            
iBuyPower[param1] = false;
            
Liquid[param1] = false;
            
Mousesports[param1] = false;
            
NiP[param1] = true;
            
SKGaming[param1] = false;
            
VirtusPro[param1] = false;
        }
        if(
StrEqual(iteam"SKGaming"))
        {
            
Dignitas[param1] = false;
            
Fnatic[param1] = false;
            
NaVi[param1] = false;
            
EnvyUs[param1] = false;
            
FaZe[param1] = false;
            
Flipside[param1] = false;
            
G2[param1] = false;
            
iBuyPower[param1] = false;
            
Liquid[param1] = false;
            
Mousesports[param1] = false;
            
NiP[param1] = false;
            
SKGaming[param1] = true;
            
VirtusPro[param1] = false;
        }
        if(
StrEqual(iteam"VirtusPro"))
        {
            
Dignitas[param1] = false;
            
Fnatic[param1] = false;
            
NaVi[param1] = false;
            
EnvyUs[param1] = true;
            
FaZe[param1] = false;
            
Flipside[param1] = false;
            
G2[param1] = false;
            
iBuyPower[param1] = false;
            
Liquid[param1] = false;
            
Mousesports[param1] = false;
            
NiP[param1] = false;
            
SKGaming[param1] = false;
            
VirtusPro[param1] = true;
        }
        
PrintToChat(param1"\x03[Gloves] \x02You selected \x07%s \x04Glove"iteam);
    }
}

public 
Action:ps(Handle:event, const String:name[], bool:dontBroadcast)
{
    new 
client_id GetEventInt(event"userid");
    new 
client GetClientOfUserId(client_id);
    
    if(
Dignitas[client])
    {
        
SetEntPropString(clientProp_Send"m_szArmsModel""models/gloves/gga/dignitas/dignitas.mdl");
    }
    if(
Fnatic[client])
    {
        
SetEntPropString(clientProp_Send"m_szArmsModel""models/gloves/gga/fnatic/fnatic.mdl");
    }
    if(
NaVi[client])
    {
        
SetEntPropString(clientProp_Send"m_szArmsModel""models/gloves/gga/navi/navi.mdl");
    }
    if(
EnvyUs[client])
    {
        
SetEntPropString(clientProp_Send"m_szArmsModel""models/gloves/gga/envyus/envyus.mdl");
    }
    if(
FaZe[client])
    {
        
SetEntPropString(clientProp_Send"m_szArmsModel""models/gloves/gga/faze/faze.mdl");
    }
    if(
Flipside[client])
    {
        
SetEntPropString(clientProp_Send"m_szArmsModel""models/gloves/gga/flipside/flipside.mdl");
    }
    if(
G2[client])
    {
        
SetEntPropString(clientProp_Send"m_szArmsModel""models/gloves/gga/g2/g2.mdl");
    }
    if(
iBuyPower[client])
    {
        
SetEntPropString(clientProp_Send"m_szArmsModel""models/gloves/gga/ibp/ibp.mdl");
    }
    if(
Liquid[client])
    {
        
SetEntPropString(clientProp_Send"m_szArmsModel""models/gloves/gga/liquid/liquid.mdl");
    }
    if(
Mousesports[client])
    {
        
SetEntPropString(clientProp_Send"m_szArmsModel""models/gloves/gga/mousesports/mousesports.mdl");
    }
    if(
NiP[client])
    {
        
SetEntPropString(clientProp_Send"m_szArmsModel""models/gloves/gga/nip/nip.mdl");
    }
    if(
SKGaming[client])
    {
        
SetEntPropString(clientProp_Send"m_szArmsModel""models/gloves/gga/sk/sk.mdl");
    }
    if(
VirtusPro[client])
    {
        
SetEntPropString(clientProp_Send"m_szArmsModel""models/gloves/gga/vp/vp.mdl");
    }
}

public 
IsValidClient(client)
{
    if (!(
<= client <= MaxClients) || !IsClientInGame(client))
    {
        return 
false;
    }
    return 
true;


Last edited by DarkDeviL; 02-11-2017 at 09:25. Reason: Restored post + solved tag
ComedyShotsGamer is offline
Addicted.
AlliedModders Donor
Join Date: Dec 2013
Location: 0xA9D0DC
Old 02-14-2017 , 01:10   Re: [HELP] Change plugin for all users!
Reply With Quote #2

So I see that there is a sloved tag so you must have figured this out but there are many ways you could improve your code...

You could try doing something like this:

PHP Code:
#include <sourcemod>
#include <cstrike>
#include <sdktools>
#include <morecolors>
#include <clientprefs>
#include <smlib>

char g_sModels[][] = {

    
"models/gloves/gga/dignitas/dignitas.mdl",
    
"models/gloves/gga/fnatic/fnatic.mdl",
    
"models/gloves/gga/navi/navi.mdl",
    
"models/gloves/gga/envyus/envyus.mdl",
    
"models/gloves/gga/faze/faze.mdl",
    
"models/gloves/gga/flipside/flipside.mdl",
    
"models/gloves/gga/g2/g2.mdl",
    
"models/gloves/gga/ibp/ibp.mdl",
    
"models/gloves/gga/liquid/liquid.mdl",
    
"models/gloves/gga/mousesports/mousesports.mdl",
    
"models/gloves/gga/nip/nip.mdl",
    
"models/gloves/gga/sk/sk.mdl",
    
"models/gloves/gga/vp/vp.mdl",

};

int g_iSelection[MAXPLAYERS+1] = {-1, ...};

public 
Plugin myinfo = {

    
name "e-Sports Team Glove Models Menu",
    
author "ChrisPaokiG4",
    
description "Choose your favorite e-Sport Team Glove Model",
    
version "1.0.1",
    
url "URL"

}

public 
OnPluginStart() {

    
//Events
    
HookEvent("player_spawn"ps);
    
    
//Register Commands
    
RegConsoleCmd("sm_glove"GloveMenu);
    
RegConsoleCmd("sm_gloves"GloveMenu);

}

public 
void download() {

    for (
int i 0sizeof(g_sModels); i++) {

        
AddFileToDownloadsTable(g_sModels[i]);

    }

    
//Dignitas
    
AddFileToDownloadsTable("models/gloves/gga/dignitas/dignitas.vvd");
    
AddFileToDownloadsTable("models/gloves/gga/dignitas/dignitas.dx90.vtx");
    
AddFileToDownloadsTable("materials/gloves/gga/dignitas/dignitas.vmt");
    
AddFileToDownloadsTable("materials/gloves/gga/dignitas/dignitas_color.vtf");
    
    
//Fnatic
    
AddFileToDownloadsTable("models/gloves/gga/fnatic/fnatic.vvd");
    
AddFileToDownloadsTable("models/gloves/gga/fnatic/fnatic.dx90.vtx");
    
AddFileToDownloadsTable("materials/gloves/gga/fnatic/fnatic.vmt");
    
AddFileToDownloadsTable("materials/gloves/gga/fnatic/fnatic_color.vtf");
    
    
//NAVI
    
AddFileToDownloadsTable("models/gloves/gga/navi/navi.vvd");
    
AddFileToDownloadsTable("models/gloves/gga/navi/navi.dx90.vtx");
    
AddFileToDownloadsTable("materials/gloves/gga/navi/navi.vmt");
    
AddFileToDownloadsTable("materials/gloves/gga/navi/navi_color.vtf");
    
    
//Envyus
    
AddFileToDownloadsTable("models/gloves/gga/envyus/envyus.vvd");
    
AddFileToDownloadsTable("models/gloves/gga/envyus/envyus.dx90.vtx");
    
AddFileToDownloadsTable("materials/gloves/gga/envyus/envyus.vmt");
    
AddFileToDownloadsTable("materials/gloves/gga/envyus/envyus_color.vtf");
    
    
//FaZe
    
AddFileToDownloadsTable("models/gloves/gga/faze/faze.vvd");
    
AddFileToDownloadsTable("models/gloves/gga/faze/faze.dx90.vtx");
    
AddFileToDownloadsTable("materials/gloves/gga/faze/faze.vmt");
    
AddFileToDownloadsTable("materials/gloves/gga/faze/faze_color.vtf");
    
    
//Flipside
    
AddFileToDownloadsTable("models/gloves/gga/flipside/flipside.vvd");
    
AddFileToDownloadsTable("models/gloves/gga/flipside/flipside.dx90.vtx");
    
AddFileToDownloadsTable("materials/gloves/gga/flipside/flipside.vmt");
    
AddFileToDownloadsTable("materials/gloves/gga/flipside/flipside_color.vtf");
    
    
//G2
    
AddFileToDownloadsTable("models/gloves/gga/g2/g2.vvd");
    
AddFileToDownloadsTable("models/gloves/gga/g2/g2.dx90.vtx");
    
AddFileToDownloadsTable("materials/gloves/gga/g2/g2.vmt");
    
AddFileToDownloadsTable("materials/gloves/gga/g2/g2_color.vtf")
    
    
//IBP
    
AddFileToDownloadsTable("models/gloves/gga/ibp/ibp.vvd");
    
AddFileToDownloadsTable("models/gloves/gga/ibp/ibp.dx90.vtx");
    
AddFileToDownloadsTable("materials/gloves/gga/ibp/ibp.vmt");
    
AddFileToDownloadsTable("materials/gloves/gga/ibp/ibp_color.vtf")
    
    
//Liquid
    
AddFileToDownloadsTable("models/gloves/gga/liquid/liquid.vvd");
    
AddFileToDownloadsTable("models/gloves/gga/liquid/liquid.dx90.vtx");
    
AddFileToDownloadsTable("materials/gloves/gga/liquid/liquid.vmt");
    
AddFileToDownloadsTable("materials/gloves/gga/liquid/liquid_color.vtf")
    
    
//Mousesports
    
AddFileToDownloadsTable("models/gloves/gga/mousesports/mousesports.vvd");
    
AddFileToDownloadsTable("models/gloves/gga/mousesports/mousesports.dx90.vtx");
    
AddFileToDownloadsTable("materials/gloves/gga/mousesports/mousesports.vmt");
    
AddFileToDownloadsTable("materials/gloves/gga/mousesports/mousesports_color.vtf")
    
    
//NIP
    
AddFileToDownloadsTable("models/gloves/gga/nip/nip.vvd");
    
AddFileToDownloadsTable("models/gloves/gga/nip/nip.dx90.vtx");
    
AddFileToDownloadsTable("materials/gloves/gga/nip/nip.vmt");
    
AddFileToDownloadsTable("materials/gloves/gga/nip/nip_color.vtf")
    
    
//SK
    
AddFileToDownloadsTable("models/gloves/gga/sk/sk.vvd");
    
AddFileToDownloadsTable("models/gloves/gga/sk/sk.dx90.vtx");
    
AddFileToDownloadsTable("materials/gloves/gga/sk/sk.vmt");
    
AddFileToDownloadsTable("materials/gloves/gga/sk/sk_color.vtf")
    
    
//Virtus Pro
    
AddFileToDownloadsTable("models/gloves/gga/vp/vp.vvd");
    
AddFileToDownloadsTable("models/gloves/gga/vp/vp.dx90.vtx");
    
AddFileToDownloadsTable("materials/gloves/gga/vp/vp.vmt");
    
AddFileToDownloadsTable("materials/gloves/gga/vp/vp_color.vtf");

}

public 
void Precache() {

    for (
int i 0sizeof(g_sModels); i++) {

        
PrecacheModel(g_sModels[i]);

    }

}

public 
void OnMapStart()
{
    
//Download the Models
    
download();
    
    
//Precache the Models
    
Precache();
}

public 
Action GloveMenu(int clientint args) {

    if (!
IsValidClient(client))
        return;

    
GloveMenuHandler(client);

}

public 
void GloveMenuHandler(int client) {

    
Menu glove = new Menu(GloveMenuHandler2);
    
glove.SetTitle("Glove Menu");
    
    
glove.AddItem("Default""Default");
    
glove.AddItem("Dignitas""Dignitas");
    
glove.AddItem("Fnatic""Fnatic");
    
glove.AddItem("NaVi""NaVi");
    
glove.AddItem("EnvyUs""EnvyUs");
    
glove.AddItem("FaZe""FaZe");
    
glove.AddItem("Flipside""Flipside");
    
glove.AddItem("G2""G2");
    
glove.AddItem("iBuyPower""iBuyPower");
    
glove.AddItem("Liquid""Liquid");
    
glove.AddItem("Mousesports""Mousesports");
    
glove.AddItem("NiP""NiP");
    
glove.AddItem("SKGaming""SKGaming");
    
glove.AddItem("VirtusPro""VirtusPro");
    
    
glove.ExitButton true;
    
glove.Display(clientMENU_TIME_FOREVER);

}

public 
int GloveMenuHandler2(Menu gloveMenuAction actionint param1int param2) {

    if(
action == MenuAction_Select) {
    
        
g_iSelection[param1] = param2 1;
        
        
PrintToChat(param1"\x03[Gloves] \x02You selected \x07%s \x04Glove"g_sModels[g_iSelection[param1]]);
    
    }

}

public 
Action ps(Handle event, const char[] namebool dontBroadcast) {

    
int client GetClientOfUserId(GetEventInt(event"userid"));
    
    if (!
IsValidClient(client))
        return;
    
    if (
g_iSelection[client] == -1)
        return;
    
    
SetEntPropString(clientProp_Send"m_szArmsModel"g_sModels[g_iSelection[client]]);

}

public 
IsValidClient(client) {

    if (
client || client MaxClients || !IsClientInGame(client))
        return 
false;
    
    return 
true;


PS: Note I haven't actually tested this but it complies fine

Last edited by Addicted.; 02-14-2017 at 01:11.
Addicted. is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 15:57.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode