Jetzt habe ich es wie folgt gemacht aber wenn die Registrierung durch ist ist die Char auswahl leer.
FUNCTION AccountRegister(playerid)
{
new string[512];
AccountInfo[playerid][account_ID] = cache_insert_id();
AccountInfo[playerid][account_Eingeloggt] = true;
/*AccountInfo[playerid][account_MaxChars] = 1;
AccountInfo[playerid][account_Admin] = 0;
AccountInfo[playerid][account_Verwalter][0] = 0;
AccountInfo[playerid][account_Verwalter][1] = 0;
AccountInfo[playerid][account_Verwalter][2] = 0;
AccountInfo[playerid][account_Verwalter][3] = 0;
AccountInfo[playerid][account_Slot][0] = 0;
AccountInfo[playerid][account_Slot][1] = 0;
AccountInfo[playerid][account_Slot][2] = 0;
AccountInfo[playerid][account_Slot][3] = 0;*/
mysql_format(handle, string, sizeof(string), "SELECT * FROM `account_team` WHERE `accountid` = '%d'", AccountInfo[playerid][account_ID]);
mysql_tquery(handle, string, "OnTeamCheck", "d", playerid);
mysql_format(handle, string, sizeof(string), "SELECT * FROM `character_pos` WHERE `accountid` = '%d'", AccountInfo[playerid][account_ID]);
mysql_tquery(handle, string);
mysql_format(handle, string, sizeof(string), "INSERT INTO `character` (`accountid`,`name`,`slot`, `skin`,`gender`,`register`,`lastlogin`) VALUES ('%d','Keiner','1','0','0','00.00.0000 | 00:00:00','00.00.0000 | 00:00:00')",AccountInfo[playerid][account_ID]);
mysql_format(handle, string, sizeof(string), "INSERT INTO `character_pos` (`accountid`,`x`,`y`,`z`,`r`,`interior`,`world`) VALUES ('%d','1480.5341','-1770.5804','18.7958','0.3109','0','0')",AccountInfo[playerid][account_ID]);
mysql_tquery(handle, string);
mysql_format(handle, string, sizeof(string), "INSERT INTO `character` (`accountid`,`name`,`slot`, `skin`,`gender`,`register`,`lastlogin`) VALUES ('%d','Keiner','2','0','0','00.00.0000 | 00:00:00','00.00.0000 | 00:00:00')",AccountInfo[playerid][account_ID]);
mysql_format(handle, string, sizeof(string), "INSERT INTO `character_pos` (`accountid`,`x`,`y`,`z`,`r`,`interior`,`world`) VALUES ('%d','1480.5341','-1770.5804','18.7958','0.3109','0','0')",AccountInfo[playerid][account_ID]);
mysql_tquery(handle, string);
mysql_format(handle, string, sizeof(string), "INSERT INTO `character` (`accountid`,`name`,`slot`, `skin`,`gender`,`register`,`lastlogin`) VALUES ('%d','Keiner','3','0','0','00.00.0000 | 00:00:00','00.00.0000 | 00:00:00')",AccountInfo[playerid][account_ID]);
mysql_format(handle, string, sizeof(string), "INSERT INTO `character_pos` (`accountid`,`x`,`y`,`z`,`r`,`interior`,`world`) VALUES ('%d','1480.5341','-1770.5804','18.7958','0.3109','0','0')",AccountInfo[playerid][account_ID]);
mysql_tquery(handle, string);
mysql_format(handle, string, sizeof(string), "INSERT INTO `character` (`accountid`,`name`,`slot`, `skin`,`gender`,`register`,`lastlogin`) VALUES ('%d','Keiner','4','0','0','00.00.0000 | 00:00:00','00.00.0000 | 00:00:00')",AccountInfo[playerid][account_ID]);
mysql_format(handle, string, sizeof(string), "INSERT INTO `character_pos` (`accountid`,`x`,`y`,`z`,`r`,`interior`,`world`) VALUES ('%d','1480.5341','-1770.5804','18.7958','0.3109','0','0')",AccountInfo[playerid][account_ID]);
mysql_tquery(handle, string);
mysql_format(handle, string, sizeof(string), "SELECT * FROM `character` WHERE `accountid` = '%d'", AccountInfo[playerid][account_ID]);
mysql_tquery(handle, string, "ShowCharacter", "d", playerid);
//mysql_format(handle, string, sizeof(string), "UPDATE `accounts` SET `maxchars` = '%d' WHERE `id` = '%d'",1,AccountInfo[playerid][account_ID]);
//mysql_tquery(handle, string);
return 1;
}
Alles anzeigen
FUNCTION ShowCharacter(playerid)
{
new rows, Slot, c1[255],c2[255],c3[255],c4[255],string[255],string1[80],string2[80];
cache_get_row_count(rows);
if(rows == 0 && !AccountInfo[playerid][account_Slot][0] && !AccountInfo[playerid][account_Slot][1] && !AccountInfo[playerid][account_Slot][2] && !AccountInfo[playerid][account_Slot][3])
{
format(string2, sizeof(string2), "{FF0000}%s{FFFFFF} - {FFFFFF}Charakter - Übersicht",ServerInfo[0][server_Name]);
ShowPlayerDialog(playerid,DIALOG_CHARACTER,DIALOG_STYLE_LIST,string2,"{FFFFFF}Neuen Charakter anlegen\nNeuen Charakter anlegen\nNeuen Charakter anlegen\nNeuen Charakter anlegen","{FFFFFF}Weiter","{FFFFFF}Abbrechen");
return 1;
}
else
{
for(new i; i<rows; i++)
{
cache_get_value_name_int(i, "slot", Slot);
switch(Slot)
{
case 1:
{
if(AccountInfo[playerid][account_Slot][0])
{
cache_get_value_name(i, "name", c1, sizeof(c1));
}
else
{
format(c1,255,"{FFFFFF}Neuen Charakter anlegen");
}
}
case 2:
{
if(AccountInfo[playerid][account_Slot][1])
{
cache_get_value_name(i, "name", c2, sizeof(c2));
}
else
{
format(c2,255,"{FFFFFF}Neuen Charakter anlegen");
}
}
case 3:
{
if(AccountInfo[playerid][account_Slot][2])
{
cache_get_value_name(i, "name", c3, sizeof(c3));
}
else
{
format(c3,255,"{FFFFFF}Neuen Charakter anlegen");
}
}
case 4:
{
if(AccountInfo[playerid][account_Slot][3])
{
cache_get_value_name(i, "name", c4, sizeof(c4));
}
else
{
format(c4,255,"{FFFFFF}Neuen Charakter anlegen");
}
}
}
}
}
format(string,255,"{FFFFFF}IC-Name\n%s\n%s\n%s\n%s",c1,c2,c3,c4);
format(string1, sizeof(string1), "{FF0000}%s{FFFFFF} - {FFFFFF}Charakter - Übersicht",ServerInfo[0][server_Name]);
ShowPlayerDialog(playerid,DIALOG_CHARACTER,DIALOG_STYLE_TABLIST_HEADERS,string1,string,"{FFFFFF}Weiter","{FFFFFF}Abbrechen");
return 1;
}
Alles anzeigen