View Single Post
farawayf
Senior Member
Join Date: Jan 2019
Old 07-09-2019 , 14:40   Re: how can you scan a variable and then apply it?
Reply With Quote #7

argument number to retrieve.
for example we need to make a command like sm_cvar <cvar> <value>

so need to do like this

PHP Code:
    char cvar[64], cvarValue[32], buffer[96];

    
GetCmdArg(1cvarsizeof(cvar)); //get the first argument (cvar)
    
GetCmdArg(2cvarValuesizeof(cvarValue)); //get the second argument (value)

    
Format(buffersizeof(buffer), "%s %s"cvarcvarValue); //format 2 chars to one
    
    
ServerCommand(buffer); //then execute the command and value from buffer char
    
return Plugin_Handled

Last edited by farawayf; 07-09-2019 at 14:41.
farawayf is offline