Hi, i need a little help to save a 3d array into mysql db
I need to know how to create a table for do this.
I have this array:
PHP Code:
#include <amxmodx>
new g_iMaxPlayers;
#define IsPlayer(%0) (1 <= %0 <= g_iMaxPlayers)
enum _:Stats
{
KILLS = 0,
DEATHS,
HEADSHOTS,
SHOTS,
DAMAGE,
HITS
};
#define MAX_PLAYERS 33
#define MAX_WEAPONS 33
#define MAX_STATS 6
new g_iWeapon[MAX_PLAYERS][MAX_WEAPONS][Stats]; //
public plugin_init()
{
register_plugin("CS Stats Test",AMXX_VERSION_STR,"Amxx Dev Team");
register_event("DeathMsg","ev_DeathMsg","a","1>0","2>0");
g_iMaxPlayers = get_maxplayers();
}
public ev_DeathMsg()
{
new iVictim = read_data(2);
new iKiller = get_user_attacker(iVictim);
new iWeapon = get_user_weapon(iKiller);
g_iWeapon[iVictim][iWeapon][DEATHS]++;
if(IsPlayer(iKiller) && (iKiller != iVictim))
{
g_iWeapon[iKiller][iWeapon][KILLS]++;
if(read_data(3)) g_iWeapon[iKiller][iWeapon][HEADSHOTS]++;
}
new szName[2][32],szWeapon[32];
get_user_name(iKiller,szName[0],charsmax(szName[]));
get_user_name(iVictim,szName[1],charsmax(szName[]));
get_weaponname(iWeapon,szWeapon,charsmax(szWeapon));
replace_all(szWeapon,charsmax(szWeapon),"weapon_","");
client_print
(
0,
print_center,
"%s Killed %s with their %s",
szName[0],
szName[1],
szWeapon
);
}
__________________