Raised This Month: $51 Target: $400
 12% 

Achievements


Post New Thread Reply   
 
Thread Tools Display Modes
Balage74
Member
Join Date: Dec 2006
Old 09-11-2012 , 19:16   Re: Achievements
Reply With Quote #141

Help please!

achievements2.0 good works in my server. I little changed the code (nominate version 2.03) I add 2 achievements, sniper and smg master.
in .sma
add the code in "enum _:g_iAchCount" (nearly line 100)
add the code in "new const g_iAchsMotd[g_iAchCount][] =" (nearly line 140)
add the code in "new const g_iAchsMaxPoints[g_iAchCount] =" (nearly line 170)
-this is detail1

in the weapon achievements codes i add some code (in detail2) and wrote the smg an sniper master achievement (in detail3)
in achievement.txt I add 2 line for the new achievements.

When client connect to the server, the client freeze and I see in the server console:skipping reconnect on *****, no pvPrivateData.


Whats wrong?

detail1:

Code:
enum _:g_iAchCount
{
    CONNECTIONS,
    HEAD_SHOTS,
    DISTANCE_KILLED,
    DISTANCE_WALKED,
    BOMB,
    PLANT_BOMB,
    PLANT_BOMB_COUNT,
    DEFUSED_BOMB,
    TOTAL_KILLS,
    PISTOL_MASTER,
    RIFLE_MASTER,
    SHOTGUN_MASTER,
    SMG_MASTER,
    SNIPER_MASTER,
    SPRAY_N_PRAY,
    MASTER_AT_ARMS,
    PLAY_AROUND,
    STAND_ALONE,
    ONE_HP_HERO,
    BAD_FRIEND,
    URBAN_DESIGNER,
    GRAFFITI,
    AMMO_CONSERVATION,
    FLY_AWAY,
    RELOADER,
    CAMP_FIRE,
    HAT_TRICK,
    COWBOY_DIPLOMACY,
    TOTAL_DAMAGE
}

new const g_iAchsMotd[g_iAchCount][] =
{
    "Ultimate Server Lover",
    "Boom Head-Shot",
    "Distance Killed",
    "Distance Walked",
    "OMFG that was close",
    "Short Fuse",
    "Boomala Boomala",
    "Nothing Can Blow Up",
    "God of War",
    "Pistol Master",
    "Rifle Master",
    "Shotgun Master",
    "Smg Master",
    "Sniper Master",
    "Spray and Pray",
    "Master At Arms",
    "Play Around",
    "Stand Alone",
    "1 Hp Hero",
    "Bad Friend",
    "Urban Designer",
    "Graffiti Is My Second Name",
    "Ammo Conservation",
    "Fly Away",
    "Reloader",
    "Camp Fire",
    "Hat Trick",
    "Cowboy Diplomacy",
    "You've Made Your Points"
}

new const g_iAchsMaxPoints[g_iAchCount] =
{
    1000,     // Connections
    300,    // Headshots
    4,    // distance killed
    3,    // distance walk
    1,    // bomb
    1,    // Plant bomb
    100,    // plant bomb count
    400,    // Defused Bomb
    10000,    // total kills
    6,    // Pistol master
    10,    // rifle Master
    2,    // shotgun master
    5,    // smg master
    2,    // sniper master
    1,    // spray and pray
    25,    // Master of Arms
    60,     // Play Around
    15,    // Stand Alone
    1,    // 1 Hp Hero
    5,    // Bad Friend
    300,    // Urban Designer
    1,    // Graffiti Is My Second Name
    1,    // Ammo Conservation
    1,    // Fly way
    1000,    // Reloader
    1,    // Camp Fire
    1,    // HatTrick
    100,    // Cowboy Diplomacy
    50000    // Total Damage 50000 Damage points
}
detail2:

