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

Get two arguments


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
einsfuhrer
Member
Join Date: Jun 2019
Old 09-21-2019 , 17:45   Get two arguments
Reply With Quote #1

So I'm having this issue. I want to gag the player I type in as the first argument and the second argument should be stored in the "reason" variable so I can use that as reason on the gag.

But when I type "!tgag trum test" then the reason is "trum test". How can I seperate the first argument from the second?

PHP Code:
#include <sourcemod>
#include <sourcecomms>

#pragma semicolon 1
#pragma newdecls required

public Plugin myinfo = {
    
name        "Trusted",
    
author      "",
    
description "",
    
version     "",
    
url         ""
};

public 
void OnPluginStart()
{
    
RegAdminCmd("sm_tgag"Command_tGagADMFLAG_CUSTOM6"Trusted gag command");
}

public 
Action Command_tGag(int clientint args)
{

    
char name[64];
    
GetCmdArgString(namesizeof(name));

    
char reason[64];
    
GetCmdArgString(reasonsizeof(reason));


    if (
args 2)
    {
        
ReplyToCommand(client" \x0C[TURF]⠀\x08Usage: sm_tgag <name> <reason>");
        return 
Plugin_Handled;
    }

    
SourceComms_SetClientGag(clienttrue30truereason);

    return 
Plugin_Handled;


Thanks in advanced!
einsfuhrer 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 05:18.


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