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

*****


Post New Thread Closed Thread   
 
Thread Tools Display Modes
Jindo
AlliedModders Donor
Join Date: May 2009
Location: England, UK
Old 08-24-2009 , 10:23   Re: [TF2] Custom Achievements
#71

Jindo's Public Achievement Pack 1 - Release 0.1

The .ZIP contains:
  • A tweaked SQL script that should create the achievements.
  • Achievement pack's plugin + source.
  • 25 achievements.
  • 25 images for the achievements.
Report any and all bugs, I will do my best to fix them (so far all of these achievements managed to work for me, but there's every chance that I either missed something or something is tracked when it shouldn't be)

EDIT: Fixed an issue with the SQL script.
EDIT2: Fixed compiled version for some reason not being updated with the debugger removal.
Attached Files
File Type: zip jindos_ach_pack1.zip (183.4 KB, 183 views)

Last edited by Jindo; 08-24-2009 at 17:53.
Jindo is offline
marcusx
Member
Join Date: Aug 2007
Old 08-24-2009 , 10:42   Re: [TF2] Custom Achievements
#72

Code:
ERROR: Apostrophe non fermé @ 2364
STR: '
SQL: 

INSERT INTO `config` (`id`, `name`, `description`, `image`, `amount`) VALUES
(50, 'I''m Bonk Man', 'Get 5 kills with the bat in a single life', '1300.png', 1),
(51, 'Asleep Yet?', 'Stun 5 people with the Sandman in a single life', '1301.png', 1),
(52, 'Out of Ammo', 'Get 5 kills with the Shovel in a single life', '1324.png', 1),
(53, 'Send Them To Their Mommas', 'Accumulate 10 kills as a Soldier in a single life', '1302.png', 1),
(54, 'What Rockets?', 'As a Soldier, accumulate 100 kills with the shotgun', '1303.png', 100),
(55, 'Crazed Axe Murderer', 'Get 5 kills with the Fire Axe in a single life', '1304.png', 1),
(56, 'Hadouken!!1!', 'Kill 3 people with the Pyro's taunt over the course of a single map', '1305.png', 1),

(58, 'No Excuses', 'Get 5 kills with the Bottle in a single life', '1306.png', 1),
(59, 'KABOOM', 'Accumulate 25 kills with the Pipe Grenade Launcher', '1307.png', 25),
(60, 'A Sticky Situation', 'Accumulate 100 kills with the Stickybomb Launcher', '1308.png', 100),
(61, 'I Am Heavy Weapons Boxer', 'Get 5 kills with the KGB in a single life', '1309.png', 1),
(62, 'POW! Ha Ha!', 'Accumulate 10 taunt kills as the Heavy', '1310.png', 10),
(63, 'Good Night Irene', 'Get 5 kills with the Wrench in a single life', '1311.png', 1),
(64, 'Don't Touch That!', 'Accumulate 50 kills with Sentry Guns', '1312.png', 50),
(65, 'Alot of Erecting', 'Build 100 Dispensers', '1313.png', 100),
(66, 'Did That Sting?', 'Get 5 kills with either Bonesaw in a single life', '1314.png', 1),
(67, 'Captain Overpowered', 'Deploy 3 Ubercharges in a single life', '1315.png', 1),
(68, 'The Wrong Treatment', 'Get killed with an Ubercharge ready to deploy', '1316.png', 1),
(69, 'Proper Bloody Drubbin'!', 'Get 5 kills with the Kukri in a single life', '1317.png', 1),
(70, 'Fine Shot, Mate!', 'Successfully taunt-kill 3 people as the Sniper in one map', '1318.png', 1),
(71, 'Gentlemen', 'Get 7 Non-backstab kills with the knife in a single life', '1319.png', 1),
(72, 'Lay Their Weapons Down', 'Successfully taunt-kill 3 people as the Spy in one map', '1320.png', 1),
(73, 'Mentlegen', 'Accumulate 25 headshots with the Ambassador', '1325.png', 25),
(74, 'In the Thick of Things', 'Capture 50 control points', '1321.png', 50),
(75, 'With Your Powers Combined...', 'In a single map, perform the Heavy, Pyro and Sniper taunt-kills successfully', '1322.png', 1);
 
    requête SQL:     
      INSERT INTO `config` (`id`, `name`, `description`, `image`, `amount`) VALUES (50, 'I''m Bonk Man', 'Get 5 kills with the bat in a single life', '1300.png', 1), (51, 'Asleep Yet?', 'Stun 5 people with the Sandman in a single life', '1301.png', 1), (52, 'Out of Ammo', 'Get 5 kills with the Shovel in a single life', '1324.png', 1), (53, 'Send Them To Their Mommas', 'Accumulate 10 kills as a Soldier in a single life', '1302.png', 1), (54, 'What Rockets?', 'As a Soldier, accumulate 100 kills with the shotgun', '1303.png', 100), (55, 'Crazed Axe Murderer', 'Get 5 kills with the Fire Axe in a single life', '1304.png', 1), (56, 'Hadouken!!1!', 'Kill 3 people with the Pyro's taunt over the course of a single map', '1305.png', 1), (58, 'No Excuses', 'Get 5 kills with the Bottle in a single life', '1306.png', 1), (59, 'KABOOM', 'Accumulate 25 kills with the Pipe Grenade Launcher', '1307.png', 25), (60, 'A Sticky Situation', 'Accumulate 100 kills with the Stickybomb Launcher', '1308.png', 100), (61, 'I Am Heavy Weapons Boxer', 'Get 5 kills with the KGB in a single life', '1309.png', 1), (62, 'POW! Ha Ha!', 'Accumulate 10 taunt kills as the Heavy', '1310.png', 10), (63, 'Good Night Irene', 'Get 5 kills with the Wrench in a single life', '1311.png', 1), (64, 'Don't Touch That!', 'Accumulate 50 kills with Sentry Guns', '1312.png', 50), (65, 'Alot of Erecting', 'Build 100 Dispensers', '1313.png', 100), (66, 'Did That Sting?', 'Get 5 kills with either Bonesaw in a single life', '1314.png', 1), (67, 'Captain Overpowered', 'Deploy 3 Ubercharges in a single life', '1315.png', 1), (68, 'The Wrong Treatment', 'Get killed with an Ubercharge ready to deploy', '1316.png', 1), (69, 'Proper Bloody Drubbin'!', 'Get 5 kills with the Kukri in a single life', '1317.png', 1), (70, 'Fine Shot, Mate!', 'Successfully taunt-kill 3 people as the Sniper in one map', '1318.png', 1), (71, 'Gentlemen', 'Get 7 Non-backstab kills with the knife in a single life', '1319.png', 1), (72, 'Lay Their Weapons Down', 'Successfully taunt-kill 3 people as the Spy in one map', '1320.png', 1), (73, 'Mentlegen', 'Accumulate 25 headshots with the Ambassador', '1325.png', 25), (74, 'In the Thick of Things', 'Capture 50 control points', '1321.png', 50), (75, 'With Your Powers Combined...', 'In a single map, perform the Heavy, Pyro and Sniper taunt-kills successfully', '1322.png', 1); 
      MySQL a répondu: 
  #1064 - 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 's taunt over the course of a single map', '1305.png', 1),

(58, 'No Excuses', ' at line 8
marcusx is offline
Gachl
BANNED
Join Date: Feb 2009
Old 08-24-2009 , 10:51   Re: [TF2] Custom Achievements
#73

Jindo, am I allowed to add it to the OP?
Gachl is offline
marcusx
Member
Join Date: Aug 2007
Old 08-24-2009 , 11:00   Re: [TF2] Custom Achievements
#74

correcty script sql

Code:
-- phpMyAdmin SQL Dump
-- version 3.1.4-rc2
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Erstellungszeit: 20. August 2009 um 22:02
-- Server Version: 5.0.32
-- PHP-Version: 5.2.0-8+etch15

SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";

--
-- Datenbank: `big_achievements`
--

-- --------------------------------------------------------

--
-- Tabellenstruktur für Tabelle `config`
--

CREATE TABLE IF NOT EXISTS `config` (
  `id` int(10) NOT NULL auto_increment,
  `name` varchar(50) NOT NULL COMMENT 'Name for the achievement.',
  `description` varchar(200) NOT NULL,
  `image` varchar(250) NOT NULL,
  `amount` int(5) NOT NULL,
  PRIMARY KEY  (`id`),
  UNIQUE KEY `id` (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 COMMENT='Holds the different types of achievements.' AUTO_INCREMENT=46 ;

-- --------------------------------------------------------

--
-- Tabellenstruktur für Tabelle `names`
--

CREATE TABLE IF NOT EXISTS `names` (
  `steamid` varchar(50) NOT NULL,
  `name` varchar(100) character set utf8 NOT NULL,
  PRIMARY KEY  (`steamid`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Tabellenstruktur für Tabelle `users`
--

CREATE TABLE IF NOT EXISTS `users` (
  `steamid` varchar(50) NOT NULL,
  `aid` int(10) NOT NULL,
  `interval` int(10) NOT NULL COMMENT 'Interval/Progress ammount.',
  PRIMARY KEY  (`steamid`,`aid`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

INSERT INTO `config` (`id`, `name`, `description`, `image`, `amount`) VALUES
(50, 'I''m Bonk Man', 'Get 5 kills with the bat in a single life', '1300.png', 1),
(51, 'Asleep Yet?', 'Stun 5 people with the Sandman in a single life', '1301.png', 1),
(52, 'Out of Ammo', 'Get 5 kills with the Shovel in a single life', '1324.png', 1),
(53, 'Send Them To Their Mommas', 'Accumulate 10 kills as a Soldier in a single life', '1302.png', 1),
(54, 'What Rockets?', 'As a Soldier, accumulate 100 kills with the shotgun', '1303.png', 100),
(55, 'Crazed Axe Murderer', 'Get 5 kills with the Fire Axe in a single life', '1304.png', 1),
(56, 'Hadouken!!1!', 'Kill 3 people with the Pyros taunt over the course of a single map', '1305.png', 1),
(57, 'Attention Whore', 'Accumulate 100 kills with the Flare Gun', '1323.png', 100),
(58, 'No Excuses', 'Get 5 kills with the Bottle in a single life', '1306.png', 1),
(59, 'KABOOM', 'Accumulate 25 kills with the Pipe Grenade Launcher', '1307.png', 25),
(60, 'A Sticky Situation', 'Accumulate 100 kills with the Stickybomb Launcher', '1308.png', 100),
(61, 'I Am Heavy Weapons Boxer', 'Get 5 kills with the KGB in a single life', '1309.png', 1),
(62, 'POW! Ha Ha!', 'Accumulate 10 taunt kills as the Heavy', '1310.png', 10),
(63, 'Good Night Irene', 'Get 5 kills with the Wrench in a single life', '1311.png', 1),
(64, 'Dont Touch That!', 'Accumulate 50 kills with Sentry Guns', '1312.png', 50),
(65, 'Alot of Erecting', 'Build 100 Dispensers', '1313.png', 100),
(66, 'Did That Sting?', 'Get 5 kills with either Bonesaw in a single life', '1314.png', 1),
(67, 'Captain Overpowered', 'Deploy 3 Ubercharges in a single life', '1315.png', 1),
(68, 'The Wrong Treatment', 'Get killed with an Ubercharge ready to deploy', '1316.png', 1),
(69, 'Proper Bloody Drubbin!', 'Get 5 kills with the Kukri in a single life', '1317.png', 1),
(70, 'Fine Shot, Mate!', 'Successfully taunt-kill 3 people as the Sniper in one map', '1318.png', 1),
(71, 'Gentlemen', 'Get 7 Non-backstab kills with the knife in a single life', '1319.png', 1),
(72, 'Lay Their Weapons Down', 'Successfully taunt-kill 3 people as the Spy in one map', '1320.png', 1),
(73, 'Mentlegen', 'Accumulate 25 headshots with the Ambassador', '1325.png', 25),
(74, 'In the Thick of Things', 'Capture 50 control points', '1321.png', 50),
(75, 'With Your Powers Combined...', 'In a single map, perform the Heavy, Pyro and Sniper taunt-kills successfully', '1322.png', 1);
I change: (56, 'Hadouken!!1!', 'Kill 3 people with the Pyro's taunt over the course of a single map', '1305.png', 1),
to
(56, 'Hadouken!!1!', 'Kill 3 people with the Pyros taunt over the course of a single map', '1305.png', 1),

(64, 'Don't Touch That!', 'Accumulate 50 kills with Sentry Guns', '1312.png', 50),
to
(64, 'Dont Touch That!', 'Accumulate 50 kills with Sentry Guns', '1312.png', 50),

(69, 'Proper Bloody Drubbin'!', 'Get 5 kills with the Kukri in a single life', '1317.png', 1),
to (69, 'Proper Bloody Drubbin!', 'Get 5 kills with the Kukri in a single life', '1317.png', 1),
marcusx is offline
marcusx
Member
Join Date: Aug 2007
Old 08-24-2009 , 11:16   Re: [TF2] Custom Achievements
#75

I just watched one can script that you do Jindo: great


Then 2 little question:
How to add a success or we must kill someone specific
how to add a success or we must kill a specific teammust kill a specific team?
Code:
public Action:eCheckKillX(Handle:event, const String:name[], bool:noBroadcast)
{
    new killer = GetEventInt(event, "userid");
    new object = GetEventInt(event, "killx");
    new client = GetClientOfUserId(killer);
  
 if (!IsValidClient(client))
    {
        return Plugin_Handled;
    }
    if (object == 0)

    {
        ProcessAchievement(START_ID+2, client);
    }
    return Plugin_Handled;
}
x is the player

my code is good?

thanks

Last edited by marcusx; 08-24-2009 at 11:54.
marcusx is offline
Jindo
AlliedModders Donor
Join Date: May 2009
Location: England, UK
Old 08-24-2009 , 14:22   Re: [TF2] Custom Achievements
#76

Quote:
Originally Posted by Gachl View Post
Jindo, am I allowed to add it to the OP?
Go ahead .

Quote:
Originally Posted by marcusx View Post
correcty script sql
Thanks, SQL is something I know nothing about, will adjust the sql file in my attachment.

Quote:
Originally Posted by marcusx View Post
Then 2 little question:
How to add a success or we must kill someone specific
how to add a success or we must kill a specific teammust kill a specific team?
I'm not entirely sure about the team question right now, I'll look in to it.

As for finding a player, It's tricky to explain on the spot, and is something that would be alot easier for people with not so much SourcePawn experience once my config plugins are done.

Basically, it would involve getting the victim's UserID, converting that to a Client Index, get the client's Steam ID, and then comparing that Steam ID to another Steam ID (another being the Steam ID of the person you want to kill for the achievement), my code would look something like this for one player (in this case, the victim's Steam ID is mine):

PHP Code:
public Action:eCheckPlayer(Handle:event, const String:name[], bool:noBroadcast)
{
    new 
attacker GetEventInt(event"attacker"); // Gets the killer's User ID
    
new victim GetEventInt(event"userid"); // Gets the victim's User ID
    
new rattacker GetClientOfUserId(attacker); // See next line
    
new rvictim GetClientOfUserId(victim); // Events use User IDs, but in SourcePawn you use Client Index values, so this step converts the User ID to something we can use.
    
decl String:victimID[128]; // Makes the variable to store the Steam ID
    
GetClientAuthString(rvictimvictimIDsizeof(victimID)); // This gets the victim's Steam ID (the victimID and sizeof(victimID) part tells this where to store the information once it finds it.
    
if (StrEqual(victimID"STEAM_0:1:14783567"true)) // This is the condition that compares the victim's Steam ID with the 2nd ID you can see.
    
{
        
ProcessAchievement(ACHIEVEMENT_IDrattacker); // ACHIEVEMENT_ID could be what ever you set it as.
    
}

If you don't know any SourcePawn, it might be a bit confusing, and if you don't especially want to learn to SourcePawn for this, you're better off waiting for me to finish my plugin(s) for this.
Jindo is offline
3_stooges_geo
Member
Join Date: Jul 2008
Location: Blackwood,New Jersey
Old 08-24-2009 , 15:25   Re: [TF2] Custom Achievements
#77

thanks for achievements.
only problem i noticed so far is when you start an achievement,lets say build 50 dispensers,there is a message printed in chat:
[test]players name has triggered achievement number 6
is there anyway of not having that text show up?
Quote:
Originally Posted by Jindo View Post
Jindo's Public Achievement Pack 1 - Release 0.1

The .ZIP contains:
  • A tweaked SQL script that should create the achievements.
  • Achievement pack's plugin + source.
  • 25 achievements.
  • 25 images for the achievements.
Report any and all bugs, I will do my best to fix them (so far all of these achievements managed to work for me, but there's every chance that I either missed something or something is tracked when it shouldn't be)

EDIT: Fixed an issue with the SQL script.
3_stooges_geo is offline
Jindo
AlliedModders Donor
Join Date: May 2009
Location: England, UK
Old 08-24-2009 , 17:48   Re: [TF2] Custom Achievements
#78

Quote:
Originally Posted by 3_stooges_geo View Post
thanks for achievements.
only problem i noticed so far is when you start an achievement,lets say build 50 dispensers,there is a message printed in chat:
[test]players name has triggered achievement number 6
This was for debugging purposes, which I thought I had removed, sincerest apologies, removing immediately.

EDIT: In the meantime, recompiling the source file should remove it.

EDIT2: Updated this post, now updating the original post
Attached Files
File Type: zip jindos_ach_pack1.zip (183.4 KB, 109 views)

Last edited by Jindo; 08-24-2009 at 17:53.
Jindo is offline
3_stooges_geo
Member
Join Date: Jul 2008
Location: Blackwood,New Jersey
Old 08-24-2009 , 17:59   Re: [TF2] Custom Achievements
#79

thanks,working now.
Quote:
Originally Posted by Jindo View Post
This was for debugging purposes, which I thought I had removed, sincerest apologies, removing immediately.

EDIT: In the meantime, recompiling the source file should remove it.

EDIT2: Updated this post, now updating the original post
3_stooges_geo is offline
marcusx
Member
Join Date: Aug 2007
Old 08-25-2009 , 06:10   Re: [TF2] Custom Achievements
#80

Hello
Code:
public Action:eCheckPlayer(Handle:event, const String:name[], bool:noBroadcast)
{
    new attacker = GetEventInt(event, "attacker"); // Gets the killer's User ID
    new victim = GetEventInt(event, "userid"); // Gets the victim's User ID
    new rattacker = GetClientOfUserId(attacker); // See next line
    new rvictim = GetClientOfUserId(victim); // Events use User IDs, but in SourcePawn you use Client Index values, so this step converts the User ID to something we can use.
    decl String:victimID[128]; // Makes the variable to store the Steam ID
    GetClientAuthString(rvictim, victimID, sizeof(victimID)); // This gets the victim's Steam ID (the victimID and sizeof(victimID) part tells this where to store the information once it finds it.
    if (StrEqual(victimID, "STEAM_0:0:16411333", true)) // This is the condition that compares the victim's Steam ID with the 2nd ID you can see.
    {
        ProcessAchievement(START_ID+27, rattacker); // ACHIEVEMENT_ID could be what ever you set it as.
    }
    }
I have put the code you gave me, but that does not work. When I kill the person does not earn achievement
marcusx is offline
Closed Thread



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 03:47.


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