AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting (https://forums.alliedmods.net/forumdisplay.php?f=107)
-   -   [SOLVED] Check Steam Id (https://forums.alliedmods.net/showthread.php?t=241901)

Official_Cracky 06-11-2014 04:12

[SOLVED] Check Steam Id
 
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");
    }
}


w1200441 06-11-2014 12:58

Re: [HELP REQUEST] Check Steam Id
 
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
        }
}


Official_Cracky 06-12-2014 04:42

Re: [HELP REQUEST] Check Steam Id
 
Solved, thanks :)

delachambre 06-13-2014 05:33

Re: [SOLVED] Check Steam Id
 
new String:playerID[2048];

wtffff ?

w1200441 06-13-2014 13:54

Re: [SOLVED] Check Steam Id
 
Quote:

Originally Posted by delachambre (Post 2150947)
new String:playerID[2048];

wtffff ?

I dont even know what's 2048 doing for? lol


All times are GMT -4. The time now is 12:54.

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