SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Filterscripts > Includes

Reply
 
Thread Tools Display Modes
Old 13/11/2011, 08:10 AM   #1
System64
Gangsta
 
System64's Avatar
 
Join Date: May 2011
Location: Zadar, Croatia
Posts: 933
Reputation: 143
Default S32_Business - Create business with just one line! (MySQL, YCMD, sscanf... A lot of functions & features)


Introduction

Hi all
How I have a house system I need business too Now he is here!

This business system is very useful (I think) because you create business with just one line, also there is a lot of functions and features! I decide to make this because new scripters can easy add business and they can learn a lot of with this include! I hope you will like it!



Features
  • Creating business with just one line!
  • 21 functions
  • 5 commands
  • 2 callbacks
  • Buying business, selling business, locking business, unlocking business, controling business...


Functions

pawn Code:
/*

  Function: CreateBusiness(Float: EnterX, Float: EnterY, Float: EnterZ, Interior, Float: InteriorX, Float: InteriorY, Float: InteriorZ, Price, VirtualWorld, RentPrice)
  Data storage: MySQL (G-Stylezzz's plugin)
  Usage: Creating business, use this in OnGameModeInit or OnFilterScriptInit!
  Parameters:
        EnterX, EnterY, EnterZ: Coordinates where you can enter business, also on that coordiantes will create pickup and 3D text!
        ExitX, ExitY, ExitZ: Coordinates where you can exit business, this coordinates are coordiantes of interior, you can find interiors on [url]http://weedarr.wikidot.com/interior[/url] or [url]http://wiki.sa-mp.com/wiki/InteriorIDs[/url]
        Interior: ID of interior you want, see the web page on the parameter above
        Price: Price for buying business
        VirtulWorld: Always increase this because if you have 2 same interior and player are in the (Example one is in his house, second is in his too) they will see themself, It will look that they have same house! (Bad explained :/)
  Example: CreateBusiness(-2395.9585,-601.2695,132.6484, 3, 384.808624,173.804992,1008.382812, 7000, 0);

*/


/*

  Function: GetBusinessUser(businessid)
  Usage: Getting name of user of specific business!
  Parameters:
        businessid: ID of business that you want to get user (owner)
  Example: format(string, sizeof(string), "Business user of business id %d is %s", businessid, GetHouseUser(businessid));

*/


/*

  Function: GetBusinessEnterPos(houseid)
  Usage: Getting the enter position (XYZ) of specific business!
  Parameters:
        businessid: ID of business that you want to get enter position
  Example: format(string, sizeof(string), "Business enter XYZ of business id %d is %s", businessid, GetBusinessEnterPos(businessid));

*/


/*

  Function: GetBusinessExitPos(houseid)
  Usage: Getting the exit position (XYZ) of specific business!
  Parameters:
        businessid: ID of business that you want to get exit position
  Example: format(string, sizeof(string), "Business exit XYZ of business id %d is %s", businessid, GetBusinessExitPos(businessid));

*/


/*

  Function: GetBusinessEnterX(businessid)
  Usage: Getting the enter X position of specific business!
  Parameters:
        businessid: ID of business that you want to get enter X position
  Example: format(string, sizeof(string), "Business enter X of business id %d is %s", businessid, GetBusinessEnterX(businessid));

*/


/*

  Function: GetBusinessEnterY(businessid)
  Usage: Getting the enter Y position of specific business!
  Parameters:
        businessid: ID of business that you want to get enter Y position
  Example: format(string, sizeof(string), "Business enter Y of business id %d is %s", businessid, GetBusinessEnterY(businessid));

*/


/*

  Function: GetBusinessEnterZ(businessid)
  Usage: Getting the enter Z position of specific business!
  Parameters:
        businessid: ID of business that you want to get enter Z position
  Example: format(string, sizeof(string), "Business enter Z of business id %d is %s", businessid, GetBusinessEnterZ(businessid));

*/


/*

  Function: GetBusinessExitX(businessid)
  Usage: Getting the exit X position of specific business!
  Parameters:
        businessid: ID of business that you want to get exit X position
  Example: format(string, sizeof(string), "Business exit X of business id %d is %s", businessid, GetBusinessExitX(businessid));

*/