Code:
            case CSW_SCOUT:
            {
                switch( g_iPlayersKills[ iKiller ][ iWeaponID ] )
                {
                    case 800: 
                    {
                        g_iAchLevel[ iKiller ][ SNIPER_MASTER ]++
                        Print( 0, "^4[Achievement]^3 %s^1 has earned one of  ^3'^1Sniper Master^3'^4 achievement.", g_iKiller )
                        emit_sound( iKiller, CHAN_STATIC, g_szAchievementSound, 1.0, ATTN_NORM, 0, PITCH_NORM )
                    }                
                    case 1000: 
                    {
                        g_iAchLevel[ iKiller ][ RIFLE_MASTER ]++
                        g_iAchLevel[ iKiller ][ MASTER_AT_ARMS ]++
                        Print( 0, "^4[Achievement]^3 %s^1 has earned ^3'^1Schmidt Scout Expert^3'^4 achievement.", g_iKiller )
                        emit_sound( iKiller, CHAN_STATIC, g_szAchievementSound, 1.0, ATTN_NORM, 0, PITCH_NORM )
                    }
                }
            }

            case CSW_XM1014:
            {
                switch( g_iPlayersKills[ iKiller ][ iWeaponID ] )
                {
                    case 200: 
                    {
                        g_iAchLevel[ iKiller ][ MASTER_AT_ARMS ]++
                        g_iAchLevel[ iKiller ][ SHOTGUN_MASTER ]++
                        Print( 0, "^4[Achievement]^3 %s^1 has earned  ^3'^1Leone YG1265 Auto Shotgun Expert^3'^4 achievement.", g_iKiller )
                        emit_sound( iKiller, CHAN_STATIC, g_szAchievementSound, 1.0, ATTN_NORM, 0, PITCH_NORM )
                    }
                }
            }

            case CSW_MAC10:
            {
                switch( g_iPlayersKills[ iKiller ][ iWeaponID ] )
                {
                    case 500: 
                    {
                        g_iAchLevel[ iKiller ][ SMG_MASTER ]++
                        g_iAchLevel[ iKiller ][ MASTER_AT_ARMS ]++
                        Print( 0, "^4[Achievement]^3 %s^1 has earned ^3'^1Ingram Mac-10 Expert^3'^4 achievement.", g_iKiller )
                        emit_sound( iKiller, CHAN_STATIC, g_szAchievementSound, 1.0, ATTN_NORM, 0, PITCH_NORM )
                    }
                }
            }
            case CSW_AUG:
            {
                switch( g_iPlayersKills[ iKiller ][ iWeaponID ] )
                {
                    case 500:
                    {
                        g_iAchLevel[ iKiller ][ RIFLE_MASTER ]++    
                        g_iAchLevel[ iKiller ][ MASTER_AT_ARMS ]++
                        Print( 0, "^4[Achievement]^3 %s^1 has earned ^3'^1Bullpup Expert^3'^4 achievement.", g_iKiller )
                        emit_sound( iKiller, CHAN_STATIC, g_szAchievementSound, 1.0, ATTN_NORM, 0, PITCH_NORM )
                    }
                }
                
            }
            /*
            case CSW_SMOKEGRENADE:
            {
                switch( g_iPlayersKills[ iKiller ][ iWeaponID ] )
                {

                }
            }*/
            case CSW_ELITE:
            {
                switch( g_iPlayersKills[ iKiller ][ iWeaponID ] )
                {
                    case 100:
                    {
                        g_iAchLevel[ iKiller ][ PISTOL_MASTER ]++
                        g_iAchLevel[ iKiller ][ MASTER_AT_ARMS ]++
                        Print( 0, "^4[Achievement]^3 %s^1 has earned ^3'^1.40 Dual Elites Expert^3'^4 achievement.", g_iKiller )
                        emit_sound( iKiller, CHAN_STATIC, g_szAchievementSound, 1.0, ATTN_NORM, 0, PITCH_NORM )
                    }
                }
            }
            case CSW_FIVESEVEN:
            {
                switch( g_iPlayersKills[ iKiller ][ iWeaponID ] )
                {
                    case 100: 
                    {
                        g_iAchLevel[ iKiller ][ PISTOL_MASTER ]++
                        g_iAchLevel[ iKiller ][ MASTER_AT_ARMS ]++
                        Print( 0, "^4[Achievement]^3 %s^1 has earned ^3'^1ES Five-Seven Expert^3'^4 achievement.", g_iKiller )
                        emit_sound( iKiller, CHAN_STATIC, g_szAchievementSound, 1.0, ATTN_NORM, 0, PITCH_NORM )
                    }
                }
            }
            case CSW_UMP45:
            {
                switch( g_iPlayersKills[ iKiller ][ iWeaponID ] )
                {
                    case 1000: 
                    {
                        g_iAchLevel[ iKiller ][ SMG_MASTER ]++
                        g_iAchLevel[ iKiller ][ MASTER_AT_ARMS ]++
                        Print( 0, "^4[Achievement]^3 %s^1 has earned ^3'^1KM UMP45 Expert^3'^4 achievement.", g_iKiller )
                        emit_sound( iKiller, CHAN_STATIC, g_szAchievementSound, 1.0, ATTN_NORM, 0, PITCH_NORM )
                    }
                }
            }
            case CSW_SG550:
            {
                switch( g_iPlayersKills[ iKiller ][ iWeaponID ] )
                {
                    case 500: 
                    {
                        g_iAchLevel[ iKiller ][ RIFLE_MASTER ]++
                        g_iAchLevel[ iKiller ][ MASTER_AT_ARMS ]++
                        Print( 0, "^4[Achievement]^3 %s^1 has earned ^3'^1D3/AU-1 Expert^3'^4 achievement.", g_iKiller )
                        emit_sound( iKiller, CHAN_STATIC, g_szAchievementSound, 1.0, ATTN_NORM, 0, PITCH_NORM )
                    }
                }
            }
            case CSW_GALIL:
            {
                switch( g_iPlayersKills[ iKiller ][ iWeaponID ] )
                {
                    case 500: 
                    {
                        g_iAchLevel[ iKiller ][ RIFLE_MASTER ]++
                        g_iAchLevel[ iKiller ][ MASTER_AT_ARMS ]++
                        Print( 0, "^4[Achievement]^3 %s^1 has earned ^3'^1IDF Defender Expert^3'^4 achievement.", g_iKiller )
                        emit_sound( iKiller, CHAN_STATIC, g_szAchievementSound, 1.0, ATTN_NORM, 0, PITCH_NORM )
                    }
                }
            }
            case CSW_FAMAS:
            {
                switch( g_iPlayersKills[ iKiller ][ iWeaponID ] )
                {
                    case 500: 
                    {
                        g_iAchLevel[ iKiller ][ RIFLE_MASTER ]++
                        g_iAchLevel[ iKiller ][ MASTER_AT_ARMS ]++
                        Print( 0, "^4[Achievement]^3 %s^1 has earned ^3'^1Clarion 5.56 Expert^3'^4 achievement.", g_iKiller )
                        emit_sound( iKiller, CHAN_STATIC, g_szAchievementSound, 1.0, ATTN_NORM, 0, PITCH_NORM )
                    }
                }
            }
            case CSW_USP:
            {
                switch( g_iPlayersKills[ iKiller ][ iWeaponID ] )
                {
                    case 200:
                    {
                        g_iAchLevel[ iKiller ][ PISTOL_MASTER ]++
                        g_iAchLevel[ iKiller ][ MASTER_AT_ARMS ]++
                        Print( 0, "^4[Achievement]^3 %s^1 has earned ^3'^1KM Tactical .45 Expert^3'^4 achievement.", g_iKiller )
                        emit_sound( iKiller, CHAN_STATIC, g_szAchievementSound, 1.0, ATTN_NORM, 0, PITCH_NORM )
                    }
                }
            }
            case CSW_GLOCK18:
            {
                switch( g_iPlayersKills[ iKiller ][ iWeaponID ] )
                {
                    case 200:
                    {
                        g_iAchLevel[ iKiller ][ PISTOL_MASTER ]++
                        g_iAchLevel[ iKiller ][ MASTER_AT_ARMS ]++
                        Print( 0, "^4[Achievement]^3 %s^1 has earned ^3'^1.9×19 Sidearm Expert^3'^4 achievement.", g_iKiller )
                        emit_sound( iKiller, CHAN_STATIC, g_szAchievementSound, 1.0, ATTN_NORM, 0, PITCH_NORM )
                    }
                }
            }
            case CSW_AWP:
            {
                switch( g_iPlayersKills[ iKiller ][ iWeaponID ] )
                {
                    case 800:
                    {
                        g_iAchLevel[ iKiller ][ SNIPER_MASTER ]++
                        Print( 0, "^4[Achievement]^3 %s^1 has earned one of^3'^1Sniper Master^3'^4 achievement.", g_iKiller )
                        emit_sound( iKiller, CHAN_STATIC, g_szAchievementSound, 1.0, ATTN_NORM, 0, PITCH_NORM )
                    }
                    case 1000:
                    {
                        g_iAchLevel[ iKiller ][ RIFLE_MASTER ]++
                        g_iAchLevel[ iKiller ][ MASTER_AT_ARMS ]++
                        Print( 0, "^4[Achievement]^3 %s^1 has earned  ^3'^1Magnum Sniper Rifle Expert^3'^4 achievement.", g_iKiller )
                        emit_sound( iKiller, CHAN_STATIC, g_szAchievementSound, 1.0, ATTN_NORM, 0, PITCH_NORM )
                    }
                }
            }
            case CSW_MP5NAVY:
            {
                switch( g_iPlayersKills[ iKiller ][ iWeaponID ] )
                {
                    case 1000: 
                    {
                        g_iAchLevel[ iKiller ][ SMG_MASTER ]++
                        g_iAchLevel[ iKiller ][ MASTER_AT_ARMS ]++
                        Print( 0, "^4[Achievement]^3 %s^1 has earned  ^3'^1KM Sub-Machine Gun Expert^3'^4 achievement.", g_iKiller )
                        emit_sound( iKiller, CHAN_STATIC, g_szAchievementSound, 1.0, ATTN_NORM, 0, PITCH_NORM )
                    }
                }
            }
            case CSW_M249:
            {
                switch( g_iPlayersKills[ iKiller ][ iWeaponID ] )
                {
                    case 500:
                    {
                        g_iAchLevel[ iKiller ][ MASTER_AT_ARMS ]++
                        Print( 0, "^4[Achievement]^3 %s^1 has earned ^3'^1M249 Expert^3'^4 achievement.", g_iKiller )
                        emit_sound( iKiller, CHAN_STATIC, g_szAchievementSound, 1.0, ATTN_NORM, 0, PITCH_NORM )
                    }
                }
            }
            case CSW_M3:
            {
                switch( g_iPlayersKills[ iKiller ][ iWeaponID ] )
                {
                    case 200: 
                    {
                        g_iAchLevel[ iKiller ][ MASTER_AT_ARMS ]++
                        g_iAchLevel[ iKiller ][ SHOTGUN_MASTER ]++
                        Print( 0, "^4[Achievement]^3 %s^1 has earned  ^3'^1Leone 12 Gauge Super Expert^3'^4 achievement.", g_iKiller )
                        emit_sound( iKiller, CHAN_STATIC, g_szAchievementSound, 1.0, ATTN_NORM, 0, PITCH_NORM )
                    }
                }
            }
            case CSW_M4A1:
            {
                switch( g_iPlayersKills[ iKiller ][ iWeaponID ] )
                {
                    case 1000:
                    {
                        g_iAchLevel[ iKiller ][ RIFLE_MASTER ]++
                        g_iAchLevel[ iKiller ][ MASTER_AT_ARMS ]++
                        Print( 0, "^4[Achievement]^3 %s^1 has earned  ^3'^1Maverick M4A1 Carbine Expert^3'^4 achievement.", g_iKiller )
                        emit_sound( iKiller, CHAN_STATIC, g_szAchievementSound, 1.0, ATTN_NORM, 0, PITCH_NORM )
                    }
                }
            }
            case CSW_TMP:
            {
                switch( g_iPlayersKills[ iKiller ][ iWeaponID ] )
                {
                    case 1000: 
                    {
                        g_iAchLevel[ iKiller ][ SMG_MASTER ]++
                        g_iAchLevel[ iKiller ][ MASTER_AT_ARMS ]++
                        Print( 0, "^4[Achievement]^3 %s^1 has earned  ^3'^1Schmidt Machine Pistol Expert^3'^4 achievement.", g_iKiller )
                        emit_sound( iKiller, CHAN_STATIC, g_szAchievementSound, 1.0, ATTN_NORM, 0, PITCH_NORM )
                    }
                }
            }
