18.11.2014, 07:07
Well, here it is.
I'm wondering, how to Link the Master Account with the Character. In MySQL, you simple can do:
mysql_function_query(connectionHandle, "SELECT `username` FROM `playerCharacters` WHERE `masteraccountID` = 1291", true, "loadAccounts", "d", playerid);
pawn Код:
// Master Account Information
enum pInfo
{
pID,
Password,
Admin,
}
new PlayerInfo[MAX_PLAYERS][pInfo];
// Character Information
enum cInfo
{
mID,
}
new Character[MAX_CHARACTERS][cInfo];
// Under OnDialogResponse
case DIALOG_REGISTER:
{
if (!response) return Kick(playerid);
if(response)
{
if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, "Register","You haven't entered anything. Please enter a password to Proceed.","Register","Quit");
PlayerInfo[playerid][Password] = udb_hash(inputtext);
SavePlayer(playerid);
}
}
mysql_function_query(connectionHandle, "SELECT `username` FROM `playerCharacters` WHERE `masteraccountID` = 1291", true, "loadAccounts", "d", playerid);