31.03.2010, 14:15
- Hello everyone, i've been working on this system for a while now, and I think it's ready to be released now. The house system, loads and saves houses through MySQL. The house system also has a house ownership system.
Features
- Threaded querys for faster and more stable loading.
- 1 line one house structure!
- House locking system.
- Build up to 2000 houses, in a few minutes.
Information
- This information is in the top of the script.
Example
- I've given you a example in the script.
Put all AddServerHouse functions in OnFilterScriptInit. Also, don't use id 0, I was unable to figure out why phpmyadmin won't let me start off as zero in auto-increment.
Commands
/enter - Enters the house.
/exit - Exits the house.
/housecommands - View the house commands.
/lockhouse - Locks the house if you own it.
/unlockhouse - Unlocks the house if you own it.
/changehouseprice - This is for rcon admins only. This changes the house price.
/buyhouse - Buy the house.
/sellhouse - Sell the house. If you own it.
Installation Information
- Make sure you change these settings so you can use the system.
I really suggest you keep DB_TABLE_NAME as Houses.
Table Structure
- Insert this table structure into your database manager.
Download
- Enjoy, You also need G-StyleZzZ MySQL plugin to use this.
Features
- Threaded querys for faster and more stable loading.
- 1 line one house structure!
- House locking system.
- Build up to 2000 houses, in a few minutes.
Information
- This information is in the top of the script.
pawn Код:
/*
* @title C-House
* @description - Build in the script /w MySQL loading.
* @author Carlton
*
* - This script is downloadable at the SA-MP forums.
* - Selling this script or re-releasing it without my permission is not allowed
*
* <-- Install guide -->
* - Insert your D.B. info into the defines.
* - Click compile.
*
* <-- House adding -->
* - Use the AddServerHouse function.
*
* <-- Functions -->
* - AddServerHouse(id, Float:X, Float:Y, Float:Z, Interior, Float:ExitX, Float:ExitY, Float:ExitZ, Price);
*
+ id - The house ID, don't duplicate house ids.
* + Float:X - The X coordinate. >
* + Float:Y - The Y coordinate. >> Entrance
* + Float:Z - The Z coordinate. >
* + Interior - The interior id for the house.
* + Float:ExitX - The X coordinate. >
* + Float:ExitY - The Y coordinate. >> Exit location
* + Float:ExitZ - The Z coordinate. >
* + Price - The price of the house.
*
* - SaveHouse(houseid)
* + houseid - The house id you wan't save.
* <-- Support -- >
* Enjoy the house system, post any questions in the topic.
*/
- I've given you a example in the script.
pawn Код:
AddServerHouse(1, 1984.19,-1995.43,16.3322, 9, 315.856170,1024.496459,1949.797363, 9000);
Commands
/enter - Enters the house.
/exit - Exits the house.
/housecommands - View the house commands.
/lockhouse - Locks the house if you own it.
/unlockhouse - Unlocks the house if you own it.
/changehouseprice - This is for rcon admins only. This changes the house price.
/buyhouse - Buy the house.
/sellhouse - Sell the house. If you own it.
Installation Information
- Make sure you change these settings so you can use the system.
pawn Код:
#define DB_HOST ""
#define DB_USER ""
#define DB_PASSWORD ""
#define DB_NAME ""
#define DB_TABLE_NAME "Houses"
Table Structure
- Insert this table structure into your database manager.
Код:
CREATE TABLE IF NOT EXISTS `Houses` ( `HouseID` int(11) NOT NULL auto_increment, `X` float NOT NULL, `Y` float NOT NULL, `Z` float NOT NULL, `Interior` int(11) NOT NULL, `ExitX` float NOT NULL, `ExitY` float NOT NULL, `ExitZ` float NOT NULL, `Price` int(11) NOT NULL, `Owner` text NOT NULL, `Locked` int(11) NOT NULL, PRIMARY KEY (`HouseID`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
- Enjoy, You also need G-StyleZzZ MySQL plugin to use this.