Raised This Month: $ Target: $400
 0% 

Solved Enum's


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
LearninG
Senior Member
Join Date: Apr 2019
Location: Iran
Old 08-31-2019 , 04:09   Re: Enum's
Reply With Quote #1

Quote:
Originally Posted by E1_531G View Post
g_PlayerData is an array, and PlayerInfo is an enum.
You cannot create an array using other array as dimension.

Quote:
so if we do not need this here , where we will need it ?
you need it here:
Quote:
get_user_name(id , g_PlayerData[id][Player_Name] , charsmax(g_PlayerData[][Player_Name]))
now you have player's name in this global array, and you can use it anywhere you need it.
works , thanks.


Quote:
Originally Posted by Natsheh View Post
Note:
Also declaring global array variables should always be in the first of the script and thier sizes before them
like this ?
PHP Code:
#define MAX_PLAYERS   32

enum _:PlayerInfo
{
    
Player_Name[32] ,
    
Player_Authid[35]
}

new 
g_PlayerData[MAX_PLAYERS 1] [ PlayerInfo 
or


PHP Code:
#define G_PLAYER_DATA_SIZE  33

enum _:PlayerInfo
{
    
Player_Name[32] ,
    
Player_Authid[35]
}

new 
g_PlayerData[G_PLAYER_DATA_SIZE] [ PlayerInfo 

Last edited by LearninG; 08-31-2019 at 04:17.
LearninG 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 17:27.


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