Achievement System
#2

Here is an example on how you could do it using dialogs:
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
And to unlock a achievement you just make the specified achievement to 1, e.g. PlayerInfo[playerid][pAchievement][1] = 1;
Reply


Messages In This Thread
Achievement System - by RoyalEmpire - 29.10.2017, 05:22
Re: Achievement System - by zMason - 29.10.2017, 05:48
Re: Achievement System - by 10MIN - 29.10.2017, 06:00
Re: Achievement System - by RoyalEmpire - 29.10.2017, 06:55
Re: Achievement System - by zMason - 29.10.2017, 07:08
Re: Achievement System - by RoyalEmpire - 29.10.2017, 08:20
Re: Achievement System - by AjaxM - 29.10.2017, 09:13

Forum Jump:


Users browsing this thread: 1 Guest(s)