29.10.2017, 05:48
Here is an example on how you could do it using dialogs:
And to unlock a achievement you just make the specified achievement to 1, e.g. PlayerInfo[playerid][pAchievement][1] = 1;
pawn Code:
new status[50], string[300], info[800];
for(new i = 0; i < 7; i++) // Loop through all achievements
{
if(PlayerInfo[playerid][pAchievement][i] == 0) // Checks if Achievement is locked
{
status = "{FF0606}[LOCKED]"; // Storing [LOCKED] in a string
}
else
{
status = "{33AA33}[UNLOCKED]"; // Storing [UNLOCKED] in a string
}
format(string, sizeof(string), "Achievement %d %s\n", i, status); // Making it 1 complete line and storing it in a string
strcat(info, string); // Combining all lines into one string
}
ShowPlayerDialog(playerid, DIALOG_ACHIEVEMENTS, DIALOG_STYLE_LIST, "Achievements", info, "Continue", ""); // Displaying all the lines in a dialog