/*

  Function: GetBusinessExitY(businessid)
  Usage: Getting the exit Y position of specific business!
  Parameters:
        businessid: ID of business that you want to get exit Y position
  Example: format(string, sizeof(string), "Business exit Y of business id %d is %s", businessid, GetBusinessExitY(businessid));

*/


/*

  Function: GetBusinessExitZ(businessid)
  Usage: Getting the exit Z position of specific business!
  Parameters:
        businessid: ID of business that you want to get exit Z position
  Example: format(string, sizeof(string), "Business exit Z of business id %d is %s", businessid, GetBusinessExitZ(businessid));

*/


/*

  Function: GetBusinessPrice(businessid)
  Usage: Getting the price of specific business!
  Parameters:
        businessid: ID of business that you want to get price
  Example: format(string, sizeof(string), "Business price of business id %d is %s", businessid, GetBusinessPrice(businessid));

*/


/*

  Function: GetBusinessInterior(businessid)
  Usage: Getting the interior of specific business!
  Parameters:
        businessid: ID of business that you want to get interior
  Example: format(string, sizeof(string), "Business interior of business id %d is %s", businessid, GetBusinessInterior(businessid));

*/


/*

  Function: GetBusinessVirtualWorld(businessid)
  Usage: Getting the virtualworld of specific business!
  Parameters:
        businessid: ID of business that you want to get virtualworld
  Example: format(string, sizeof(string), "Business virtualworld of business id %d is %s", businessid, GetBusinessVirtualWorld(businessid));

*/


/*

  Function: GetBusinessMoney(businessid)
  Usage: Getting the money of specific business!
  Parameters:
        businessid: ID of business that you want to get money
  Example: format(string, sizeof(string), "Business money of business id %d is %s", businessid, GetBusinessMoney(businessid));

*/


/*

  Function: GetTotalBusiness(businessid)
  Usage: Getting the total business, use this in OnGameModeInit after all business!
  Example: printf("Total business: %d", GetTotalBusiness());

*/


/*

  Function: IsBusinessOwned(businessid)
  Usage: Checking if is bussines owned of specific business!
  Parameters:
        businessid: ID of business that you want to check if is owned
  Example: if(IsBusinessOwned(businessid)) SendClientMessage(playerid, -1, "Business is owned!");
            else SendClientMessage(palyerid, -1, "Business is not owned!");

*/


/*

  Function: IsBusinessLocked(businessid)
  Usage: Checking if is business locked of specific business!
  Parameters:
        businessid: ID of business that you want to check if is locked
  Example: if(IsBusinessOwned(businessid)) SendClientMessage(playerid, -1, "Business is locked!");
            else SendClientMessage(palyerid, -1, "Business is not locked!");

*/


/*

  Function: IsBusinessExist(businessid)
  Usage: Checking if is exist of specific business!
  Parameters:
        businessid: ID of business that you want to check if is exist
  Example: if(IsBusinessExist(businessid)) SendClientMessage(playerid, -1, "Business exist!");
            else SendClientMessage(palyerid, -1, "Business doesn't exist!");

*/


/*

  Function: IsPlayerBuyBusiness(playerid, businessid)
  Usage: Checking if is player buyed business (used when you try to buy business but you already have house)!
  Parameters:
        playerid: ID of player that you want preform check
        businessid: ID of business that you want to check if is player buy business
  Example: if(IsPlayerBuyBusiness(playerid, businessid)) return SendClientMessage(playerid, -1, "You buy this business already!");
            else SendClientMessage(playerid, -1, "You didn't buy this business!");

*/


/*

  Function: IsPlayerBuyBusiness(playerid, businessid)
  Usage: Checking if is player buyed any business!
  Parameters:
        playerid: ID of player that you want preform check
  Example: if(IsPlayerBuyAnyBusiness(playerid)) return SendClientMessage(playerid, -1, "You buy any business already!");
            else SendClientMessage(playerid, -1, "You didn't buy any business!");

*/


/*

  Function: IsPlayerBusinessOwner(playerid, businessid)
  Usage: Checking if is player owner of specific business!
  Parameters:
        playerid: ID of player that you want preform check
        businessid: ID of vusiness that you want to check if is player owner
  Example: if(IsPlayerBusinessOwner(playerid, businessid)) return SendClientMessage(playerid, -1, "You are owner of the business!");
            else SendClientMessage(playerid, -1, "You are not owner of the business!");

*/


Commands

