Raised This Month: $ Target: $400
 0% 

Achievements


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ironskillz1
AlliedModders Donor
Join Date: Jul 2012
Location: Sweden
Old 12-26-2012 , 06:22   Achievements
Reply With Quote #1

need help with my HNS Achievements
i got some problems

1. i doesnt save (when i change map evrything is gone)
2. it doesnt count bunnyjumps in the menu TE.X if you have bunnyhopp 10 times i should say
10/5000

please help me
__________________
I have many private and unique plugins for Jailbreak and Hide'N'Seek. PM me for more info.

Pm me.

Check out my roulette site.

Last edited by YamiKaitou; 01-03-2013 at 15:04.
ironskillz1 is offline
Send a message via Skype™ to ironskillz1
AngeIII
Senior Member
Join Date: Sep 2007
Location: Latvia
Old 12-27-2012 , 10:50   Re: Achievements
Reply With Quote #2

change all vJump[id] to iAchLevel[id][JUMP]

and saving doing with nvault.
to test it just enter the game player some minutes, reconnect and if achievments setted ok, this means that saving good. if not, no steam no support.
__________________
skype: pavle_ivanof
-=ThQ=-
PRIVATE SUPPORT = PAID SUPPORT
AngeIII is offline
Send a message via Skype™ to AngeIII
ironskillz1
AlliedModders Donor
Join Date: Jul 2012
Location: Sweden
Old 12-27-2012 , 12:17   Re: Achievements
Reply With Quote #3

Quote:
Originally Posted by AngeIII View Post
change all vJump[id] to iAchLevel[id][JUMP]

and saving doing with nvault.
to test it just enter the game player some minutes, reconnect and if achievments setted ok, this means that saving good. if not, no steam no support.

Code:
change all vJump[id] to iAchLevel[id][JUMP]
i tested that but it didnt work
and i dont use nosteam look at this picture !




AND! i found another bug it counting other connections to so if i connect and my freind connect i say
you got 2/1000 connections
__________________
I have many private and unique plugins for Jailbreak and Hide'N'Seek. PM me for more info.

Pm me.

Check out my roulette site.

Last edited by ironskillz1; 01-03-2013 at 13:00.
ironskillz1 is offline
Send a message via Skype™ to ironskillz1
AngeIII
Senior Member
Join Date: Sep 2007
Location: Latvia
Old 12-27-2012 , 17:18   Re: Achievements
Reply With Quote #4

line 411
vJump[ id ]++
to
iAchLevel[id][JUMP]++


