Achievement System - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Achievement System (
/showthread.php?tid=643861)
Achievement System -
RoyalEmpire - 29.10.2017
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
Re: Achievement System -
zMason - 29.10.2017
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;
Re: Achievement System -
10MIN - 29.10.2017
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.
Re: Achievement System -
RoyalEmpire - 29.10.2017
Quote:
Originally Posted by 10MIN
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
Re: Achievement System -
zMason - 29.10.2017
Quote:
Originally Posted by RoyalEmpire
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.
Re: Achievement System -
RoyalEmpire - 29.10.2017
Quote:
Originally Posted by zMason
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
Re: Achievement System -
AjaxM - 29.10.2017
Quote:
Originally Posted by RoyalEmpire
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.