Achievement System
#1

guys i m working on
Achievement system
i need help
when i do /ach
it shows me
Achievement1 : Sucide [LOCKED]
Achievement2 [LOCKED]
Achievement3 [LOCKED]
Achievement4 [LOCKED]
Achievement5 [LOCKED]
Achievement6 [LOCKED]
Achievement7 [LOCKED]

but if i kill my self how can i do tht it will show
Achievement1 : Sucide [UNLOCKED]

help me to do it Unlocked pls

thnx +rep pls help me
Reply
#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
#3

Use bools for the Locked / UnLocked state, and a dialog as a "achievement viewer". And when you do something that is in your next achievement switch the bool to true.
PS: This is the system "in a nutshell". Good luck with it.
Reply
#4

Quote:
Originally Posted by 10MIN
View Post
Use bools for the Locked / UnLocked state, and a dialog as a "achievement viewer". And when you do something that is in your next achievement switch the bool to true.
PS: This is the system "in a nutshell". Good luck with it.
can you give me an example of making that pls
Reply
#5

Quote:
Originally Posted by RoyalEmpire
View Post
can you give me an example of making that pls
What's wrong with my example? It's everything he said except I didn't use booleans to keep it more simple for you.
Reply
#6

Quote:
Originally Posted by zMason
View Post
What's wrong with my example? It's everything he said except I didn't use booleans to keep it more simple for you.
make achievement of death in ur example then give me again ok

thnx
Reply
#7

Quote:
Originally Posted by RoyalEmpire
View Post
make achievement of death in ur example then give me again ok

thnx
We are not here to create codes for you. This section is only available for you if you are requesting for a help, not requesting for script.

He gave you an example, be thankful and update it for your use.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)