as for this
PHP Code:
public client_putinserver(id) {
    
iAchLevel[id][CONNECT]++
    switch(
iAchLevel[id][CONNECT]) {
        case 
500: {
            
set_task(2.0"ReachAddict"id// Avoid playing the sound and printing the message to early.
        
}
    }
    
LoadData(id)

hard to determine, why it's called twice for different players, but anyway you can set_task for this and do increement after some time.

PHP Code:
public client_putinserver(id) {
    
set_task(1.0,"clc_put",id);
}
public 
clc_put(id)
{
     if(
is_user_connected(id))
     {
         
iAchLevel[id][CONNECT]++
         switch(
iAchLevel[id][CONNECT]) {
            case 
500: {
              
set_task(2.0"ReachAddict"id// Avoid playing the sound and printing the message to early.
         
}
         
LoadData(id)
     }

and maybe you need firstly to load all data, and after that check if(is_data_loaded[id]) do something..
this is necessary exactly for iAchLevel[id][CONNECT]
cause firstly you increase variable value, and after that with LoadData you reset it!!
__________________
skype: pavle_ivanof
-=ThQ=-
PRIVATE SUPPORT = PAID SUPPORT

Last edited by AngeIII; 12-27-2012 at 17:21.
AngeIII is offline
Send a message via Skype™ to AngeIII
Old 12-27-2012, 17:20
AngeIII
This message has been deleted by AngeIII. Reason: dp
ironskillz1
AlliedModders Donor
Join Date: Jul 2012
Location: Sweden
Old 12-28-2012 , 11:26   Re: Achievements
Reply With Quote #5

It stills dont counting JUMPS and vault doesnt save or load....
but the connection problem is solved



here is the new code:
__________________
I have many private and unique plugins for Jailbreak and Hide'N'Seek. PM me for more info.

Pm me.

Check out my roulette site.

Last edited by ironskillz1; 01-03-2013 at 13:00.
ironskillz1 is offline
Send a message via Skype™ to ironskillz1
AngeIII
Senior Member
Join Date: Sep 2007
Location: Latvia
Old 12-28-2012 , 14:28   Re: Achievements
Reply With Quote #6

with nvault is a lot of problems (such as a nvault is crashing and not loadning at map change.. and other.)

in your case you have called gVaultClose variable in plugin_end function but previosly you don't defined it.
you need to remove gVaultClose variable and use gVault variable instead.

as for jumps, you know that jumps has been calculated only for T?
and also you use threeDimension array OldOrigins, but it's is not needed in this codes.
new vOldOrigin[33][3];

PHP Code:
        static Distance;
        
get_user_originidvOriginid ] );
        
        
Distance get_distancevOldOrigin[id], vOrigin[id] );
        
        if( 
Distance >= 50 )
         {
              
iAchLevel[id][JUMP]++
            
        
                
client_print(id,print_chat,"you have jumped bhop %d",iAchLevel[id][JUMP]);
            if(
iAchLevel[id][JUMP] == 2500)
            {
                
TotalAchievements[read_data(1)]++
                
ColorChat(0GREEN"[Achievements]^1 %s^3 successfully unlocked the achievement^4 Bunnyhopper [1000 Cash Added]"szName)
                
emit_sound(read_data(1), CHAN_STATICszAchievementSound1.0ATTN_NORM0PITCH_NORM)
                
cm_set_user_cash(id1000);
            }
            else if(
iAchLevel[id][JUMP] == 5000)
            {
                
TotalAchievements[read_data(1)]++
                
ColorChat(0GREEN"[Achievements]^1 %s^3 successfully unlocked the achievement^4 Pro Bunnyhopper [2000 Cash Added]"szName)
                
emit_sound(read_data(1), CHAN_STATICszAchievementSound1.0ATTN_NORM0PITCH_NORM)
                
cm_set_user_cash(id2000);
            }
            else if(
iAchLevel[id][JUMP] == 10000)
            {
                
TotalAchievements[read_data(1)]++
                
ColorChat(0GREEN"[Achievements]^1 %s^3 successfully unlocked the achievement^4 Master Bunnyhopper [4000 Cash Added]"szName)
                
emit_sound(read_data(1), CHAN_STATICszAchievementSound1.0ATTN_NORM0PITCH_NORM)
                
cm_set_user_cash(id4000);
            }
            
            
vOldOriginid ] = vOriginid ];
        } 
as for plugin_end .. i think you also need to put loop for saving all players data. (1..players save(id));

and my suggestion for you try to useing SQL, SQLite.. cause it's is better with saving, and in future to integrating with WEB...

in my case server is working only when nvault file doesnt exist(I remove it and start the server). plugin creates .vault and .journal files, but after map change .journal file doesn't exist and server is crashing(probably because journal file doens't exist).
P.S. also I tried with CHMOD 777 (full permissions).

as for you if nvault is working correctly maybe try to set 777 permision for nvault folder.
__________________
skype: pavle_ivanof
-=ThQ=-
PRIVATE SUPPORT = PAID SUPPORT
AngeIII is offline
Send a message via Skype™ to AngeIII
ironskillz1
AlliedModders Donor
Join Date: Jul 2012
Location: Sweden
Old 12-29-2012 , 15:37   Re: Achievements
Reply With Quote #7

i changed it but it stills doesnt show how many jumps you got and i didnt understand what you was talking about with nvault saving and loading
And should i change nvault to sql? but how i dont know sql coding


New code:
__________________
I have many private and unique plugins for Jailbreak and Hide'N'Seek. PM me for more info.

Pm me.

Check out my roulette site.

Last edited by ironskillz1; 01-03-2013 at 13:00.
ironskillz1 is offline
Send a message via Skype™ to ironskillz1
AngeIII
Senior Member
Join Date: Sep 2007
Location: Latvia
Old 01-02-2013 , 16:06   Re: Achievements
Reply With Quote #8

oh.. finally the error is that the funtion player_spray doesnt found.

and forward for jump doesn't called at any time..

