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

Solved enum question


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
lexzor
Veteran Member
Join Date: Nov 2020
Old 05-02-2021 , 20:30   enum question
Reply With Quote #1

Hello. I have this enum:

PHP Code:
enum _:DATA
{
    
Address[MAX_IP_LENGTH],
    
AuthID[MAX_AUTHID_LENGTH],
    
Name[MAX_NAME_LENGTH],
    
Frags,
    
Deaths,
    
FirstSeen,
    
LastVisit
}

new 
g_iPlayersInfo[MAX_PLAYERS 1][DATA
and this is how i try to get player authid
PHP Code:
get_user_authid(idg_iPlayersInfo[id][AuthID], sizeof(DATA[AuthID])) 
but i gen an error. did i create the enum correctly? Thanks.

Last edited by lexzor; 05-03-2021 at 09:30.
lexzor is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 05-02-2021 , 21:13   Re: enum question
Reply With Quote #2

Enum looks good, though you should avoid using common words like 'Address', 'Name'.

Use charsmax(), not sizeof(), when working with strings.

get_user_authid(id, g_iPlayersInfo[id][AuthID], charsmax( g_iPlayersInfo[][AuthID] ) )
__________________

Last edited by Bugsy; 05-02-2021 at 21:14.
Bugsy is offline
lexzor
Veteran Member
Join Date: Nov 2020
Old 05-03-2021 , 09:30   Re: enum question
Reply With Quote #3

Thanks!
lexzor 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 19:28.


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