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

Solved GetCmdArg problem with SteamID format (:)


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Fastmancz
Senior Member
Join Date: Jul 2013
Location: Czech Republic
Old 05-14-2018 , 10:53   GetCmdArg problem with SteamID format (:)
Reply With Quote #1

Hello,

I have a problem with getting a SteamID from GetCmdArg. For example, I enter to the server console: sm_cmd STEAM_1:0:00000 6 and I get output Steamid: STEAM_1 | Days: :

PHP Code:
#include <sourcemod>

public OnPluginStart() 
{
    
RegAdminCmd("sm_cmd"cmdADMFLAG_ROOT);
}

public 
Action cmd(clientargs)
{
    if(!
GetClientOfUserId(client)) //Command only for console
    
{
        
char cmd_steamid[128];
        
GetCmdArg(1cmd_steamidsizeof(cmd_steamid));

        
char cmd_days[128];
        
GetCmdArg(2cmd_dayssizeof(cmd_days));

        
PrintToServer("Steamid: %s | Days: %s"cmd_steamidcmd_days);
    }

I don't know what's wrong. Thanks for help.
__________________


Main owner of the CMGPORTAL.CZ.
---------------------------------------
My plugins:
[CS:GO] Panorama - Timeleft
[CS:GO] JailBreak - Be quiet, please!

Last edited by Fastmancz; 05-14-2018 at 11:44.
Fastmancz 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 04:34.


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