SA-MP Forums Archive
[FilterScript] Simple Dynamic Vehicle Repair Point [MySQL] - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Filterscripts (https://sampforum.blast.hk/forumdisplay.php?fid=17)
+--- Thread: [FilterScript] Simple Dynamic Vehicle Repair Point [MySQL] (/showthread.php?tid=433796)



Simple Dynamic Vehicle Repair Point [MySQL or YINI] - ryansheilds - 28.04.2013

Dynamic Repair Point System

This is a simple repair point system I created that allows RCON admins to create/delete/goto repair points in game and players to repair vehicles for a specified fee, it requires MySQL (or y_ini), sscanf & streamer plugins as well as the ZCMD include.

Note: If using y_ini create a directory/folder in the scriptfiles called "repairpoints" & ignore the MySQL details.
Downloads are at the bottom.


Features:
  • Ability to create/delete dynamic repair points in game (If RCON admin).
  • Ability to teleport to repair points (If RCON admin).
  • Ability to repair your vehicle using the repair points for a fee.

How to use:
  • Download the .amx & .pwn files.
  • Edit the MySQL connection details in the 'RepairPoints.pwn' filterscript and compile, then place the .amx into your filterscript folder
  • Add 'RepairPoints' to your 'server.cfg' under 'Filterscripts'
  • Finally, insert the query (listed below) into MySQL.
Edit the MySQL connection details in the filterscript:
pawn Код:
#define                     MYSQL_HOST                          ("localhost")
#define                     MYSQL_USER                          ("root")
#define                     MYSQL_DATABASE                      ("samp")
#define                     MYSQL_PASS                          ("")
What you need:Credits to the individuals who created these includes/plugins.

MySQL Query:
Код:
CREATE TABLE IF NOT EXISTS `repairpoints` (
  `repairpointID` int(10) NOT NULL,
  `repairpointPosX` varchar(128) NOT NULL default '0.0',
  `repairpointPosY` varchar(128) NOT NULL default '0.0',
  `repairpointPosZ` varchar(128) NOT NULL default '0.0',
  `repairpointInterior` int(10) NOT NULL default '0',
  `repairpointVirtualWorld` int(10) NOT NULL default '0',
  `repairpointFee` int(10) NOT NULL default '5',
  PRIMARY KEY  (`repairpointID`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC;

INSERT INTO `repairpoints` (`repairpointID`, `repairpointPosX`, `repairpointPosY`, `repairpointPosZ`, `repairpointInterior`, `repairpointVirtualWorld`, `repairpointFee`) VALUES
(1, '0.0', '0.0', '0.0', 0, 0, 5),
(2, '0.0', '0.0', '0.0', 0, 0, 5),
(3, '0.0', '0.0', '0.0', 0, 0, 5),
(4, '0.0', '0.0', '0.0', 0, 0, 5),
(5, '0.0', '0.0', '0.0', 0, 0, 5),
(6, '0.0', '0.0', '0.0', 0, 0, 5),
(7, '0.0', '0.0', '0.0', 0, 0, 5),
(8, '0.0', '0.0', '0.0', 0, 0, 5),
(9, '0.0', '0.0', '0.0', 0, 0, 5),
(10, '0.0', '0.0', '0.0', 0, 0, 5),
(11, '0.0', '0.0', '0.0', 0, 0, 5),
(12, '0.0', '0.0', '0.0', 0, 0, 5),
(13, '0.0', '0.0', '0.0', 0, 0, 5),
(14, '0.0', '0.0', '0.0', 0, 0, 5),
(15, '0.0', '0.0', '0.0', 0, 0, 5),
(16, '0.0', '0.0', '0.0', 0, 0, 5),
(17, '0.0', '0.0', '0.0', 0, 0, 5),
(18, '0.0', '0.0', '0.0', 0, 0, 5),
(19, '0.0', '0.0', '0.0', 0, 0, 5),
(20, '0.0', '0.0', '0.0', 0, 0, 5),
(21, '0.0', '0.0', '0.0', 0, 0, 5),
(22, '0.0', '0.0', '0.0', 0, 0, 5),
(23, '0.0', '0.0', '0.0', 0, 0, 5),
(24, '0.0', '0.0', '0.0', 0, 0, 5),
(25, '0.0', '0.0', '0.0', 0, 0, 5);
Commands:
  • '/repairpointhelp' (Lists all the RCON commands).
  • '/createrepairpoint [fee]'.
  • '/deleterepairpoint [repairpointid]'.
  • '/gotorepairpoint [repairpointid]'.
  • '/repairvehicle'
Screen Shots:





Downloads:
.pwn (mysql): http://www.mediafire.com/?akcdwx7vbfgcgpg
.amx (mysql): http://www.mediafire.com/?oi5a2p69byl0fc6

.pwn (yini): http://www.2shared.com/file/DtCoPWZj/RepairPoints.html
(I'm kinda new to y_ini!)

I don't think I've missed anything, enjoy.
PS. This is my first filterscript/release.



Re: Simple Dynamic Vehicle Repair Point [MySQL] - McFellow - 28.04.2013

nice!


Re: Simple Dynamic Vehicle Repair Point [MySQL] - Goldenfox - 28.04.2013

Awesome, that's because I have seen it.


Re: Simple Dynamic Vehicle Repair Point [MySQL] - ahmad95 - 29.04.2013

nice


Re: Simple Dynamic Vehicle Repair Point [MySQL] - ryansheilds - 01.05.2013

Quote:
Originally Posted by McFellow
Посмотреть сообщение
nice!
Quote:
Originally Posted by Goldenfox
Посмотреть сообщение
Awesome, that's because I have seen it.
Quote:
Originally Posted by ahmad95
Посмотреть сообщение
nice
Thanks, does anyone have any suggestions?


Re: Simple Dynamic Vehicle Repair Point [MySQL] - benjaminjones - 01.05.2013

Can you make it for money? Like when you use cmd to repair vehicle you should pay 300 dollars?


Re: Simple Dynamic Vehicle Repair Point [MySQL] - ryansheilds - 01.05.2013

Quote:
Originally Posted by benjaminjones
Посмотреть сообщение
Can you make it for money? Like when you use cmd to repair vehicle you should pay 300 dollars?
It already has that, that's what the "fee" is, you set it when creating a vehicle repair point - '/createrepairpoint [fee]'.

The fee is how much they pay when using the command ('/repairvehicle').

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

Edit: Created a y_ini version - However I've hardly used y_ini before.


Re: Simple Dynamic Vehicle Repair Point [MySQL] - OpticKiller - 05.05.2013

This dont work it comes up as a error on it can you fix it??

Код:
CREATE TABLE IF NOT EXISTS `repairpoints` (
  `repairpointID` int(10) NOT NULL,
  `repairpointPosX` varchar(128) NOT NULL default '0.0',
  `repairpointPosY` varchar(128) NOT NULL default '0.0',
  `repairpointPosZ` varchar(128) NOT NULL default '0.0',
  `repairpointInterior` int(10) NOT NULL default '0',
  `repairpointVirtualWorld` int(10) NOT NULL default '0',
  `repairpointFee` int(10) NOT NULL default '5',
  PRIMARY KEY  (`repairpointID`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC;

INSERT INTO `repairpoints` (`repairpointID`, `repairpointPosX`, `repairpointPosY`, `repairpointPosZ`, `repairpointInterior`, `repairpointVirtualWorld`, `repairpointFee`) VALUES
(1, '0.0', '0.0', '0.0', 0, 0, 5),
(2, '0.0', '0.0', '0.0', 0, 0, 5),
(3, '0.0', '0.0', '0.0', 0, 0, 5),
(4, '0.0', '0.0', '0.0', 0, 0, 5),
(5, '0.0', '0.0', '0.0', 0, 0, 5),
(6, '0.0', '0.0', '0.0', 0, 0, 5),
(7, '0.0', '0.0', '0.0', 0, 0, 5),
(8, '0.0', '0.0', '0.0', 0, 0, 5),
(9, '0.0', '0.0', '0.0', 0, 0, 5),
(10, '0.0', '0.0', '0.0', 0, 0, 5),
(11, '0.0', '0.0', '0.0', 0, 0, 5),
(12, '0.0', '0.0', '0.0', 0, 0, 5),
(13, '0.0', '0.0', '0.0', 0, 0, 5),
(14, '0.0', '0.0', '0.0', 0, 0, 5),
(15, '0.0', '0.0', '0.0', 0, 0, 5),
(16, '0.0', '0.0', '0.0', 0, 0, 5),
(17, '0.0', '0.0', '0.0', 0, 0, 5),
(18, '0.0', '0.0', '0.0', 0, 0, 5),
(19, '0.0', '0.0', '0.0', 0, 0, 5),
(20, '0.0', '0.0', '0.0', 0, 0, 5),
(21, '0.0', '0.0', '0.0', 0, 0, 5),
(22, '0.0', '0.0', '0.0', 0, 0, 5),
(23, '0.0', '0.0', '0.0', 0, 0, 5),
(24, '0.0', '0.0', '0.0', 0, 0, 5),
(25, '0.0', '0.0', '0.0', 0, 0, 5);



Re: Simple Dynamic Vehicle Repair Point [MySQL] - ryansheilds - 05.05.2013

Quote:
Originally Posted by OpticKiller
Посмотреть сообщение
This dont work it comes up as a error on it can you fix it??

Код:
CREATE TABLE IF NOT EXISTS `repairpoints` (
  `repairpointID` int(10) NOT NULL,
  `repairpointPosX` varchar(128) NOT NULL default '0.0',
  `repairpointPosY` varchar(128) NOT NULL default '0.0',
  `repairpointPosZ` varchar(128) NOT NULL default '0.0',
  `repairpointInterior` int(10) NOT NULL default '0',
  `repairpointVirtualWorld` int(10) NOT NULL default '0',
  `repairpointFee` int(10) NOT NULL default '5',
  PRIMARY KEY  (`repairpointID`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC;

INSERT INTO `repairpoints` (`repairpointID`, `repairpointPosX`, `repairpointPosY`, `repairpointPosZ`, `repairpointInterior`, `repairpointVirtualWorld`, `repairpointFee`) VALUES
(1, '0.0', '0.0', '0.0', 0, 0, 5),
(2, '0.0', '0.0', '0.0', 0, 0, 5),
(3, '0.0', '0.0', '0.0', 0, 0, 5),
(4, '0.0', '0.0', '0.0', 0, 0, 5),
(5, '0.0', '0.0', '0.0', 0, 0, 5),
(6, '0.0', '0.0', '0.0', 0, 0, 5),
(7, '0.0', '0.0', '0.0', 0, 0, 5),
(8, '0.0', '0.0', '0.0', 0, 0, 5),
(9, '0.0', '0.0', '0.0', 0, 0, 5),
(10, '0.0', '0.0', '0.0', 0, 0, 5),
(11, '0.0', '0.0', '0.0', 0, 0, 5),
(12, '0.0', '0.0', '0.0', 0, 0, 5),
(13, '0.0', '0.0', '0.0', 0, 0, 5),
(14, '0.0', '0.0', '0.0', 0, 0, 5),
(15, '0.0', '0.0', '0.0', 0, 0, 5),
(16, '0.0', '0.0', '0.0', 0, 0, 5),
(17, '0.0', '0.0', '0.0', 0, 0, 5),
(18, '0.0', '0.0', '0.0', 0, 0, 5),
(19, '0.0', '0.0', '0.0', 0, 0, 5),
(20, '0.0', '0.0', '0.0', 0, 0, 5),
(21, '0.0', '0.0', '0.0', 0, 0, 5),
(22, '0.0', '0.0', '0.0', 0, 0, 5),
(23, '0.0', '0.0', '0.0', 0, 0, 5),
(24, '0.0', '0.0', '0.0', 0, 0, 5),
(25, '0.0', '0.0', '0.0', 0, 0, 5);
What's the error?


Re: Simple Dynamic Vehicle Repair Point [MySQL] - OpticKiller - 05.05.2013

Код:
Error
SQL query:

CREATE TABLE IF NOT EXISTS  `repairpoints` (

 `repairpointID` INT( 10 ) NOT NULL ,
 `repairpointPosX` VARCHAR( 128 ) NOT NULL DEFAULT  '0.0',
 `repairpointPosY` VARCHAR( 128 ) NOT NULL DEFAULT  '0.0',
 `repairpointPosZ` VARCHAR( 128 ) NOT NULL DEFAULT  '0.0',
 `repairpointInterior` INT( 10 ) NOT NULL DEFAULT  '0',
 `repairpointVirtualWorld` INT( 10 ) NOT NULL DEFAULT  '0',
 `repairpointFee` INT( 10 ) NOT NULL DEFAULT  '5',
PRIMARY KEY (  `repairpointID` )
) ENGINE = MYISAM DEFAULT CHARSET = latin1 ROW_FORMAT = DYNAMIC ;

MySQL said: 

#1046 - No database selected
thats the error up! try it fix it mate if u can this is when i turn it into a datebase file on XAMPP