[Include] S32_Business - Create business with just one line! (MySQL, YCMD, sscanf... A lot of functions & features)
#1

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 Код:
/*

 • 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 http://weedarr.wikidot.com/interior or https://sampwiki.blast.hk/wiki/InteriorIDs
        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 Код:
/*

 • 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 Код:
/*

 • 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!
Reply
#2

Nice Work System
Reply
#3

Код:
 • Action: Called when player enter house!
House?
Reply
#4

thanks
Quote:
Originally Posted by TomTroX
Посмотреть сообщение
Код:
 • Action: Called when player enter house!
House?
haha, I copied from HS and forgot to change that, thanks, fixed!
Reply
#5

Nice, maybe SBizz to do??
Reply
#6

Quote:
Originally Posted by Speed
Посмотреть сообщение
Nice, maybe SBizz to do??
thanks, why sbizz? I mean there is no functionality of that, that use just fucking GF -.-
Reply
#7

does this give us money ..tooo like this

your business afair 5000


and can we create business by commands ..like

/createbus................can we ?
Reply
#8

Quote:
Originally Posted by [LaTinb0y]...$ag3R
Посмотреть сообщение
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
Reply
#9

Quote:
Originally Posted by System64
Посмотреть сообщение
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 !
Reply
#10

woah nice job. Easy business creating. 5/5
Reply
#11

Neonman - Thank you so much, more thing will come...
Quote:
Originally Posted by [LaTinb0y]...$ag3R
Посмотреть сообщение
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 !
Are you crazy? Fuck off from this thread if you don't like it, you don't like it because I don't give you reputation, you noob, asking for rep. is so nobish....
Reply
#12

I Like this, and gona us this, but meybe add 1 buziness for example. Thank U
Reply
#13

Quote:
Originally Posted by ChickenInDark
Посмотреть сообщение
I Like this, and gona us this, but meybe add 1 buziness for example. Thank U
You can see business in CreateBusiness documenation
Reply
#14

Looks Decent, good job.
Reply
#15

Okay, how do i put this in? like plugin? or filterscript
Reply
#16

thanks

mason: can you read? This is include if you don't know how to use include do some research on forum
Reply
#17

C:\Users\Mellnik\Desktop\S32_House.pwn(1615) : error 017: undefined symbol "GetName"
C:\Users\Mellnik\Desktop\S32_House.pwn(1619) : error 017: undefined symbol "GetWeapon"


What to do?
Reply
#18

find that 2 functions and uncomment them!
Reply
#19

It's great, but I'd like to see something like /sellbusto playerid price .
Reply
#20

Quote:
Originally Posted by Guitar
Посмотреть сообщение
It's great, but I'd like to see something like /sellbusto playerid price .
is it too hard to /sellbusiness and than other guy /buybusiness? xD
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)