detail3:

Code:
    switch( g_iAchLevel[ iKiller ][ SHOTGUN_MASTER ] )
    {
        case 2:
        {
            Print( 0, "^4[Achievement]^3 %s^1 has earned ^3'^1Shotgun Master^3'^4 achievement!", g_iKiller ) 
            emit_sound( iKiller, CHAN_STATIC, g_szAchievementSound, 1.0, ATTN_NORM, 0, PITCH_NORM )
        }
    }

    switch( g_iAchLevel[ iKiller ][ SMG_MASTER ] )
    {
        case 5:
        {
            Print( 0, "^4[Achievement]^3 %s^1 has earned ^3'^1Smg Master^3'^4 achievement!", g_iKiller ) 
            emit_sound( iKiller, CHAN_STATIC, g_szAchievementSound, 1.0, ATTN_NORM, 0, PITCH_NORM )
        }
    }

    switch( g_iAchLevel[ iKiller ][ SNIPER_MASTER ] )
    {
        case 2:
        {
            Print( 0, "^4[Achievement]^3 %s^1 has earned ^3'^1Sniper Master^3'^4 achievement!", g_iKiller ) 
            emit_sound( iKiller, CHAN_STATIC, g_szAchievementSound, 1.0, ATTN_NORM, 0, PITCH_NORM )
        }
    }
        
    switch( g_iAchLevel[ iKiller ][ MASTER_AT_ARMS ] )
    {
        case 25:
        {
            Print( 0, "^4[Achievement]^3 %s^1 has earned ^3'^1Master at Arms^3'^4 achievement!", g_iKiller ) 
            emit_sound( iKiller, CHAN_STATIC, g_szAchievementSound, 1.0, ATTN_NORM, 0, PITCH_NORM )
        }
    }
