[Include] [INC]Property-System [V 1.6.8] =>Update 2nd of April 2008<=
#1

Property System
+PropertyCreator
+Example Filterscript
What is it:
With this filterscript you can add properties to your server very easy
You only need 1 line for 1 property.
You can buy and sell properties, every (default) 60 seconds you will receive an amount of money.

If you want to add houses, including interiors, renting and house-cars.
I recommend you to download Simple House System by Antironix

This Include is not very complex, it's just a simple way to invest and earn money
I made this Include because many people asked if i could make a property-system, so here it is!

Update History:

[V 1.0]
  • First Release
[V 1.5]
  • Removed 'propertyID' param in the AddProperty-function
  • AddProperty returns now it's new ID, so now you can now define properties. (for example:
Код:
new Hotel;
Hotel = AddProperty("Royal Hotel", 3.2, 523.1, 900.0, 4000, 321, 51);
  • Added GetPropertyInfo(propertyID, &Float:X, &Float:Y, &Float:Z, &Price, &SellValue, &Earning);
  • Added GetPropertyName(propertyID);
  • Added GetPropertyOwner(propertyID);
  • Added GetPropertyStatus(propertyID);
  • Added ToggleProperty(propertyID, toggle);

[V 1.6] March 31th 2008/size]
  • Added DestroyAllPropertyPickups();
  • Added UsePropertyTextDraw(toggle);
  • Added Fixed some bugs
