AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Solved enum question (https://forums.alliedmods.net/showthread.php?t=332273)

lexzor 05-02-2021 20:30

enum question
 
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.

Bugsy 05-02-2021 21:13

Re: enum question
 
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] ) )

lexzor 05-03-2021 09:30

Re: enum question
 
Thanks!


All times are GMT -4. The time now is 02:32.

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