SA-MP Forums

SA-MP Forums (https://forum.sa-mp.com/index.php)
-   Filterscripts (https://forum.sa-mp.com/forumdisplay.php?f=17)
-   -   [FilterScript] Yet Another Business System (https://forum.sa-mp.com/showthread.php?t=596578)

rootcause 19/12/2015 11:27 PM

Yet Another Business System
 
Because I'm very creative when it comes to names. :picard:


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


maraz1987 19/12/2015 11:28 PM

Re: Yet Another Business System
 
efso olmuş krdş

benjaminjones 20/12/2015 01:32 AM

Re: Yet Another Business System
 
Looks really good! You should've added the /buy command with things to purchase though.

Deniz1467 20/12/2015 07:46 AM

Re: Yet Another Business System
 
helal krdş

Ritzy2K 20/12/2015 09:30 AM

Re: Yet Another Business System
 
Yet Another House System
Yet Another Business Sysem
:DDDDDDD Good Job!
Hereby have my rep.

Elegy 20/12/2015 09:50 AM

Re: Yet Another Business System
 
Nice. +1 wanna rep ur job
PHP Code:

I not spammer. And post hunter 


rootcause 20/12/2015 11:00 AM

Re: Yet Another Business System
 
Quote:

Originally Posted by benjaminjones (Post 3629351)
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.

SecretBoss 20/12/2015 11:48 AM

Re: Yet Another Business System
 
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

Code:

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

Code:

        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

saffierr 21/12/2015 11:16 PM

Re: Yet Another Business System
 
Really astonishing, really really nice.
Well done, repped.

rootcause 21/12/2015 11:33 PM

Re: Yet Another Business System
 
Quote:

Originally Posted by SecretBoss (Post 3629485)
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

Code:

-snip-
Whenever this command is called businesses are saving but when

Code:

-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.


All times are GMT. The time now is 11:30 AM.

Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.