[Include] :: iAchieve :: Dynamic Achievement System - (Notify-on-achieve) (Stylish Textdraws) (uses Y_INI for saving/loading)
#21

@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");
}
Reply
#22

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 ?
Reply
#23

Good job, maybe a MySQL version next?
Reply
#24

Awesome dude!!
Reply
#25

@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.
Reply
#26

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)
Reply
#27

That's fantastic

EDIT: Re-Downloaded, but I can't see the textdraws (Like Michael)
Reply
#28

Good Work! iPLEOMAX.
Reply
#29

Pretty Nice Good Work!
Reply
#30

Nice textdraw!, And aslo nice job
Reply
#31

I just love your scripts Ipleomax!
Reply
#32

If i use the include, the server crashes O,o
Reply
#33

Wow, this is really nice, im gonna to use this in my server. thanks.
Reply
#34

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
Reply
#35

Bump. Any suggestions?
Reply
#36

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!
Reply
#37

Quote:
Originally Posted by nickdodd25
View Post
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.. >.>
Reply
#38

COOOL
Reply
#39

Quote:
Originally Posted by nickdodd25
View Post
Dumb question, where do i put that? Couldnt find it to replace.
Try this: http://pastebin.com/0kcm5ww8
Reply
#40

Quote:
Originally Posted by iPLEOMAX
View Post
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.....
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)