[help]Achieventment problem changing color help
#1

Hey all i am making 1 achievement system for my server , like if a player type /myachievements he get a dialog text box , like 1 achievement is there " To be online for 60 minutes " it will be in red color and after the achievement is Done , then it change color to Green, can anyone teach me how to do this? and teach me with the example?
Reply
#2

First of all, you are going to need a saving and loading system. Do you have it? If not, go read a tutorial and create it first.
Do you know how to make a command? If not, go read a tutorial and create it first.
Do you know how to create dialogs? If not, go read a tutorial and create it in command first.

The achievement handling itself is trivial:
pawn Код:
#define MAX_ACHIEVEMENTS 50
#define MAX_ACHIEVEMENT_NAME 64

static
    Achievements[MAX_ACHIEVEMENTS][MAX_ACHIEVEMENT_NAME],
    bool:PlayerAchievements[MAX_ACHIEVEMENTS][MAX_PLAYERS char]
;

//(...)
//Displaying player achievements with SCM
new
    str[128]
;
for(new i = 0; i != MAX_ACHIEVEMENTS; ++i) {
    format(str, sizeof str, "%s - Achieved? %s", Achievements[i], PlayerAchievements[i]{playerid} ? ("Yup") : ("Nope"));
    SendClientMessage(playerid, 0xBADA55, str);
}
The weird array access ({} instead of []) is for memory savings. It's called char array, search for it on this forum.
Why static? So it is avaialable only in this file (I really hope you don't manage single monsterous pwn file, but modules)
Reply
#3

Dude can you use a example like 60 min online or anything?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)