fix:
PHP Code:
public plugin_init() {
    
register_plugin("HNS Achievements"VERSION"SnusMumrikeN")
    
    
// Commands
    
register_clcmd("say /ach""Cmd_ShowAchievements")
    
register_clcmd("say /achievements""Cmd_ShowAchievements")
    
    
// Events
    
register_event("DeathMsg""eDeath""a")
    
//register_event("23", "player_spray", "a", "1=112")
    
register_event("SendAudio""TerrorWins""a""2=%!MRAD_terwin")
    
    
RegisterHamHam_Player_Jump"player""Ham_Player_Jump_Post");
    
    
// nVault
    
gVault nvault_open("AchievementSystem")

...
PHP Code:
....
public 
Ham_Player_Jump_Post( const id )
{
    if( ( 
pevidpev_flags ) & FL_ONGROUND ) && !( pevidpev_oldbuttons ) & IN_JUMP ) )
    {
        if (
get_user_team(id) == 1)
        {
            static 
Distance;
            
get_user_originidvOriginid ] );
        
            
Distance get_distancevOldOrigin[id], vOrigin[id] );
        
            if( 
Distance >= 50 && Distance <=300 )
            {
                
iAchLevel[id][JUMP]++
                
client_print(id,print_chat,"you have jumped bhop %d distance %d",iAchLevel[id][JUMP],Distance);
                if(
iAchLevel[id][JUMP] == 2500)
                {
                    
TotalAchievements[read_data(1)]++
                    
ColorChat(0GREEN"[Achievements]^1 %s^3 successfully unlocked the achievement^4 Bunnyhopper [1000 Cash Added]"szName)
                    
emit_sound(read_data(1), CHAN_STATICszAchievementSound1.0ATTN_NORM0PITCH_NORM)
                    
cm_set_user_cash(id1000);
                }
                else if(
iAchLevel[id][JUMP] == 5000)
                {
                    
TotalAchievements[read_data(1)]++
                    
ColorChat(0GREEN"[Achievements]^1 %s^3 successfully unlocked the achievement^4 Pro Bunnyhopper [2000 Cash Added]"szName)
                    
emit_sound(read_data(1), CHAN_STATICszAchievementSound1.0ATTN_NORM0PITCH_NORM)
                    
cm_set_user_cash(id2000);
                }
                else if(
iAchLevel[id][JUMP] == 10000)
                {
                    
TotalAchievements[read_data(1)]++
                    
ColorChat(0GREEN"[Achievements]^1 %s^3 successfully unlocked the achievement^4 Master Bunnyhopper [4000 Cash Added]"szName)
                    
emit_sound(read_data(1), CHAN_STATICszAchievementSound1.0ATTN_NORM0PITCH_NORM)
                    
cm_set_user_cash(id4000);
                }
            } 
            
vOldOriginid ] = vOriginid ];
        }
    }
    return 
HAM_IGNORED;

vOldOrigin[id] = vOrigin[id];
should be after if statement, and distance should chekc a limit too (for spawn jumpfix) 50<=jump_distance<=300
__________________
skype: pavle_ivanof
-=ThQ=-
PRIVATE SUPPORT = PAID SUPPORT
AngeIII is offline
Send a message via Skype™ to AngeIII
ironskillz1
AlliedModders Donor
Join Date: Jul 2012
Location: Sweden
Old 01-03-2013 , 10:44   Re: Achievements
Reply With Quote #9

Your are the best thanks evrything works now!
__________________
I have many private and unique plugins for Jailbreak and Hide'N'Seek. PM me for more info.

Pm me.

Check out my roulette site.
ironskillz1 is offline
Send a message via Skype™ to ironskillz1
ironskillz1
AlliedModders Donor
Join Date: Jul 2012
Location: Sweden
Old 01-03-2013 , 12:07   Re: Achievements
Reply With Quote #10

okay 1 more thing

I have added a Player info menu its works great but
when i click on my freinds name it shows my ach not my freinds
__________________
I have many private and unique plugins for Jailbreak and Hide'N'Seek. PM me for more info.

Pm me.

Check out my roulette site.

Last edited by YamiKaitou; 01-03-2013 at 15:05.
ironskillz1 is offline
Send a message via Skype™ to ironskillz1
Reply


Thread Tools
Display Modes

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 13:36.


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