Getting the name from an enum
#1

So i have this enum for an array here:
pawn Код:
enum pInfo
{
    username,
    password,
    email,
    datejoined,
    id,
    loggedin,
    score,
    money,
    bankstate,
    adminlevel,
    regular,
    armyaccess,
    madexaccess,
    robrank,
    ownedvehicle
};
Im making an sql gamemode and so i have a command saying
pawn Код:
public SavePlayerVariables(playerid)
{
    Players[playerid][money] = GetPlayerMoney(playerid);
    Players[playerid][score] = GetPlayerScore(playerid);
    new update[256],field[256],point,req[256],name[28];
    GetPlayerName(playerid,name,28);
    point = 18;
    format(update,sizeof(update),"UPDATE `users` SET score='%d', money='%d' WHERE username='%s' LIMIT 1",Players[playerid][score],Players[playerid][money],name);
    for(new i = 0; pInfo:i < pInfo; i++)
    {
      format(field,sizeof(field),"%s='%d', ",pInfo:i,Players[playerid][pInfo:i]);
      strins(update,field,point);
      point += sizeof(field);
    }
    format(req,sizeof(req),"WHERE username='%s' LIMIT 1",name);
    strins(update,req,point);*/
    samp_mysql_query(update);
    printf("MySQL Query Executed: %s",update);
    return 1;
}
But what i wanna know is how do i get the name of the actual array i guess ud call it in the enum. Like how do i extract score from the enum pInfo and write it out? when i say that i mean actually write out score, not the variable stored in it. Please help.
Reply


Messages In This Thread
Getting the name from an enum - by tom_jonez - 25.03.2009, 00:29
Re: Getting the name from an enum - by Delused - 25.03.2009, 06:54
Re: Getting the name from an enum - by Dujma - 25.03.2009, 10:10
Re: Getting the name from an enum - by MenaceX^ - 25.03.2009, 10:38
Re: Getting the name from an enum - by tom_jonez - 25.03.2009, 10:44
Re: Getting the name from an enum - by MenaceX^ - 25.03.2009, 10:46
Re: Getting the name from an enum - by tom_jonez - 25.03.2009, 10:51
Re: Getting the name from an enum - by MenaceX^ - 25.03.2009, 10:52
Re: Getting the name from an enum - by ICECOLDKILLAK8 - 25.03.2009, 11:01
Re: Getting the name from an enum - by MenaceX^ - 25.03.2009, 11:01

Forum Jump:


Users browsing this thread: