Raised This Month: $ Target: $400
 0% 

Solved Passing arguments to consolecmd, warning with enum and problem with decal


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
hh2
AlliedModders Donor
Join Date: Sep 2010
Old 10-12-2016 , 15:00   Passing arguments to consolecmd, warning with enum and problem with decal
Reply With Quote #1

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 clientint args)
{
    
char arg[128];
    
GetCmdArg(1argsizeof(arg));
    
    
int value StringToInt(arg);
}
void test(client)
{
    
Command_Test(client1);  //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(posg_iSprite);
    
TE_SendToAll();

Thanks for any help!

Last edited by hh2; 10-13-2016 at 14:41.
hh2 is offline
 



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 12:32.


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