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

Changing from client name to SteamID args


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Nickolay
Member
Join Date: Jan 2020
Old 06-30-2020 , 23:46   Changing from client name to SteamID args
Reply With Quote #1

Got zero knowledge when it comes to this, so any help would be great.
Trying to change the code so instead of typing in client name or userid, I can just type in steamid.


Code:
{
	RegAdminCmd("sm_addvip", Command_Addvip, ADMFLAG_SLAY, "Adds an admin to admins_simple.ini");
}

public Action:Command_Addvip(client, args)
{
	if(args < 1)
	{
		ReplyToCommand(client, "[SM] Usage: sm_addvip <name or #userid>");
		return Plugin_Handled;
	}
	decl String:buffer[64];
	GetCmdArg(1, buffer, sizeof(buffer));
	new target = FindTarget(client, buffer, true, false);
	decl String:steamid[64];
	GetClientAuthId(target, AuthId_Steam2, steamid, sizeof(steamid));
	
	new String:szFile[256];
	BuildPath(Path_SM, szFile, sizeof(szFile), "configs/admins_simple.ini");

	new Handle:hFile = OpenFile(szFile, "at");

	WriteFileLine(hFile, "\"%s\" \"5:a\"  //%N", steamid, target);

	CloseHandle(hFile);

	return Plugin_Handled;
}
Nickolay 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 14:52.


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