Raised This Month: $ Target: $400
 0% 

HELP!! #define macros value with 2D arrays player data


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
lexzor
Veteran Member
Join Date: Nov 2020
Old 09-11-2022 , 19:00   Re: HELP!! #define macros value with 2D arrays player data
Reply With Quote #1

you must create an array with 33 rows (that means MAX_PLAYERS + 1 in below code) to store players id and have different values of that array for every player

this is how i would start it, maybe this help you

PHP Code:
#include <amxmodx>

enum _:PLAYER_DATA 
{
    
P_NAME[MAX_NAME_LENGTH],
    
P_AUTHID[MAX_AUTHID_LENGTH],
    
P_MONEY,
    
P_LEVEL,
    
P_EXPERIENCE
}

enum _:PLAYER_POWERS
{
    
bool:hasInvis,
    
bool:isInvis,
    
bool:usedInvis,
    
bool:hasDmgMult,
    
dmgMultLevel,
}

new 
g_ePlayerData[MAX_PLAYERS 1][PLAYER_DATA];
new 
g_ePlayerPowers[MAX_PLAYERS 1][PLAYER_POWERS];

public 
client_authorized(id)
{
    
get_user_name(idg_ePlayerData[id][P_NAME], charsmax(g_ePlayerData[][P_NAME]))
    
get_user_authid(idg_ePlayerData[id][P_AUTHID], charsmax(g_ePlayerData[][P_AUTHID]));
    
g_ePlayerData[id][P_MONEY] = 0
    g_ePlayerData
[id][P_LEVEL] = 0
    g_ePlayerData
[id][P_EXPERIENCE] = 0

    g_ePlayerPowers
[id][hasInvis] = false;
    
g_ePlayerPowers[id][isInvis] = false;
    
g_ePlayerPowers[id][usedInvis] = false;
    
g_ePlayerPowers[id][hasDmgMult] = false;
    
g_ePlayerPowers[id][dmgMultLevel] = 0;

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 15:34.


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