Raised This Month: $ Target: $400
 0% 

[SOLVED] Check Steam Id


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Official_Cracky
Junior Member
Join Date: May 2014
Location: France
Old 06-11-2014 , 04:12   [SOLVED] Check Steam Id
Reply With Quote #1

I want my plugin check the Steam ID on people connect in the server and if one of them have the Steam ID "STEAM_0:1:xxxxxxx" then it set his clan tag to Harder Way.
Anyone know how to do ?

Code:
#include <sourcemod> 
#include <cstrike>

public OnPluginStart() 
{  
    HookEvent("player_team", Event); 
    HookEvent("player_spawn", Event); 
} 

public Action:Event(Handle:event, String:name[], bool:dontBroadcast) 
{ 
    new client = GetClientOfUserId(GetEventInt(event, "userid")); 
    HandleTag(client); 
} 

public OnClientPostAdminCheck(client) 
{ 
    HandleTag(client);
} 

public OnClientPutInServer(client)
{
    // WHAT I HAVE TO WRITE HERE ?
}

HandleTag(client)
{
    if (GetUserFlagBits(client) & OnClientPutInServer(client)) 
    { 
        CS_SetClientClanTag(client, "Harder way"); 
    }
}

Last edited by Official_Cracky; 06-12-2014 at 04:43. Reason: Solved
Official_Cracky is offline
w1200441
Senior Member
Join Date: Dec 2011
Old 06-11-2014 , 12:58   Re: [HELP REQUEST] Check Steam Id
Reply With Quote #2

This is what I used in my plugins.

Code:
decl String:strSteamID[20];
GetClientAuthString(client, strSteamID, sizeof(strSteamID));
new String:playerID[2048];
Format(playerID, sizeof(playerID), "STEAM_0:1:xxxxxxx");
if (StrContains(playerID, strSteamID, false) != -1)
{
	if(IsClientInGame(client))
	{
		//Do something
	}
}
w1200441 is offline
Official_Cracky
Junior Member
Join Date: May 2014
Location: France
Old 06-12-2014 , 04:42   Re: [HELP REQUEST] Check Steam Id
Reply With Quote #3

Solved, thanks
Official_Cracky is offline
delachambre
AlliedModders Donor
Join Date: Jan 2011
Location: France
Old 06-13-2014 , 05:33   Re: [SOLVED] Check Steam Id
Reply With Quote #4

new String:playerID[2048];

wtffff ?
__________________
♥ 𝕊ℙ𝕒𝕨𝕟 𝔻𝕖𝕧𝕖𝕝𝕠𝕡𝕖𝕣 [ℂ𝕊:𝕊] ♥

Clan-Nemesis
delachambre is offline
w1200441
Senior Member
Join Date: Dec 2011
Old 06-13-2014 , 13:54   Re: [SOLVED] Check Steam Id
Reply With Quote #5

Quote:
Originally Posted by delachambre View Post
new String:playerID[2048];

wtffff ?
I dont even know what's 2048 doing for? lol
w1200441 is offline
Reply



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 22:52.


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