pawn Code:
/*

  Command: /buyhouse
  Processor: y_commands (YCMD)
  Usage: Buying business (Player must be in range of business he want to buy!)

*/


/*

  Command: /sellbusiness
  Processor: y_commands (YCMD)
  Usage: Selling business (Player must be in range of business he want to sell!)

*/


/*

  Command: /lockbusiness
  Processor: y_commands (YCMD)
  Usage: Locking business (Player must be in range of his business to lock it!)

*/


/*

  Command: /unlockbusiness
  Processor: y_commands (YCMD)
  Usage: Unlocking business (Player must be in range of his business to unlock it!)

*/


/*

  Command: /businesscontrol
  Processor: y_commands (YCMD)
  Usage: Controling your business: lock business, unlock business, storing money in business, taking money from business (Player must be in his house to control it!)

*/


Callbacks

pawn Code:
/*

  Callback: OnPlayerEnterBusiness(playerid, businessid)
  Action: Called when player enter business!
  Example: if(IsPlayerBusinessOwner(playerid, businessid) SendClientMessage(playerid, -1, "You entered your business!");

*/


/*

  Callback: OnPlayerExitBusiness(playerid, businessid)
  Action: Called when player exit business!
  Example: if(IsPlayerBusinessOwner(playerid, businessid) SendClientMessage(playerid, -1, "You exited your business!");

*/


Necessary things

MySQL Plugin by G-Stylezz aka BlueG
y_hooks by ******
y_commands by ******
sscanf by ******
foreach by ******



Notes
  • There is no a lot of fetures like in house system because house system haves a lot of features, so maybe it would be little bad that you can rob house, rob business etc.
  • You can store just money in the business and every one hour you get 1000$ in your business!
    You can easily change price with #define BUSINES_PAYMENT!


Video

[ame]http://www.youtube.com/watch?v=HZCrdCtwsfI&feature=feedu[/ame]


Download

Pastebin (v1.0.0)


Mediafire (v1.0.0)


Solidfiles (v1.0.0)



Credits
  • System32 - Almost everything!
  • The Guy - Helped me a lot, thank you!
  • ****** - y_hooks, y_commands, sscanf & foreach!
  • G-Stylezz (BlueG) - MySQL plugin!
__________________
All my works
I left SA:MP! Maybe once I start scripting again but now I'm based on web programming
Soon, I'll buy domain system32.com.hr but for now you can contact me on LogoOff or on my Youtube channel!

Last edited by System64; 14/11/2011 at 10:05 AM.
System64 is offline   Reply With Quote
Old 13/11/2011, 08:41 AM   #2
Kavinsky
Little Clucker
 
Kavinsky's Avatar
 
Join Date: Oct 2011
Posts: 20
Reputation: 3
Default Re: S32_Business - Create business with just one line! (MySQL, YCMD, sscanf... A lot of functions & features)

Nice Work System
__________________
My Work

Code:
[Include]KFU - Kavinsky Useful Functions
[Include]K_Fader - Kavinsky Screen Fader
[Filterscripts]K_LS - Kavinsky Loading Screen
Kavinsky is offline   Reply With Quote
Old 13/11/2011, 08:57 AM   #3
TomTroX
Big Clucker
 
Join Date: Dec 2009
Location: Poland
Posts: 72
Reputation: 0
Default Re: S32_Business - Create business with just one line! (MySQL, YCMD, sscanf... A lot of functions & features)

Code:
  Action: Called when player enter house!
House?
__________________
Sorry for my English, I'm Polish.
TomTroX is offline   Reply With Quote
Old 13/11/2011, 09:01 AM   #4
System64
Gangsta
 
System64's Avatar
 
Join Date: May 2011
Location: Zadar, Croatia
Posts: 933
Reputation: 143
Default Re: S32_Business - Create business with just one line! (MySQL, YCMD, sscanf... A lot of functions & features)

thanks
Quote:
Originally Posted by TomTroX View Post
Code:
  Action: Called when player enter house!
House?
haha, I copied from HS and forgot to change that, thanks, fixed!
__________________
All my works
I left SA:MP! Maybe once I start scripting again but now I'm based on web programming
Soon, I'll buy domain system32.com.hr but for now you can contact me on LogoOff or on my Youtube channel!
System64 is offline   Reply With Quote
Old 13/11/2011, 09:51 AM   #5
Speed
Huge Clucker
 
