Raised This Month: $ Target: $400
 0% 

Help with Plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
asdfdsdf
AlliedModders Donor
Join Date: Aug 2010
Location: Belgium
Old 11-27-2011 , 08:28   Help with Plugin
Reply With Quote #1

hallo im trying to make an achievement plugin for server with help of this tutorial i do everything good but i keep getting errors and how can i make it when they earn achievement they earn points for each achievement here is code
PHP Code:
/* Plugin generated by AMXX-Studio */

#include < amxmodx >
#include < csx >
#include < achievement_api >

#define PLUGIN "KnifeAch"
#define VERSION "1.2"
#define AUTHOR "Dieter"

const MaxClients 32;

const 
MaxSteamIdChars 35;

const 
TaskIdDelayConnect 3799;

enum _:AchievementDataStruct
{
    
_NameMaxClients ],
    
_Description256 ],
    
_save_NameMaxClients ],
    
_Max_Value
};

new const 
AchievementInfoachievementDataStruct ] =
{
    
"Rookie",
    
"Kill 10 Enemies With Knife",
    
"progress_rookie",
    
10
};

new 
AchievementPointer;

new 
SteamIdMaxClients +][ MaxSteamIdchars ];

new 
KnifeKillsMaxClients +];

new 
MaxPlayers;

public 
plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR);
    
         
AchievementPointer RegisterAchievement
    
AchievementInfo_Name ], 
    
AchievementInfo_Description ], 
    
AchievementInfo_Save_Name ], 
    
AchievementInfo_Max_Value 
    );
     
    
MaxPlayers get_maxplayers( );
}

public 
client_connecClient )
{
    
set_task10.0"TaskDelayConnect"Client TaskIdDelayConnect );
}

public 
TaskDelayConnectTaskId )
{
    new 
Client TaskId TaskIdDelayConnect;
    
    
get_user_authidClientSteamIdClient ],charsmaxSteamId ) );
    
         
KnifeKillsClient ] = GetAchievementDataSteamIdClient /* our key */AchievementInfo_Save_Name /* save name for achievement (declared in the array) */ );
    
    if( 
GetClientAchievementStatusAchievementPointerKnifeKillsClient ] ) == _In_Progress )
    {
        
SetAchievementData SteamIdClient /* our key */AchievementInfo_Save_Name /* save name for achievement */KnifeKillsClient /* data */ );
    }
    else
    {
        
ClientAchievementCompletedClientAchievementPointer, .Announce false );
    }
    
    
remove_taskClient TaskDelayConnect );
}

public 
client_disconnectClient )
{
    
KnifeKillsClient ] = 0;
}

public 
client_deathKillervictimWeaponIndexHitPlaceTeamKill )
{
    if( 
<= Victim <= MaxPlayers
    
&& <= Killer <= MaxPlayers )
    {
        if( 
Victim != Killer )
        {
            if( 
WeaponIndex == CSW_KNIFE )
            {
                
KnifeKillsKiller ]++;
                
SetAchievementDataSteamIdKiller /* our key */AchievementInfo_Save_Name /* save name for achievement */KnifeKillsKiller /* data */ );
                
            if( 
GetClientAchievementStatusAchievementPointerKnifeKillsKiller ] ) == _In_Progress )
                      {
             
ClientAchievementCompletedKillerAchievementPointer, .Announce true ); // true is default, but just to clarify
                
}
            }
        }
    }
}

public 
Forward_ClientEarnedAchievement( const AchiPointer, const Client // called when client earned the achievement
{
    if( 
AchiPointer == AchievementPointer )
    {
        
// this forward can be used to reward people stuff
        // perhaps a model or just something extra (like ie. cash from cashmod, pointsystem etc.)
    
}

i did this one just like the tutorial but not with grenade kills with knifekills instead what did i do wrong keep getting errors can someone help me with this also how to add points to each achievement thx
asdfdsdf is offline
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 08:32.


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