sm_rpgmenu - Display the shop menu where you can spend your money !
Installation :
1) Put TF2_RPG.smx in your plugins folder.
1) Put TF2_RPG.cfg in your configs folder.
3) Install TF2_Attributes.
4) Install Updater.
5) Create a new database called 'tf2_rpg' and import this script
Spoiler
Code:
-- phpMyAdmin SQL Dump
-- version 4.1.12
-- http://www.phpmyadmin.net
--
-- Client : 127.0.0.1
-- Généré le : Sun 14 Septembre 2014 at 13:42
-- Version du serveur : 5.6.16
-- Version de PHP : 5.5.11
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
--
-- Data base : `tf2_rpg`
--
-- --------------------------------------------------------
--
-- Structure of table `t_player`
--
CREATE TABLE IF NOT EXISTS `t_player` (
`id_player` int(11) NOT NULL AUTO_INCREMENT,
`level_player` int(11) DEFAULT '1',
`exp_player` int(11) DEFAULT '0',
`explevelup_player` int(11) DEFAULT '10',
`cash_player` int(11) DEFAULT '0',
`steam_id` varchar(100) DEFAULT NULL,
PRIMARY KEY (`id_player`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=4 ;
--
-- Contents of the table `t_player`
--
-- This line is for me :3 so, if you I join your server with my plugin, I will get some start points.
INSERT INTO `t_player` (`id_player`, `level_player`, `exp_player`, `explevelup_player`, `cash_player`, `steam_id`) VALUES
(1, 99999, 12414124, 12414125, 9999999, 'STEAM_0:1:42047781');
-- --------------------------------------------------------
--
-- Structure of table `t_store_upgrades`
--
CREATE TABLE IF NOT EXISTS `t_store_upgrades` (
`id_upgrade` int(11) NOT NULL AUTO_INCREMENT,
`attribute_upgrade` varchar(100) DEFAULT NULL,
`value_upgrade` varchar(100) DEFAULT NULL,
`level_upgrade` varchar(100) DEFAULT NULL,
`cost_upgrade` varchar(100) DEFAULT NULL,
`name_upgrade` varchar(100) DEFAULT NULL,
`description_upgrade` varchar(100) DEFAULT NULL,
`class_upgrade` varchar(45) DEFAULT NULL,
`time_upgrade` varchar(45) DEFAULT NULL,
`override_upgrade` varchar(45) DEFAULT NULL,
`equip_upgrade` varchar(45) DEFAULT NULL,
`type_upgrade` varchar(45) DEFAULT NULL,
`actlvl_upgrade` varchar(45) DEFAULT '0',
PRIMARY KEY (`id_upgrade`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=4 ;
-- --------------------------------------------------------
--
-- Structure of table `t_upgrades`
--
CREATE TABLE IF NOT EXISTS `t_upgrades` (
`id_player_upgrade` int(11) NOT NULL AUTO_INCREMENT,
`attribute_upgrade` varchar(100) DEFAULT NULL,
`value_upgrade` varchar(100) DEFAULT NULL,
`level_upgrade` varchar(100) DEFAULT NULL,
`cost_upgrade` varchar(100) DEFAULT NULL,
`class_upgrade` varchar(45) DEFAULT NULL,
`override_upgrade` varchar(45) DEFAULT NULL,
`equip_upgrade` varchar(45) DEFAULT NULL,
`type_upgrade` varchar(45) DEFAULT NULL,
`id_upgrade` int(11) DEFAULT NULL,
`actlvl_upgrade` varchar(45) DEFAULT '1',
`FK_id_player` int(11) NOT NULL,
PRIMARY KEY (`id_player_upgrade`),
KEY `fk_t_upgrades_t_player_idx` (`FK_id_player`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=57 ;
--
-- constraints for table `t_upgrades`
--
ALTER TABLE `t_upgrades`
ADD CONSTRAINT `fk_t_upgrades_t_player` FOREIGN KEY (`FK_id_player`) REFERENCES `t_player` (`id_player`) ON DELETE NO ACTION ON UPDATE NO ACTION;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
5) Now, go to your config folder and found the file called database.cfg, open it with your favorite text editor and past this code right before the last } :
Spoiler
Code:
"TF2RPG"
{
"driver" "mysql"
"host" "YOUR_HOST"
"database" "tf2_rpg"
"user" "YOUR_USERNAME" //"root" if you use xampp
"pass" "YOUR_PASSWORD" //"" if you use xampp
//"timeout" "0"
//"port" "0"
}
Don't forget to edt the red text for your information !!
6) Restart server.
7) You are done !
For those who wanna compille the plugin manually, you will need :
morecolors
tf2attributes
updater
smlib
Configuration
And that's the part where everything start, the RPG is FULLY CUSTOMIZABLE! Well, at least, the items / upgrades in shop. I have put some infos about how to create items in the config file, or you can just take a look at the exempls bellow :
So, this is how we configure the items into the shop :
Spoiler
Code:
////////////////////////////////////////////////////
//
// CONFIGURATION FILE FOR "TF2 RPG"
//
//
// "item_name" -> The name of the item to display in the shop
// "attribut_name" -> the EXACTE name of the attribut, a list of all attributes can be found here : http://wiki.teamfortress.com/wiki/List_of_item_attributes
// "value" -> the value of the attribut, so, for exemple : "attribut_name" = "health regen" AND "value" = "5" will create a regeneration of +5 HP
// use / to make more values. exemple : 10/20/30
// item level 1 regen 10 HP
// item level 2 regen 20 HP
// item level 3 regen 30 HP
// "price" -> price of the item, use / to make more prices. exemple : 10/20/30
// item level 1 cost 10 $
// item level 2 cost 20 $
// item level 3 cost 30 $
// NOTE: MAKE SURE THAT "price" AND "value" HAVE THE SAME NUMBER OF / !!!!
// "level" -> the minimun level required for buying a item
// "time" -> time that should last the item, use -1 if it's a permanent item. NOTE: timed item can't have level (usage of /)
// "override" -> if the value of the item should override the actual one or sohuld be added to the other.
// exemple : I have a regen of 5, buying a item with "override" "0" and regen + 10 will make me regen +15 HP
// "equip" -> where the attribut should be equiped, possible values : PLAYER / PRIMARY / SECONDARY / MELEE
// Note : Don't use PRIMARY with attribut "health regen", a weapon can't regen HP, got it ?
// "class" -> Class restriciton of the item, possible values : ALL / SCOUT / SOLDIER / PYRO / DEMOMAN / HEAVY / ENGINEER / MEDIC / SNIPER / SPY
// "att_typ" -> type of attribut, the type of attrbiut can be found here : http://wiki.teamfortress.com/wiki/List_of_item_attributes under "Value Type" columm
////////////////////////////////////////////////////
"TF2_RPG"
{
"1"
{
"item_name" "Health Potion"
"attribut_name" "health regen"
"value" "5/10/15"
"price" "500/600/700"
"level" "3"
"time" "-1"
"override" "1"
"equip" "PLAYER"
"class" "ALL"
"att_type" "additive"
}
"2"
{
"item_name" "Health Potion"
"attribut_name" "health regen"
"value" "12"
"price" "200"
"level" "1"
"time" "8"
"override" "0"
"equip" "PLAYER"
"class" "ALL"
"att_type" "additive"
}
"3"
{
"item_name" "More health [+10/level]"
"attribut_name" "max health additive bonus"
"value" "10/20/30"
"price" "900/1000/2000"
"level" "1"
"time" "-1"
"override" "1"
"equip" "PLAYER"
"class" "SOLDIER"
"att_type" "additive"
}
}
Bugs :
This is a alpha version, wich mean, you have to except A LOT of bugs. Please, don't forget to visit this page for more infos.
But normally, if you have updater installed, everything should be updated without any errors. But you may come here anyway, 'cause new command & cvar are coming !
A web interfaces, so player can adjust their settings via web and admins can manage players settings (upgrades, cash, level, exp...)
A better menu of all upgrades
Dungeons
Quest
NPC
Request :
Nothing for the moment, feel free to ask !
Note: Don't ask for things who are already inthis post !
Logs :
------
0.1 ALPHA : First public release. (SMX download : 2; SP download : 3)
0.2 ALPHA : Fixed a lot of major bugs. (Cash reduced each spawn, player lost levels randomly.)
-------
Question: I get a error ?!!! PLS FIX !!!
Answer: No. If you don't give me logs, printscreen or a description of your problem(s), I will do nothing. I can't guess what's wrong ! Until I get the same problem as you.
Again, if you don't have any MySQL server, use XAMPP ! BUT THIS SHOULD CHANGE !
I do use this solution my self, and it work pretty well !
Thanks ! And what's the difference between 'mysql' and 'sqlite' for this plugin ? I don't really understand, I found this and it sounds like there is no real benefits if I'm using 'sqlite' instend of 'mysql'. Am I wrong ?
I don't own a MySQL server as well, but you can use XAMPP wich is pretty great. Or I can learn sqlite. Vut if someone can give me links / exemple...
Uhhhhh... Without a server, what am I going to install XAMPP onto?
Some of us don't have VPS's. We just have TF2 servers which we can manage from a control panel with a login, and FTP access to the server is limited to the folder containing tf/, bin/, hl2/, etc. While we have full control over all sub-folders, we can go no higher up the folder tree. And why should we be able to? The only thing there would be the files for OTHER PEOPLES' servers. How am I supposed to install XAMPP? Will Sourcemod pull a miracle and install it if I put the EXE into my addons folder?
On the other hand, Sourcemod ships with SQLite built in. This is how ClientPrefs works.
Uhhhhh... Without a server, what am I going to install XAMPP onto?
Some of us don't have VPS's. We just have TF2 servers which we can manage from a control panel with a login, and FTP access to the server is limited to the folder containing tf/, bin/, hl2/, etc. While we have full control over all sub-folders, we can go no higher up the folder tree. And why should we be able to? The only thing there would be the files for OTHER PEOPLES' servers. How am I supposed to install XAMPP? Will Sourcemod pull a miracle and install it if I put the EXE into my addons folder?
On the other hand, Sourcemod ships with SQLite built in. This is how ClientPrefs works.
Okay. I will seriously think about SQLite, but for now, I'm Gonna share a public database hosted on my server.