Assigning ID's to self created achievements
#1

Hi

I'm creating achievements for my GM
And I use this function to create a new one:
pawn Код:
stock AddAchievement(aid, name[56], info[126], money, gld)
{
    format(AInfo[currentachieveslot][Name], 56, "%s", name);
    format(AInfo[currentachieveslot][Info], 56, "%s", info);

    AInfo[currentachieveslot][Aid] = aid;
    AInfo[currentachieveslot][Money] = money;
    AInfo[currentachieveslot][Gold] = gld;

    return currentachieveslot, currentachieveslot ++;
}
Well now what I was trying to do is assigning id's to these achievements so that I could easly select information from an achievement.

So here's what I tried doing:

pawn Код:
billgates = AddAchievement(billgates, "Bill Gates", "Get over 1 billion $$$", 20000, 0);
    shumacher = AddAchievement(shumacher, "Shumacher", "Win 50 races", 20000, 0);
    fanatic = AddAchievement(fanatic, "Fanatic player", "Play over 12 hours", 20000, 0);
    flagchamp = AddAchievement(flagchamp, "Flag champion", "Keep the /flag for over 20 minuts", 20000, 0);
    killerbee = AddAchievement(killerbee, "Killerbee", "Kill 500 people", 20000, 0);
    serialkiller = AddAchievement(serialkiller, "Serial killer", "Kill 1000 people", 20000, 0);
However when I tried then later using those ID's like this:
pawn Код:
stock CheckForAchievements(playerid)
{
    if(PInfo[playerid][Money] == 1000000000) Achieve(playerid, billgates);
    if(PInfo[playerid][RacesWon] == 50) Achieve(playerid, shumacher);
    if(PInfo[playerid][Score] == 12*60) Achieve(playerid, fanatic);
    if(PInfo[playerid][Kills] == 500) Achieve(playerid, killerbee);
    if(PInfo[playerid][Kills] == 1000) Achieve(playerid, serialkiller);
   
    return 1;
}

stock Achieve(playerid, achieveid)
{
    SendClientMessage(playerid, -1, AInfo[achieveid][Name]);
    return 1;
}
It gives me several errors:
Код:
C:\Users\Els\Documents\GTA San Andreas User Files\Server\VintageStunts3\gamemodes\TerribleStuntsYINI.pwn(5485) : error 012: invalid function call, not a valid address
C:\Users\Els\Documents\GTA San Andreas User Files\Server\VintageStunts3\gamemodes\TerribleStuntsYINI.pwn(5485) : warning 215: expression has no effect
C:\Users\Els\Documents\GTA San Andreas User Files\Server\VintageStunts3\gamemodes\TerribleStuntsYINI.pwn(5485) : warning 215: expression has no effect
C:\Users\Els\Documents\GTA San Andreas User Files\Server\VintageStunts3\gamemodes\TerribleStuntsYINI.pwn(5485) : error 001: expected token: ";", but found ")"
C:\Users\Els\Documents\GTA San Andreas User Files\Server\VintageStunts3\gamemodes\TerribleStuntsYINI.pwn(5485) : error 029: invalid expression, assumed zero
C:\Users\Els\Documents\GTA San Andreas User Files\Server\VintageStunts3\gamemodes\TerribleStuntsYINI.pwn(5485) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
Any help is appreciated,
thanks in advance
Reply


Messages In This Thread
Assigning ID's to self created achievements - by knackworst - 29.11.2013, 20:11
Re: Assigning ID's to self created achievements - by Loot - 29.11.2013, 20:26
Re: Assigning ID's to self created achievements - by knackworst - 29.11.2013, 20:32

Forum Jump:


Users browsing this thread: 1 Guest(s)