Join Date: Jan 2011
Posts: 206
Reputation: 7
Default Re: S32_Business - Create business with just one line! (MySQL, YCMD, sscanf... A lot of functions & features)

Nice, maybe SBizz to do??
Speed is offline   Reply With Quote
Old 13/11/2011, 10:01 AM   #6
System64
Gangsta
 
System64's Avatar
 
Join Date: May 2011
Location: Zadar, Croatia
Posts: 933
Reputation: 143
Default Re: S32_Business - Create business with just one line! (MySQL, YCMD, sscanf... A lot of functions & features)

Quote:
Originally Posted by Speed View Post
Nice, maybe SBizz to do??
thanks, why sbizz? I mean there is no functionality of that, that use just fucking GF -.-
__________________
All my works
I left SA:MP! Maybe once I start scripting again but now I'm based on web programming
Soon, I'll buy domain system32.com.hr but for now you can contact me on LogoOff or on my Youtube channel!
System64 is offline   Reply With Quote
Old 13/11/2011, 03:01 PM   #7
[LaTinb0y]...$ag3R
Big Clucker
 
[LaTinb0y]...$ag3R's Avatar
 
Join Date: Oct 2011
Location: california
Posts: 90
Reputation: 7
Question Re: S32_Business - Create business with just one line! (MySQL, YCMD, sscanf... A lot of functions & features)

does this give us money ..tooo like this

your business afair 5000


and can we create business by commands ..like

/createbus................can we ?
__________________
My server vedio :.


if i have helped you...dont forget to push under my name......thanks alot !

My vedio :.You can get san andreas for free for pc !

[LaTinb0y]...$ag3R is offline   Reply With Quote
Old 13/11/2011, 03:04 PM   #8
System64
Gangsta
 
System64's Avatar
 
Join Date: May 2011
Location: Zadar, Croatia
Posts: 933
Reputation: 143
Default Re: S32_Business - Create business with just one line! (MySQL, YCMD, sscanf... A lot of functions & features)

Quote:
Originally Posted by [LaTinb0y]...$ag3R View Post
does this give us money ..tooo like this

your business afair 5000


and can we create business by commands ..like

/createbus................can we ?
of course you can't
That's called dynamic business creating, I don't like that, I made that just for HS, not for business too
__________________
All my works
I left SA:MP! Maybe once I start scripting again but now I'm based on web programming
Soon, I'll buy domain system32.com.hr but for now you can contact me on LogoOff or on my Youtube channel!
System64 is offline   Reply With Quote
Old 13/11/2011, 03:06 PM   #9
[LaTinb0y]...$ag3R
Big Clucker
 
[LaTinb0y]...$ag3R's Avatar
 
Join Date: Oct 2011
Location: california
Posts: 90
Reputation: 7
Thumbs down Re: S32_Business - Create business with just one line! (MySQL, YCMD, sscanf... A lot of functions & features)

Quote:
Originally Posted by System64 View Post
of course you can't
That's called dynamic business creating, I don't like that, I made that just for HS, not for business too
then it is fuck......it have to be dynamic......................that other house system that GATHOUSE is better then your house system.................close your thread now !
__________________
My server vedio :.


if i have helped you...dont forget to push under my name......thanks alot !

My vedio :.You can get san andreas for free for pc !

[LaTinb0y]...$ag3R is offline   Reply With Quote
Old 13/11/2011, 03:07 PM   #10
Astralis
Guest
 
Posts: n/a
Default Re: S32_Business - Create business with just one line! (MySQL, YCMD, sscanf... A lot of functions & features)

woah nice job. Easy business creating. 5/5
  Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Include] S32_House v1.0.0 - Create house with just one line! (MySQL, YCMD, sscanf... A lot of functions & features) System64 Includes 156 20/05/2014 04:06 PM
[Tutorial] Making a simple count down with sscanf and YCMD. FireCat Tutorials 33 18/05/2013 06:22 PM
Problem with YCMD and SSCANF :S OUL Help Archive 9 21/06/2011 11:05 PM
[Include] [INC] Teleport | 1 line | File & 3D support | 40+ functions | Update: 2010.03.17 [HUN]Gamestar Includes 18 10/06/2010 09:22 PM
[Tool/Web/Other] [PHP] Create an Start/Stop functions for more one server carlino1994 Server Support 1 29/06/2009 06:00 PM


All times are GMT. The time now is 12:22 AM.


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