Re: :: iAchieve :: Dynamic Achievement System - (Notify-on-achieve) (Stylish Textdraws) (uses Y_INI for saving/loading) -
iPLEOMAX - 24.08.2011
@Michael, you don't have to check for achievements, it's done by the include.

And according to your achievement method, you should use SetPlayerAchievement:
pawn Код:
new points;
//OnGameModeInit:
points = CreateAchievement("50 Points","Congratz, you have over 50 points !! ~n~ Now you can use the Vehicle Missiles ! (/addmissiles)",50);
public OnPlayerSpawn(playerid) //or somewhere where you'd like to update the ach value with the score. (Normally Spawn)
{
SetPlayerAchievement( playerid, points, GetPlayerScore(playerid) ); //So If he reaches fifty score, he gets the ach.
return true;
}
public OnPlayerAchieve( playerid, achid )
{
if(achid == points) SendClientMessage(playerid,COLOR_GREEN, "Congratz ! You just got an achievement");
}
Re: :: iAchieve :: Dynamic Achievement System - (Notify-on-achieve) (Stylish Textdraws) (uses Y_INI for saving/loading) -
Michael@Belgium - 25.08.2011
Quote:
Originally Posted by iPLEOMAX
@Michael, you don't have to check for achievements, it's done by the include. 
And according to your achievement method, you should use SetPlayerAchievement:
pawn Код:
new points; //OnGameModeInit: points = CreateAchievement("50 Points","Congratz, you have over 50 points !! ~n~ Now you can use the Vehicle Missiles ! (/addmissiles)",50);
public OnPlayerSpawn(playerid) //or somewhere where you'd like to update the ach value with the score. (Normally Spawn) { SetPlayerAchievement( playerid, points, GetPlayerScore(playerid) ); //So If he reaches fifty score, he gets the ach. return true; }
public OnPlayerAchieve( playerid, achid ) { if(achid == points) SendClientMessage(playerid,COLOR_GREEN, "Congratz ! You just got an achievement"); }
|
Hmm thanks but still don't see it XD I went from 49 points to 53 points or it MUST be 50 ?
Re: :: iAchieve :: Dynamic Achievement System - (Notify-on-achieve) (Stylish Textdraws) (uses Y_INI for saving/loading) -
Lefon - 25.08.2011
Good job, maybe a MySQL version next?
AW: :: iAchieve :: Dynamic Achievement System - (Notify-on-achieve) (Stylish Textdraws) (uses Y_INI for saving/loading) -
umarmalik - 25.08.2011
Awesome dude!!
Re: :: iAchieve :: Dynamic Achievement System - (Notify-on-achieve) (Stylish Textdraws) (uses Y_INI for saving/loading) -
iPLEOMAX - 25.08.2011
@Michael: Just spotted a bug with this function: SetPlayerAchievement(); Fixed it.
You may please re-download and retry the code. Thanks!
@Lefon: MySQL, I need to learn it first. I'll try it.
@umarmalik: Thanks.
Re: :: iAchieve :: Dynamic Achievement System - (Notify-on-achieve) (Stylish Textdraws) (uses Y_INI for saving/loading) -
Michael@Belgium - 25.08.2011
Quote:
Originally Posted by iPLEOMAX
@Michael: Just spotted a bug with this function: SetPlayerAchievement(); Fixed it.
You may please re-download and retry the code. Thanks!
@Lefon: MySQL, I need to learn it first. I'll try it.
@umarmalik: Thanks.
|
Ah lol

didn't know it was a bug