__________________
Balage74 is offline
Send a message via MSN to Balage74 Send a message via Skype™ to Balage74
LordKowen
Member
Join Date: Sep 2009
Location: Spain
Old 10-15-2012 , 05:22   Re: Achievements
Reply With Quote #142

Quote:
Originally Posted by couldbepurplecouldbepink View Post
Anyway to track data by IP instead of STEAMID?
No. Data by IP system have no sense because most people have dynamic IP, so isn't a good idea.

Other thing is using a user / password system, if you want a user can use more than one ID_STEAM or something, but if you say anything about this on this forum the answer surely will non steam = no support.
__________________
LordKowen is offline
jonnzus
Epic Member
Join Date: Oct 2010
Location: Finland
Old 10-23-2012 , 20:09   Re: Achievements
Reply With Quote #143

Some php file to show achievements would be pretty nice
__________________
Quote:
367. Everyone's copyright will be broken. No exceptions.
jonnzus is offline
eightn
Junior Member
Join Date: Apr 2004
Location: Russia/Moscow
Old 01-28-2013 , 01:36   Re: Achievements
Reply With Quote #144

When using sql mode, plugin failed to init:

[AMXX] Plugin ("Achievements_v2.0_sb5.amxx") is setting itself as failed.
[AMXX] Plugin says: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '"Achievement" ( "name" VARCHAR(32) NOT NULL, "authid" VARCHAR(35) NOT NULL, "dat' at line 1
[AMXX] Run time error 1 (plugin "Achievements_v2.0_sb5.amxx") - forced exit


