Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // [!] Here, after login, we see a dialog with the all characters of user
- //
- //______________________________________________________________________
- /*---------------------------------------------------------------------------------*/
- forward ShowCharacters(playerid);
- public ShowCharacters(playerid)
- {
- new query[256];
- format(query, sizeof(query), "SELECT * FROM `server_characters` WHERE id_account=%d", AccountInfo[playerid][Account_ID]);
- mysql_tquery(dbhandle, query, "ChoixPersonnage", "i", playerid);
- return 1;
- }
- forward ChoixPersonnage(playerid);
- public ChoixPersonnage(playerid)
- {
- new rows,
- fields,
- // string[256],
- //count,
- name[64];
- cache_get_data(rows, fields);
- if(rows)
- {
- new content[500];
- for(new i; i < rows; i++)
- {
- cache_get_field_content(i, "username", name);
- //format(string, sizeof(string),"Personnage: {FFFFFF}%s", name);
- //SendClientMessage(playerid, -1, string);
- format(content, sizeof(content), "%s%s\n", content, name);
- ShowPlayerDialog(playerid, DIALOG_CHOIX_PERSO, DIALOG_STYLE_LIST, "Choix de votre personnage", content, "Valider", "Quitter");
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_ADMIN, "Erreur: Votre personnage n'est pas activé !");
- }
- return 1;
- }
- // [!] Now, I press on an character of my account
- //
- //______________________________________________________________________
- case DIALOG_CHOIX_PERSO:
- {
- new query[600];
- format(query, sizeof(query), "SELECT * FROM `server_characters` WHERE id_account=%d", AccountInfo[playerid][Account_ID]);
- mysql_tquery(dbhandle, query, "Load_Character", "i", playerid);
- }
- /*---------------------------------------------------------------------------------*/
- forward Load_Character(playerid);
- public Load_Character(playerid)
- {
- new rows,
- fields,
- string[600],
- string2[600];
- cache_get_data(rows, fields);
- if(rows)
- {
- new cid = cache_get_field_content_int(0, "id");
- new skinid = cache_get_field_content_int(0, "skin_player");
- new statutcompte = cache_get_field_content_int(0, "statut_character");
- new name[64];
- cache_get_field_content(0, "username", name);
- //SetPlayerName(playerid, PlayerInfo[playerid][p_Username]);
- format(string, sizeof(string), "Votre personnage (n°%d) avec le pseudo %s portant le skin %d | Statut du personnage: %d", cid, name, skinid, statutcompte);
- SendClientMessage(playerid, COLOR_ADMIN, string);
- SendClientMessage(playerid, COLOR_ADMIN, "____________________________________");
- format(string2, sizeof(string2), "Voici un aperçu des stats de votre personnage choisi:\n\nID: %d\nPersonnage: %s\nSkin: %d\nStatut du personnage: %d", cid, name, skinid, statutcompte);
- ShowPlayerDialog(playerid, DIALOG_INFO_PERSO, DIALOG_STYLE_MSGBOX, "Information concernant votre personnage", string2, "SPAWN", "");
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment