AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting (https://forums.alliedmods.net/forumdisplay.php?f=107)
-   -   help, GetClientAuthString (https://forums.alliedmods.net/showthread.php?t=147249)

maza51 01-07-2011 06:03

help, GetClientAuthString
 
does not work?
Code:

#include <sourcemod>
#include <sdkhooks>
#include <sdktools>

public OnPluginStart()
{
        HookEvent("round_start", Event_RoundStart);
}


public Event_RoundStart(Handle:event, const String:name[], bool:dontBroadcast)
{
        new client = GetClientOfUserId(GetEventInt(event, "userid"));
        decl String:gAuth[21]
        GetClientAuthString( client, gAuth, sizeof( gAuth ) );
        if(!StrEqual(gAuth, "STEAM_0:0:00000", false))
        {
                PrintToChatAll("lol");
        }
}


SideX 01-07-2011 06:59

Re: help, GetClientAuthString
 
PHP Code:

#include <sourcemod>
#include <sdkhooks>
#include <sdktools>

public OnPluginStart()
{
    
HookEvent("round_start"Event_RoundStart);
}


public 
Event_RoundStart(Handle:event, const String:name[], bool:dontBroadcast)
{
    new 
client GetClientOfUserId(GetEventInt(event"userid"));
    
decl String:gAuth[21]
    
GetClientAuthStringclientgAuthsizeofgAuth ) );
    if(!
StrEqual(gAuth"0:0:00000"false))
    {
        
PrintToChatAll("lol");
    }


try this

FaTony 01-07-2011 07:05

Re: help, GetClientAuthString
 
No, it's STEAM...

maza51 01-07-2011 07:22

Re: help, GetClientAuthString
 
хм.. Работает. Спс
Только Одна вешь. "LoL" Пишется еще тогда, когда игрок приконектился..

PHP Code:

#include <sourcemod>
#include <sdkhooks>
#include <sdktools>

public OnPluginStart()
{
    
HookEvent("player_spawn"Event_Spawn);
}

public 
Event_Spawn(Handle:event, const String:name[], bool:dontBroadcast)
{
    new 
client GetClientOfUserId(GetEventInt(event"userid"));
    
decl String:gAuth[21]
    
GetClientAuthStringclientgAuthsizeofgAuth ) );
    if(!
StrEqual(gAuth"0:0:00000000"false))
    {
        
PrintToChat(client"LoL");
    }



SideX 01-07-2011 07:42

Re: help, GetClientAuthString
 
Quote:

Originally Posted by maza51 (Post 1388009)
хм.. Работает. Спс
Только Одна вешь. "LoL" Пишется еще тогда, когда игрок приконектился..

Попробуй проверять команду игрока. Если команда = команде спектаторов - тогда не проверяй стимид, иначе - проверяй.

Try check player's team. If it's equalto team spectators - dont check his steamid, else - check.

maza51 01-07-2011 09:03

Re: help, GetClientAuthString
 
Нет. Всетаки не работает это. Оказывается LoL пишется не только мне, а всем..

maza51 01-07-2011 09:42

Re: help, GetClientAuthString
 
Мм.. Разобрался.

McFlurry 01-07-2011 17:36

Re: help, GetClientAuthString
 
You're suppose to get the players Auth String when OnClientAuthorized and Sometimes they won't have a steam id by the time they spawn(at least the first time). The server checks if they have a steam id, if they don't the client gets kicked.


All times are GMT -4. The time now is 09:27.

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