Raised This Month: $ Target: $400
 0% 

Achievements


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
AngeIII
Senior Member
Join Date: Sep 2007
Location: Latvia
Old 01-02-2013 , 16:06   Re: Achievements
Reply With Quote #9

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
 



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:37.


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