Raised This Month: $ Target: $400
 0% 

Achievements Stop Counting


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
MokeN
Senior Member
Join Date: Jan 2012
Location: Vaasa, Finland
Old 08-19-2012 , 04:11   Achievements Stop Counting
Reply With Quote #1

Heey

I made an achievement plugin an month ago, but i got a problem with it.
It doesn't stop counting when you've made the achievement..

Example:

Assasin II | 1432/1100

The 1100 is the requirement.

How do i fix this?

PHP Code:

public Event_DeathMsg()
{
    new 
iKiller read_data(1)
    new 
iVictim read_data(2)
    
    new 
weapon_name[24]
    
    
get_user_name(iKillerszName32)
    
    if(
is_user_alive(iKiller) && get_user_team(iKiller) != get_user_team(iVictim))
    {
        
Achievement[iKiller][MURDER]++
    
        if(
Achievement[iKiller][MURDER] == AchRequirement[MURDER])
        {
            
TotalAchievements[iKiller]++
            
emit_sound(iKillerCHAN_STATICgSoundAch1.0ATTN_NORM0PITCH_NORM);
            
ColorChat(0GREY"%s^4 %s^3 successfully unlocked the achievement^4 %s^3 and earned ^4%i $."prefixszNameAchName[MURDER], AchPoints[MURDER])
            
jbcash_add_user_cash(iKillerjbcash_get_user_cash(iKiller) + AchPoints[MURDER])    
                
            
SaveData(iKiller)
            }
        }
    }
    return 
PLUGIN_CONTINUE

Thanks in advance
__________________
Private Works:
- Achievements, HNS & JB Menus, HNS & JB Shops

mY BlockMaker - mY Steam - mY Game Menu
MokeN is offline
Send a message via Skype™ to MokeN
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 08-19-2012 , 05:16   Re: Achievements Stop Counting
Reply With Quote #2

PHP Code:
public Event_DeathMsg()
{
    new 
iKiller read_data(1)
    new 
iVictim read_data(2)
    
    new 
weapon_name[24]
    
    
get_user_name(iKillerszName32)
    
    if(
is_user_alive(iKiller) && get_user_team(iKiller) != get_user_team(iVictim))
    {
        if(
Achievement[iKiller][MURDER] == AchRequirement[MURDER])
        {
            
TotalAchievements[iKiller]++
            
emit_sound(iKillerCHAN_STATICgSoundAch1.0ATTN_NORM0PITCH_NORM);
            
ColorChat(0GREY"%s^4 %s^3 successfully unlocked the achievement^4 %s^3 and earned ^4%i $."prefixszNameAchName[MURDER], AchPoints[MURDER])
            
jbcash_add_user_cash(iKillerjbcash_get_user_cash(iKiller) + AchPoints[MURDER])    
            
            
SaveData(iKiller)
        } else {
            
Achievement[iKiller][MURDER]++
        }
    }
    return 
PLUGIN_CONTINUE

__________________
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 08-19-2012 , 06:39   Re: Achievements Stop Counting
Reply With Quote #3

With napoleon code, once MURDER achievement is reached, on each kill code would consider that achievement has just been reached.
You should use similar code but make something to check whether player has already reached required kills or not.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
MokeN
Senior Member
Join Date: Jan 2012
Location: Vaasa, Finland
Old 08-19-2012 , 14:32   Re: Achievements Stop Counting
Reply With Quote #4

Thanks, both of you!
__________________
Private Works:
- Achievements, HNS & JB Menus, HNS & JB Shops

mY BlockMaker - mY Steam - mY Game Menu
MokeN is offline
Send a message via Skype™ to MokeN
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 05:50.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode