03.04.2010, 12:50
Its Just Business
Basic business generator
What:
Its Just Business(Or IJB) Is a basic made business generator to easily make businesses.
How:
By using the ingame RCON admin only command /createbus you are able to in a instant create new businesses for your server. The command has 3 parametres 'Name' 'Price' 'Payment per 10 minutes' which all will be saved in a dini file named "Business.ini". There is of course more commands to it which is as following
/buybus - Buy the business your standing close to
/sellbus - Sell your business. You need to be near it to sell it
/getprofit - Collect the profit earned from your business
With these commands you have what you need to run a basic business system.
Please note when using createbus you need to be logged in as RCON admin and the parametre 'Name' cannot use spaces.
So creating a business will be like this /createbus TheFourDragons 100000 1000
This will create a business named TheFourDragons which cost 100000 dollars and earns 1000 per 10 minute. The location of the business is the XYZ coordinate of your possition when typing the command.
Please note you must be on foot when using these commands. Will fix this in next version.
What to do:
In the .PWN file you will find a define named MAX_BUSINESS. But this as low as possible without being lower than your ammount of business (Tutorial comment follows in .PWN)
Few Small Downside:
There is a few small downsides of this filterscript which is:
1: Players named NoOwner will be kicked when connecting Only a problem in the first version
2: This filterscript may run alittle slow if MAX_BUSINESS is set too high
3: The Business.ini file will with time become a BIG mess because of it saving both businesses and players.
Please note that this filterscript does not use a register system or money saving. Pro scripters can make it work anyway. I will in time make it better at co-operate with register systems. But a simple system which saves cash should work fine.
Screenshots:
Will add screenshots soon Screenies here
Credits:
Thanks to ****** for sscanf and thanks to DracoBlue for dutils dini and DCMD
Downloading:
PWN and AMX v0.1 Not recommended as its an old version
And pastebin http://pastebin.com/ssKAeMuB Not recommended as its an old version
PWN AMX and INC v0.2
Pastebin v0.2 http://pastebin.com/ErK3Nkvc Note this does not contain the INC code! You can get the include from the download v0.2
Oh and forgot to mention you need the .INC files if you want to compile with no errors. ****** them or search on forum
And remember Its Just Business. Please don't take it personall
New Version!
Whats New:Created a new major diffrence in the script. The NoOwner problem is no longer a problem as it uses a name
with a space bar which is automatically rejected of SA-MP servers.
I have also made a include file which is to be found in the version 0.2 download. This include file adds some functions to your gamemode which is as following:
LoadBusinesses(); - This function has no parametres. It will create the business pickups and is by default in the OnFilterScriptInnit callback in the FS
UnloadBusinesses(); - Has no parametres. Will destroy the created business pickups. But shouldnt destroy others
DoesPlayerOwnBusiness(playerid); - Has a playerid parametre. This will check if the playerid has a business. Returns 1 if yes and 0 if no
IsPlayerInRangeOfBus(playerid); - Has a playerid parametre. This will check if the playerid is in range of any businesses. Returns businessid if true and -1 if false
IsPlayerInRangeOfOwnedBus(playerid); - Has a playerid parametre. This will check if playerid is in range of hes business. Returns businessid if true and -1 if false
GetBusinessCashAmmount(businessid); - Has a businessid parametre. This will return the ammount of cash the player can recieve with /getprofit
Hope you will enjoy my new version
Regards
Desert