View Single Post
Kxnrl
AlliedModders Donor
Join Date: May 2015
Old 07-08-2017 , 21:23   Re: Simple Player logger plugin (problem with enums)
Reply With Quote #5

Code:
#pragma newdecls required

enum e_PlayerStats {
	String:SteamID[64],
	Float:Coins,
	Kills
	//int deaths,
	//int assists,
	//int points,
};

e_PlayerStats g_PlayerStats[MAXPLAYERS + 1][e_PlayerStats];

public bool isClientsDataStored(int client, const char[] steamid)
{
    //char[] g_steamid = g_PlayerStats[client][SteamID]; // E: expected token: "-string-", but found "-identifier-"
    
	//if( StrEqual(g_PlayerStats[client][SteamID] , steamid) ){
	//	return true	
	//} else {
	//	return false;
	//}
    
    return StrEqual(g_PlayerStats[client][SteamID] , steamid);
}

//stock e_PlayerStats getClientsData(int client){
//	return g_PlayerStats[client];
//}

public void storeNewClientData(char[] steamid, int client, float coins){
	//g_PlayerStats[client][SteamID] = steamid; //E: expression has no effect, E: expected token : ";" but found "["
    strcopy(g_PlayerStats[client][SteamID], 64, steamid);
	g_PlayerStats[client][Coins] = coins;
}
__________________
Kxnrl is offline