SA-MP Forums Archive
[FilterScript] Yet Another Business System - 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] Yet Another Business System (/showthread.php?tid=596578)

Pages: 1 2


Yet Another Business System - rootcause - 19.12.2015

Because I'm very creative when it comes to names.


Features

Dynamic Businesses: You can create businesses in-game and edit/remove them.

Resetting: If a business owner doesn't visit their business in 7 days, they'll lose it. You can configure how many days it takes to reset a business from BUSINESS_DAYS define.

Business Safe: You can deposit your money in the business's safe or take it whenever you want. You can give other players permissions if you want them to use your business's safe.

Permissions: You can give permissions to other players. Permissions allow other players to deposit or take money from your business's safe.

Safe Logs: You can check your safe logs to see who deposited how much money or took how much money from your business. If they're stealing from you, don't be afraid to remove their permissions! Won't bring back the stolen money, though.

Business Selling: You have a business you don't want anymore? You can instantly sell it (boring), or you can put it on sale so other players can buy it for the price you want. This works even if you're offline. Simply if someone buys your business when you're offline, you'll get your money when you join the server.

Business Limit: You can decide how many businesses a player can own by using LIMIT_PER_PLAYER define. If you set it to 0, players can buy any business they want. If you set it to something else, players won't be able to buy more businesses than LIMIT_PER_PLAYER's value. This is added to prevent abusive players buying all the businesses, then putting them on sale for a higher price.

Screenshots






Commands

/business: Opens the business management menu, options you're not allowed to do will be red.

RCON Only:

/createbusiness [price] [earning] [type] - Creates a business on your position.

/gotobusiness [business id] - Teleports you to the business you specified ID of.

/setbusinessprice [business id] [new price] - Sets a business's price to the new price.

/setbusinessearning [business id] [new earning] - Sets a business's earning to the new earning.

/setbusinesstype [business id] [type (optional)] - Sets a business's type to the new type. If you leave the type parameter empty you'll get a dialog which lists all business types.

/resetbusiness [business id] - Resets the business you specified ID of.

/deletebusiness [business id] - Deletes the business you specified ID of.

Notes

MySQL: This filterscript needs a MySQL database to work. The .sql file is not included in the download link because required tables will get created if they don't exist on initialization.

About Interiors: The exit position may look awkward when you go inside a business because I took the interior coordinates from here so you might want to change them. You can do that from BusinessInteriors array starting at line 95, or you can add new interiors/business types from there.

Downloads

Mediafire || Pastebin



Re: Yet Another Business System - maraz1987 - 19.12.2015

efso olmuş krdş


Re: Yet Another Business System - benjaminjones - 20.12.2015

Looks really good! You should've added the /buy command with things to purchase though.


Re: Yet Another Business System - Deniz1467 - 20.12.2015

helal krdş


Re: Yet Another Business System - Ritzy2K - 20.12.2015

Yet Another House System
Yet Another Business Sysem
DDDDDD Good Job!
Hereby have my rep.


Re: Yet Another Business System - Elegy - 20.12.2015

Nice. +1 wanna rep ur job
PHP код:
I not spammer. And post hunter 



Re: Yet Another Business System - rootcause - 20.12.2015

Quote:
Originally Posted by benjaminjones
Посмотреть сообщение
Looks really good! You should've added the /buy command with things to purchase though.
I was going to do it that way, but I couldn't think of anything that you can buy from businesses except armor and health refills, maybe weapons. If you have any ideas about what to sell, I may do a /buy version.


Re: Yet Another Business System - SecretBoss - 20.12.2015

Why it doesn't update the owner? Whenever I buy a business and close the server business, doesn't seem to get updated

I made a command to test if the function is loading command is the following

Код:
CMD:savebusiness(playerid, params[])
{
	LevelCheck(playerid, 5);
	foreach(new i : Business)
	    Business_Save(i);
	Server(playerid, "Businesses saved.");
	return 1;
}
Whenever this command is called businesses are saving but when

Код:
	foreach(new i : Business)
	    Business_Save(i);
is called on "OnFilterScriptExit" callback it doesn't work, I can't really understand what's the problem, logs printing nothing I also tried CallLocalFunction but it didn't work


Re: Yet Another Business System - rootcause - 21.12.2015

Quote:
Originally Posted by SecretBoss
Посмотреть сообщение
Why it doesn't update the owner? Whenever I buy a business and close the server business, doesn't seem to get updated

I made a command to test if the function is loading command is the following

Код:
-snip-
Whenever this command is called businesses are saving but when

Код:
-snip-
is called on "OnFilterScriptExit" callback it doesn't work, I can't really understand what's the problem, logs printing nothing I also tried CallLocalFunction but it didn't work
How do you close the server? I always write exit to the console and everything gets saved.

If you don't use exit command, OnGameModeExit and OnFilterScriptExit for loaded filterscripts won't get called if I remember correctly.


Re: Yet Another Business System - SecretBoss - 22.12.2015

Quote:
Originally Posted by rootcause
Посмотреть сообщение
How do you close the server? I always write exit to the console and everything gets saved.

If you don't use exit command, OnGameModeExit and OnFilterScriptExit for loaded filterscripts won't get called if I remember correctly.
Yea you are right, but some people never use it, or gamemode will may crash some times I am not sure if ongamemodeexit is called there anyway, what will happen if someone using the same interiors on other scripts? You are creating a pickup and a label on interior without setting the virtual world so on every interior where player enters it will be the pickup. You can get business's id and sum it with a number to generate a different world for each business so players will never meet.


Re: Yet Another Business System - Jonggol - 18.04.2016

Maybe you can make profit business. Like profit one week or one day. for next update


Re: Yet Another Business System - Slawiii - 01.05.2016

Very nice bro thanks


Re: Yet Another Business System - N0FeaR - 01.05.2016

Good job, i like it, rep!


Re: Yet Another Business System - Kucin666 - 07.05.2016

Very nice rootcause, thank you


Re: Yet Another Business System - Mark_Samp - 07.05.2016

I Love it!!


Re: Yet Another Business System - TheSimpleGuy - 07.05.2016

Very good Filterscript, nice


Re: Yet Another Business System - Radio - 08.05.2016

Very nice mate.


Re: Yet Another Business System - legendd - 08.05.2016

Really like it, gonna use this one!


Re: Yet Another Business System - Amunra - 12.05.2016

Nice bro..
Epic for Roleplay !


Re: Yet Another Business System - 2k16 - 15.05.2016

Nice. Next update please added command go home.