Raised This Month: $ Target: $400
 0% 

Setting AuthId on connection.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Michael Shoe Maker
Senior Member
Join Date: Apr 2016
Old 05-02-2016 , 11:48   Setting AuthId on connection.
Reply With Quote #1

I just wanted to make a easy way to store a clients auth string into a multidimensional char array.

PHP Code:
char g_ClientAuthId[MAXPLAYERS 1][20];

public 
void OnClientPutInServer(int client)
{
    
/* char auth[20];
    GetClientAuthId(client, AuthId_SteamID64, auth, 20);
    g_ClientAuthId[client] = auth; */
    
GetClientAuthId(clientAuthId_SteamID64g_ClientAuthId[client], sizeof(g_ClientAuthId[client]));

The code commented out works, but the other code throws this error:
Code:
error 001: expected token: "]", but found "-identifier-"
warning 215: expression has no effect
error 001: expected token: ";", but found "]"
error 029: invalid expression, assumed zero
fatal error 189: too many error messages on one line

Last edited by Michael Shoe Maker; 05-02-2016 at 11:51.
Michael Shoe Maker is offline
decl_mev
Member
Join Date: Dec 2015
Old 05-02-2016 , 11:59   Re: Setting AuthId on connection.
Reply With Quote #2

The appropiate forward to use is OnClientPostAdminCheck();
and for the size you can do sizeof(g_ClientAuthId[])

Edited: thanks Farbror Godis for correcting me
__________________
If it isn't automated you aren't doing it right.

High quality servers with custom plugins @ http://sourcecode.community
Github @ https://github.com/meev
Steam @ http://steamcommunity.com/id/mevv

Last edited by decl_mev; 05-02-2016 at 14:29.
decl_mev is offline
Farbror Godis
AlliedModders Donor
Join Date: Feb 2016
Old 05-02-2016 , 13:28   Re: Setting AuthId on connection.
Reply With Quote #3

Quote:
Originally Posted by decl_mev View Post
The appropiate forward to use is OnClientPostAdminCheck();
and for the size you can do sizeof(g_ClientAuthId[][])
Actually,
PHP Code:
sizeof(g_ClientAuthId[]) 
Will return the size of the second dimension.
__________________
Farbror Godis is offline
Deathknife
Senior Member
Join Date: Aug 2014
Old 05-02-2016 , 15:03   Re: Setting AuthId on connection.
Reply With Quote #4

You should use
PHP Code:
OnClientAuthorized(int client, const char[] authid
instead.
__________________
Deathknife 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 07:55.


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