29.11.2013, 20:11
Hi
I'm creating achievements for my GM
And I use this function to create a new one:
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:
However when I tried then later using those ID's like this:
It gives me several errors:
Any help is appreciated,
thanks in advance
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 ++;
}
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);
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;
}
Код:
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.
thanks in advance