And thanks for fixing (and ye it works now ;p)
Re: :: iAchieve :: Dynamic Achievement System - (Notify-on-achieve) (Stylish Textdraws) (uses Y_INI for saving/loading) -
Sasino97 - 17.09.2011
That's fantastic
EDIT: Re-Downloaded, but I can't see the textdraws (Like Michael)
Re: :: iAchieve :: Dynamic Achievement System - (Notify-on-achieve) (Stylish Textdraws) (uses Y_INI for saving/loading) -
Davz*|*Criss - 20.09.2011
Good Work! iPLEOMAX.
Re: :: iAchieve :: Dynamic Achievement System - (Notify-on-achieve) (Stylish Textdraws) (uses Y_INI for saving/loading) -
Edvin - 20.09.2011
Pretty Nice Good Work!
Re: :: iAchieve :: Dynamic Achievement System - (Notify-on-achieve) (Stylish Textdraws) (uses Y_INI for saving/loading) -
davve95 - 10.01.2012
Nice textdraw!, And aslo nice job
Re: :: iAchieve :: Dynamic Achievement System - (Notify-on-achieve) (Stylish Textdraws) (uses Y_INI for saving/loading) -
justsomeguy - 10.01.2012
I just love your scripts Ipleomax!
Re: :: iAchieve :: Dynamic Achievement System - (Notify-on-achieve) (Stylish Textdraws) (uses Y_INI for saving/loading) -
geerdinho8 - 24.01.2012
If i use the include, the server crashes O,o
Respuesta: :: iAchieve :: Dynamic Achievement System - (Notify-on-achieve) (Stylish Textdraws) (uses Y_INI for saving/lo -
[Nikk] - 24.01.2012
Wow, this is really nice, im gonna to use this in my server. thanks.
Re: :: iAchieve :: Dynamic Achievement System - (Notify-on-achieve) (Stylish Textdraws) (uses Y_INI for saving/loading) -
nickdodd25 - 03.03.2012
When i added a achieve to test this is what i got....
Code:
[19:54:42] [debug] Run time error 6: "Invalid instruction"
[19:54:42] [debug] Invalid opcode 0x7800 at address 0xFFFFFFFB
[19:54:42] [debug] Backtrace (most recent call first):
[19:54:42] [debug] #0 public OnObjectMoved()+0xffffffff from TruckersInc.amx
[19:54:42] [debug] Run time error 6: "Invalid instruction"
[19:54:42] [debug] Invalid opcode 0x7800 at address 0xFFFFFFFB
[19:54:42] [debug] Backtrace (most recent call first):
[19:54:42] [debug] #0 public OnObjectMoved()+0xffffffff from TruckersInc.amx
[17:17:28] [debug] Run time error 4: "Array index out of bounds"
[17:17:28] [debug] Accessing element at index 10 past array upper bound 121
[17:17:28] [debug] Backtrace (most recent call first):
[17:17:28] [debug] #0 public AchCheck()+0x880f8 from TruckersInc.amx
[17:17:30] [debug] Run time error 4: "Array index out of bounds"
[17:17:30] [debug] Accessing element at index 10 past array upper bound 121
[17:17:30] [debug] Backtrace (most recent call first):
[17:17:30] [debug] #0 public AchCheck()+0x880f8 from TruckersInc.amx
Now the public AchCheck() is in the include itself and i even reinstalled the include from pastebin, and the OnObjectMoved() one i dont even have any where.....and when i remove my test achiev every thing goes away and there is no run time errors or invalid opticodes....but what gets me is it worked yesterday untill i had a problem with F streamer intefering with it so i got rid of the streamer and now i get that.
Also here is the achieve i made...
pawn Code:
new Ach_PlayerConnect;
//in OnGameModeInti
Ach_PlayerConnect = CreateAchievement("Loyal Player","Good Job!!!~n~Thank you for Comming back to Truckers Inc!!~n~+$100000 and +10 score", 2);//2 just to test it
//
public OnPlayerAchieve( playerid, achid )
{
if(achid == Ach_PlayerConnect)
{
RewardPlayer(playerid, 100000, 0); SetPlayerScore(playerid, GetPlayerScore(playerid)+10);
SendClientMessageToAll(0xFF0000FF, "Someone Just got the Loayalty Achievement!");
}
return 1;
}
public OnPlayerSpawn(playerid)
{
GivePlayerAchievement(playerid, Ach_PlayerConnect, 1);
//rest of my code
Any error in my code?
Thanks
Nick
Re: :: iAchieve :: Dynamic Achievement System - (Notify-on-achieve) (Stylish Textdraws) (uses Y_INI for saving/loading) -
nickdodd25 - 06.03.2012
Bump. Any suggestions?
Re: :: iAchieve :: Dynamic Achievement System - (Notify-on-achieve) (Stylish Textdraws) (uses Y_INI for saving/loading) -
Ballu Miaa - 06.03.2012
Gonna use it for sure. Good work Pleo! But i got one doubt ? As in the example above! We'r talking about fist kills , isnt it?
How can we define that if the player kills with the Sniper only. Then the AchKill goes AchKill++ only! Else it wont increment?
Anyway to do that using this? Thanks for sharing!
Re: :: iAchieve :: Dynamic Achievement System - (Notify-on-achieve) (Stylish Textdraws) (uses Y_INI for saving/loading) -
iPLEOMAX - 06.03.2012
Quote:
Originally Posted by nickdodd25
Bump. Any suggestions?
|
I noticed some bugs, hmm, I'll see if I have time to release next version with all fixes.
Though you can try to replace all "for(new a=1; a<=MAX_ACHIEVEMENTS; a++)" to
"for(new a=0; a<MAX_ACHIEVEMENTS; a++)"
My old works really need to be updated.. >.>
Re: :: iAchieve :: Dynamic Achievement System - (Notify-on-achieve) (Stylish Textdraws) (uses Y_INI for saving/loading) -
SpiderWalk - 06.03.2012
COOOL
Re: :: iAchieve :: Dynamic Achievement System - (Notify-on-achieve) (Stylish Textdraws) (uses Y_INI for saving/loading) -
iPLEOMAX - 06.03.2012
Quote:
Originally Posted by nickdodd25
Dumb question, where do i put that? Couldnt find it to replace.
|
Try this:
http://pastebin.com/0kcm5ww8
Re: :: iAchieve :: Dynamic Achievement System - (Notify-on-achieve) (Stylish Textdraws) (uses Y_INI for saving/loading) -
nickdodd25 - 06.03.2012
Quote:
Originally Posted by iPLEOMAX
|
still get codes like this...
Code:
[14:22:03] [debug] Run time error 6: "Invalid instruction"
[14:22:03] [debug] Invalid opcode 0x7800 at address 0xFFFFFFFB
[14:22:03] [debug] Backtrace (most recent call first):
[14:22:03] [debug] #0 public OnObjectMoved()+0xffffffff from TruckersInc.amx
[14:22:03] [debug] Run time error 6: "Invalid instruction"
[14:22:03] [debug] Invalid opcode 0x7800 at address 0xFFFFFFFB
[14:22:03] [debug] Backtrace (most recent call first):
[14:22:03] [debug] #0 public OnObjectMoved()+0xffffffff from TruckersInc.amx
they still only come up when people are on the server but when no one is on nothing happens. and i couldnt find that public anywhere in the gamemode.....