[size=10pt][V 1.6.8] (April 2nd 200
  • Added SetPropertyPrice(propertyID, price);
  • Added SetPropertySellValue(propertyID, value);
  • Added SetPropertyEarning(propertyID, earning);
  • Added DoesPropertyExists(propertyID);
  • Added IsPlayerNearProperty(playerid);
  • Added SaveProperty(propertyID, const comment[]);
  • Fixed bug where pickup of first property didn't work
  • Fixed bug where playerid '0' saw all properties instead of only his/hers own when doing /myproperties
  • Released Example Filterscript
Please read this manual very carefully!


How to instal:
- Download properties.inc and copy that file into your pawno/includes folder

- Add on top of you Gamemode:
Код:
#include <properties>
- To add a property, add this at OnGameModeInit (or OnfilterscriptInit() if you're going to use it as a filterscript):
Код:
AddProperty("Name", Float:X, Float:Y, Float:Z, Price, SellValue, Earning);
  • Name: This will be the name of the new property
  • Float:X: This will be the X-coordinate of the property
  • Float:Y: This will be the Y-coordinate of the property
  • Float:Z: This will be the Z-coordinate of the property
  • Value: Players will have to pay this amount to buy this property
  • SellValueL Player will receive this amount of money when he/she sells this property
  • Earning:The owner of this property will receive every 60 seconds (default) this amount of money
- Place at your OnPlayerDisconnect- or OnPlayerConnect-callback this line:
Код:
ResetPlayerPropertyInfo(playerid);
- Place at your OnPlayerPickupPickup-callback this line:
Код:
OnPropertyPickupPickup(playerid, pickupid);
- Now you have to make 2 commands: /buyproperty and /sellproperty
Therefor you need this:
Код:
if (strcmp("/buyproperty", cmdtext, true) == 0)
{
  BuyPropertyForPlayer(playerid);
  return 1;
}
if (strcmp("/sellproperty", cmdtext, true) == 0)
{
  SellPropertyForPlayer(playerid);
  return 1;
}
Ofcourse you have to place these 2 commands in your OnPlayerCommandText-callback.
The BuyPropertyForPlayer-function will already check if the player is near a checkpoint, if he/she has enough money, if he/she doesn't exeed the max-properties-per-player-limit and if the property is not owned yet by someone else or the player him/herself.


Configuration:

To set limit of properties every player can own, use:
Код:
SetMaxPropertiesPerPlayer(amount);
To change the default payout-frequency, use:
Код:
SetPayoutFrequency(seconds);
If you want to see a textdraw showing some info about the property if you pickup its icon, use:
Код:
UsePropertyTextDraw(1);
If you fill in '0' a GameText will apear instead of a textdraw.
(See screenshots below)

Other Functions:

You can locate a property if you use the function:
Код:
LocatePropertyForPlayer(property, playerid);
This will create a checkpoint on the place of the property.
You can disable the checkpoint with the function DisablePlayerCheckpoint(playerid);

To view the properties you own + some info.
You can use this function:
Код:
GetPlayerProperties(playerid);
The function:
Код:
GetPropertyInfo(propertyID, &Float:X, &Float:Y, &Float:Z, &Price, &SellValue, &Earning);
will return the coords, price, sellvalue and earning of that property

Код:
GetPropertyName(propertyID);
will return the name of that property

Код:
GetPropertyOwner(propertyID);
will, if owned return the name of the property-owner
If the property is not owned, it will return "nobody"

Код:
GetPropertyStatus(propertyID);
If the property is enabled, this function will return "enabled"
Else if the property is disabled, this function will return "disabled"

Код:
ToggleProperty(propertyID, toggle);
With this function you can enable or disable a property.
If a property is disabled you are not able to buy that property.
Note: If you disable a property, this green house-icon will not be removed!

Код:
DestroyAllPropertyPickups();
Use this at OnGameModeExit or OnFilterScriptExit, this will destroy all greenhouse icons for the properties.

Код:
SetPropertyPrice(propertyID, price);
Will set a new price of a property.

Код:
SetPropertySellValue(propertyID, value);
Will set a new value of a property.

Код:
SetPropertyEarning(propertyID, earning);
Will set a new earning of a property.

Код:
DoesPropertyExists(propertyID);
will return '1' when the property exists and '0' if it doesn't.

Код:
IsPlayerNearProperty(playerid);
will return the ID of the property if the player is near (default max 3 coords) of a property.
it will retrurn '-1' the player is not near a property

Код:
SaveProperty(propertyID, const comment[]);
This function will save the property with the current price, value and earning + optional comment.
It will get saved in the file 'SavedProperties.txt' witch will get created in your scriptfiles-folder in this format:
Quote:

AddProperty("Current Name", X, Y, Z, current Price, current Value, current Earning); // (optional comment)

You can use this function for example when you changed some info about a property.
After you saved a property, you only have copy/paste that new line into your filterscript or gamemode.
(Don't forget to delete the old line!!)


Example adding Properties:
Код:
public OnGameModeInit()
{
  AddProperty("CJ's Home", 2495.2581, -1686.3400, 13.5139, 50000, 10000, 1000);
  AddProperty("Royal Hotel", 327.7912, -1514.7765, 36.0391, 164000, 50000, 6500);
  AddProperty("SexShop Las Venturas", 2088.5579, 2074.0867, 10.8203, 37500, 6000, 670);
  return 1;
}
PropertyCreator:

This is a little filterscript, including 1 command to create a new property.
How to instal:
- Download PropertyCreator.pwn
- Compile
- Run as filterscript
- Go ingame
- Login as rcon-admin
- Go to position where you want to have your new property located
- Use command: /AddProperty [Name] [Price] [SellValue] [Earning]
For example:
Quote:

/AddProperty Hotel 40000 10000 750

Note: For the name: DO NOT USE SPACES!!. You can add them later!

- Now go to your scriptfiles-folder, there is a file called 'SavedProperties.txt'
- Copy the new lines into your Gamemode
- Compile and restart your gamemode, and properties are ready to get bought

Download links for PropertyCreator:
- PropertyCreator.pwn (MediaFire)
- PropertyCreator.pwn (MyFreefilehosing.com)


Example Filterscript:

This filterscript is ready-to-use, it has some pre-made properties (6 houses in GroveStreet).
It also has example commands:
  • /propertyhelp
  • /buyproperty
  • /sellproperty
  • /myproperties
  • /getpropertyID
  • /locateproperty [ID]
  • /disableCP
  • /propertyinfo [ID]
  • RconAdmin-commands:
  • /SetPropertyPrice [ID] [Price]
  • /SetPropertyValue [ID] [Value]
  • /SetPropertyEarning [ID] [Earning]
  • /disableproperty [ID]
  • /enableproperty [ID]
  • /saveproperty [optional comment]
Download links for Example Filterscript:
- Properties.pwn (MediaFire)
- Properties.pwn (MyFreefilehosing.com)

Screenshots:


On the left you see a textdraw witch gets created when the player enters the green housepickup


If you decide to use GameText instead of Textdraw, it will look like this.

Btw: I already fixed the typo you can see in the chat. ("You received $1670 from you properties")


This image shows the menu you will see when you use the function GetPlayerProperties(playerid);


Download:

[Version 1.6.8] April 2nd
- properties.inc (MediaFire)
- properties.inc (MyFreeFileHosting)

[Version 1.6] (Fixed)
- properties.inc (MediaFire)
- properties.inc (MyFreeFileHosting)

[Version 1.5]
- properties.inc (MediaFire
- properties.inc (myfreefilehosting.com)

[Version 1.0]
- properties.inc (MediaFire)
- properties.inc (SendSpace)
- properties.inc (myfreefilehosting.com)


Credits:
  • Sneaky! - PlayerToPoint-function
  • =>Sandra<= - Rest of this code

Notes:

- Remember: If you disconnect, you will lose your properties!
- Also if you restart your Gamemode, all properties will be reset.
- If you have any suggestions, post them here.
- If you found a bug, please report it in this topic.

I hope you will enjoy my 11th release

Please give comments!
=>Sandra<=
Reply


Messages In This Thread
[INC]Property-System [V 1.6.8] =>Update 2nd of April 2008<= - by Sandra18[NL] - 25.03.2008, 01:10
Re: [INC]Property-System <<Easy To Use Properties>> - by Exuro - 25.03.2008, 01:36
Re: [INC]Property-System <<Easy To Use Properties>> - by FarePak - 25.03.2008, 01:51
Re: [INC]Property-System <<Easy To Use Properties>> - by snipe69 - 25.03.2008, 02:22
Re: [INC]Property-System <<Easy To Use Properties>> - by FarePak - 25.03.2008, 02:29
Re: [INC]Property-System <<Easy To Use Properties>> - by blewert - 25.03.2008, 02:31
Re: [INC]Property-System <<Easy To Use Properties>> - by Sandra18[NL] - 25.03.2008, 03:20
Re: [INC]Property-System <<Easy To Use Properties>> - by Zero_MC - 25.03.2008, 05:46
Re: [INC]Property-System <<Easy To Use Properties>> - by Donny_k - 25.03.2008, 08:55
Re: [INC]Property-System <<Easy To Use Properties>> - by The_Hunter - 25.03.2008, 10:57
Re: [INC]Property-System <<Easy To Use Properties>> - by sebihunter - 25.03.2008, 10:59
Re: [INC]Property-System <<Easy To Use Properties>> - by El0vric - 25.03.2008, 11:01
Re: [INC]Property-System <<Easy To Use Properties>> - by The_Hunter - 25.03.2008, 11:02
Re: [INC]Property-System <<Easy To Use Properties>> - by El0vric - 25.03.2008, 11:04
Re: [INC]Property-System <<Easy To Use Properties>> - by Sandra18[NL] - 25.03.2008, 12:54
Re: [INC]Property-System <<Easy To Use Properties>> - by Antironix - 25.03.2008, 13:50
Re: [INC]Property-System [V 1.5] <<Easy To Use Properties>> - by Sandra18[NL] - 25.03.2008, 15:18
Re: [INC]Property-System [V 1.5] <<Easy To Use Properties>> - by Maikel - 25.03.2008, 15:29
Re: [INC]Property-System [V 1.5] <<Easy To Use Properties>> - by Amit_B - 25.03.2008, 15:40
Re: [INC]Property-System [V 1.5] <<Easy To Use Properties>> - by [IB]Scorcher - 25.03.2008, 15:48
Re: [INC]Property-System [V 1.5] <<Easy To Use Properties>> - by Rks25 - 25.03.2008, 15:57
Re: [INC]Property-System [V 1.5] <<Easy To Use Properties>> - by Sandra18[NL] - 25.03.2008, 17:19
Re: [INC]Property-System [V 1.5] <<Easy To Use Properties>> - by Chris_Smoke - 25.03.2008, 18:01
Re: [INC]Property-System [V 1.5] <<Easy To Use Properties>> - by Zero_MC - 25.03.2008, 18:33
Re: [INC]Property-System [V 1.5] <<Easy To Use Properties>> - by Binebik - 25.03.2008, 18:38
Re: [INC]Property-System [V 1.5] <<Easy To Use Properties>> - by Zero_MC - 25.03.2008, 18:40
Re: [INC]Property-System [V 1.5] <<Easy To Use Properties>> - by P1nd3r - 25.03.2008, 18:42
Re: [INC]Property-System [V 1.5] <<Easy To Use Properties>> - by Sandra18[NL] - 25.03.2008, 19:09
Re: [INC]Property-System [V 1.5] <<Easy To Use Properties>> - by Zero_MC - 25.03.2008, 19:36
Re: [INC]Property-System [V 1.6.8] =>Update 2nd of April 2008<= - by Zero_MC - 04.04.2008, 09:44
Re: [INC]Property-System [V 1.6.8] =>Update 2nd of April 2008<= - by [HiC]TheKiller - 04.04.2008, 22:35
Re: [INC]Property-System [V 1.6.8] =>Update 2nd of April 2008<= - by Zero_MC - 05.04.2008, 07:57
Re: [INC]Property-System [V 1.6.8] =>Update 2nd of April 2008<= - by Fluxx - 05.04.2008, 08:35
Re: [INC]Property-System [V 1.6.8] =>Update 2nd of April 2008<= - by Zero_MC - 05.04.2008, 11:55
Re: [INC]Property-System [V 1.6.8] =>Update 2nd of April 2008<= - by [GM]The_Don - 05.04.2008, 12:54
Re: [INC]Property-System [V 1.6.8] =>Update 2nd of April 2008<= - by Sandra18[NL] - 05.04.2008, 13:43
Re: [INC]Property-System [V 1.6.8] =>Update 2nd of April 2008<= - by GtakriZ - 05.04.2008, 13:48
Re: [INC]Property-System [V 1.6.8] =>Update 2nd of April 2008<= - by Zero_MC - 05.04.2008, 14:14
Re: [INC]Property-System [V 1.6.8] =>Update 2nd of April 2008<= - by [_brB_]Sonic_ - 05.04.2008, 18:29
Re: [INC]Property-System [V 1.6.8] =>Update 2nd of April 2008<= - by GtakriZ - 05.04.2008, 18:37
Re: [INC]Property-System [V 1.6.8] =>Update 2nd of April 2008<= - by holycrap - 05.04.2008, 18:39
Re: [INC]Property-System [V 1.6.8] =>Update 2nd of April 2008<= - by GtakriZ - 05.04.2008, 18:42
Re: [INC]Property-System [V 1.6.8] =>Update 2nd of April 2008<= - by Zero_MC - 06.04.2008, 15:20
Re: [INC]Property-System [V 1.6.8] =>Update 2nd of April 2008<= - by GtakriZ - 08.04.2008, 11:17
Re: [INC]Property-System [V 1.6.8] =>Update 2nd of April 2008<= - by Zero_MC - 09.04.2008, 06:46
Re: [INC]Property-System [V 1.6.8] =>Update 2nd of April 2008<= - by Tomek15 - 12.04.2008, 06:57
Re: [INC]Property-System [V 1.6.8] =>Update 2nd of April 2008<= - by Batista - 12.04.2008, 07:03
Re: [INC]Property-System [V 1.6.8] =>Update 2nd of April 2008<= - by FatherMucker - 12.04.2008, 07:15
Re: [INC]Property-System [V 1.6.8] =>Update 2nd of April 2008<= - by [HiC]TheKiller - 12.04.2008, 08:06
Re: [INC]Property-System [V 1.6.8] =>Update 2nd of April 2008<= - by Beausama - 07.04.2010, 13:47
Re: [INC]Property-System [V 1.6.8] =&gt;Update 2nd of April 2008&lt;= - by ViruZZzZ_ChiLLL - 28.04.2010, 09:18
Re: [INC]Property-System [V 1.6.8] =>Update 2nd of April 2008<= - by kamalhood - 28.05.2010, 04:49
Re: [INC]Property-System [V 1.6.8] =>Update 2nd of April 2008<= - by nicusorbalan - 10.06.2010, 08:28
Re: [INC]Property-System [V 1.6.8] =>Update 2nd of April 2008<= - by BP13 - 25.06.2010, 01:39
Re: [INC]Property-System [V 1.6.8] =>Update 2nd of April 2008<= - by Xx_OutLawZ_xX - 13.08.2010, 13:07
Re: [INC]Property-System [V 1.6.8] =>Update 2nd of April 2008<= - by taylorvinnie - 13.08.2010, 20:02
Re: [INC]Property-System [V 1.6.8] =>Update 2nd of April 2008<= - by Ehab1911 - 14.08.2010, 14:11
Re: [INC]Property-System [V 1.6.8] =>Update 2nd of April 2008<= - by Rocky Balboa - 24.08.2010, 03:49
Re: [INC]Property-System [V 1.6.8] =>Update 2nd of April 2008<= - by royal_king - 24.08.2010, 07:43
Re: [INC]Property-System [V 1.6.8] =>Update 2nd of April 2008<= - by crackpotmark - 30.08.2010, 13:24
Re: [INC]Property-System [V 1.6.8] =>Update 2nd of April 2008<= - by doreto - 02.09.2010, 06:16
Re: [INC]Property-System [V 1.6.8] =>Update 2nd of April 2008<= - by TheDeadLY - 03.12.2010, 21:18
Re: [INC]Property-System [V 1.6.8] =>Update 2nd of April 2008<= - by knackworst - 21.12.2010, 12:59
Re: [INC]Property-System [V 1.6.8] =>Update 2nd of April 2008<= - by TheArcher - 21.12.2010, 13:06
Re: [INC]Property-System [V 1.6.8] =>Update 2nd of April 2008<= - by Elena - 08.01.2011, 23:11
Re: [INC]Property-System [V 1.6.8] =>Update 2nd of April 2008<= - by sandisk125 - 24.01.2011, 17:15
Re: [INC]Property-System [V 1.6.8] =>Update 2nd of April 2008<= - by Fool - 24.01.2011, 17:28
Re: [INC]Property-System [V 1.6.8] =>Update 2nd of April 2008<= - by juraska - 19.05.2011, 16:13
AW: [INC]Property-System [V 1.6.8] =>Update 2nd of April 2008<= - by Forbidden - 01.06.2011, 20:08
Re: [INC]Property-System [V 1.6.8] =>Update 2nd of April 2008<= - by Kostas' - 19.09.2011, 17:02
Re: [INC]Property-System [V 1.6.8] =>Update 2nd of April 2008<= - by Kostas' - 20.09.2011, 14:05
Re: [INC]Property-System [V 1.6.8] =>Update 2nd of April 2008<= - by |_ⒾⓇⓄN_ⒹⓄG_| - 20.09.2011, 14:45
Re: [INC]Property-System [V 1.6.8] =>Update 2nd of April 2008<= - by Kostas' - 20.09.2011, 14:53
Re: [INC]Property-System [V 1.6.8] =>Update 2nd of April 2008<= - by Ehab1911 - 20.09.2011, 17:20
Re: [INC]Property-System [V 1.6.8] =>Update 2nd of April 2008<= - by Vai_Besta - 20.09.2011, 17:22
Re: [INC]Property-System [V 1.6.8] =>Update 2nd of April 2008<= - by Universal Stunter - 29.01.2012, 07:41
Re: [INC]Property-System [V 1.6.8] =>Update 2nd of April 2008<= - by mickos - 02.05.2012, 23:50
Re: [INC]Property-System [V 1.6.8] =>Update 2nd of April 2008<= - by lsreskjn - 12.06.2013, 18:02

Forum Jump:


Users browsing this thread: 5 Guest(s)