To fix it, use this patch:

Code:
--- Achievements_v2.0.sma	(revision 8944)
+++ Achievements_v2.0.sma	(revision 8945)
@@ -666,7 +666,7 @@
 	#if defined USING_SQL
 	g_sql_tuple = SQL_MakeStdTuple()
 	
-	SQL_ThreadQuery(g_sql_tuple, "QueryCreateTable", "CREATE TABLE IF NOT EXISTS ^"Achievement^" ( ^"name^" VARCHAR(32) NOT NULL, ^"authid^" VARCHAR(35) NOT NULL, ^"data^" VARCHAR(256) NOT NULL );" )
+	SQL_ThreadQuery(g_sql_tuple, "QueryCreateTable", "CREATE TABLE IF NOT EXISTS `Achievement` ( `name` VARCHAR(32) NOT NULL, `authid` VARCHAR(35) NOT NULL, `data` VARCHAR(256) NOT NULL );" )
 	
 	#endif
 }
__________________
wbr, Evgeniy
eightn is offline
alicx
BANNED
Join Date: Mar 2013
Location: Tunisia
Old 05-05-2013 , 12:15   Re: Achievements
Reply With Quote #145

it seems a good idea good job
alicx is offline
Send a message via MSN to alicx Send a message via Skype™ to alicx
PoLiCe
Senior Member
Join Date: Apr 2013
Location: Xen™
Old 05-05-2013 , 13:01   Re: Achievements
Reply With Quote #146

