1. What is the best idea to passing arguments to consolecmd, example below:
PHP Code:
RegConsoleCmd("sm_test", Command_Test);
public Action Command_Test(int client, int args)
{
char arg[128];
GetCmdArg(1, arg, sizeof(arg));
int value = StringToInt(arg);
}
void test(client)
{
Command_Test(client, 1); //how to pass custom value to function?
}
Is FakeClientCommand are only way to do it?
2. What causes this warning?
PHP Code:
enum Colors {
RED,
BLUE,
GREEN,
MAX_COLORS
}
int g_iSelectedColor[MAXPLAYERS + 1];
void func(int client)
{
g_iSelectedColor[client]++;
if ( g_iSelectedColor[client] >= MAX_COLORS ) //warning 213: tag mismatch
{
g_iSelectedColor[client] = 0;
}
}
3. Code below gives me small black dot, instead of my texture. What is wrong? Textures are ok, because i copied it from other server.
PHP Code:
int g_iSprite = -1;
public void OnMapStart()
{
AddFileToDownloadsTable("materials/test.vtf");
AddFileToDownloadsTable("materials/test.vmt");
g_iSprite = PrecacheDecal("materials/test", true);
}
void TE_SetupBSPDecal(float vecOrigin[3], int index)
{
TE_Start("World Decal");
TE_WriteVector("m_vecOrigin", vecOrigin);
TE_WriteNum("m_nIndex", index);
}
void setup(float pos[3])
{
TE_SetupBSPDecal(pos, g_iSprite);
TE_SendToAll();
}
Thanks for any help!