Nice Idea.
__________________
PoLiCe is offline
Send a message via MSN to PoLiCe Send a message via Skype™ to PoLiCe
Balage74
Member
Join Date: Dec 2006
Old 06-10-2013 , 18:30   Re: Achievements
Reply With Quote #147

I complement the Pastout achievements system:
kill assist
suicide
smg master
sniper master


multilanguage
new chat print system (colored and tag in the dictionary file)

new config file handling: if no cfg file, the plugin makes this.

new sound file system:
- only player hear sound
- sound play by cvar

todo list:
- if player make weapon achievement, the plugin add golden weapon
- new menu system for cvars
- new menu system for achievements
- cvars for achievements
- other sounds

tested in windows, nvault version

please test sql

Achievements_v2.8.sma - /scripting dir
achievements.txt - /configs/achievements dir
cvars.cfg - /configs/achievements dir
achievement.txt -/data/lang file
achievement.zip - sound file (cstrike/sound/achievement dir
Attached Files
File Type: sma Get Plugin or Get Source (Achievements_v2.8.sma - 608 views - 92.1 KB)
File Type: txt achievements.txt (2.0 KB, 276 views)
File Type: cfg cvars.cfg (117 Bytes, 248 views)
File Type: txt achievement.txt (13.7 KB, 256 views)
File Type: zip achievement.zip (62.8 KB, 244 views)
__________________

Last edited by Balage74; 06-10-2013 at 18:32.
Balage74 is offline
Send a message via MSN to Balage74 Send a message via Skype™ to Balage74
Jockey
Member
Join Date: Nov 2008
Location: Germany
Old 09-01-2013 , 06:46   Re: Achievements
Reply With Quote #148

SQL Version not running...

Everythings fine with sql with all plugins like amxbans or anything else.

[AMXX] Plugin says: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '"Achievement" ( "name" VARCHAR(32) NOT NULL, "authid" VARCHAR(35) NOT NULL, "dat' at line 1
Jockey is offline
Pastout
Senior Member
Join Date: Dec 2010
Location: 1337 Street LeetTown
Old 11-16-2013 , 08:15   Re: Achievements
Reply With Quote #149

Updated Achievements Current version 2.2
Improved performance way faster
Change the Menus
More user friendly
Added Cvars
  • ach_playsound (1=on|0=off) Default 1
You now able to see other percent completions of other players by looking at them. Also by looking them up in the menu.
Added descriptions in the help menu for achievements.
Fix SQL
Change the sound achievement MUST upload new sound.
Attached Files
File Type: zip Achievements.zip (14.8 KB, 106 views)
File Type: sma Get Plugin or Get Source (achievements.sma - 423 views - 65.3 KB)
Pastout is offline
BLacking98
Veteran Member
Join Date: Oct 2012
Location: California
Old 11-16-2013 , 14:56   Re: Achievements
Reply With Quote #150

Can you add a version that works with bots?

Because weapon achs won't change only flashbang and smoke nade
__________________
BLacking98 is offline
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 02:18.


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