SA-MP Forums Archive
[Include] S32_Business - Create business with just one line! (MySQL, YCMD, sscanf... A lot of functions & features) - 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)
+---- Forum: Includes (https://sampforum.blast.hk/forumdisplay.php?fid=83)
+---- Thread: [Include] S32_Business - Create business with just one line! (MySQL, YCMD, sscanf... A lot of functions & features) (/showthread.php?tid=296811)

Pages: 1 2


S32_Business - Create business with just one line! (MySQL, YCMD, sscanf... A lot of functions & features) - System64 - 13.11.2011

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

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

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



Re: S32_Business - Create business with just one line! (MySQL, YCMD, sscanf... A lot of functions & features) - Kavinsky - 13.11.2011

Nice Work System


Re: S32_Business - Create business with just one line! (MySQL, YCMD, sscanf... A lot of functions & features) - TomTroX - 13.11.2011

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


Re: S32_Business - Create business with just one line! (MySQL, YCMD, sscanf... A lot of functions & features) - System64 - 13.11.2011

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!


Re: S32_Business - Create business with just one line! (MySQL, YCMD, sscanf... A lot of functions & features) - Speed - 13.11.2011

Nice, maybe SBizz to do??


Re: S32_Business - Create business with just one line! (MySQL, YCMD, sscanf... A lot of functions & features) - System64 - 13.11.2011

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


Re: S32_Business - Create business with just one line! (MySQL, YCMD, sscanf... A lot of functions & features) - [LaTinb0y]...$ag3R - 13.11.2011

does this give us money ..tooo like this

your business afair 5000


and can we create business by commands ..like

/createbus................can we ?


Re: S32_Business - Create business with just one line! (MySQL, YCMD, sscanf... A lot of functions & features) - System64 - 13.11.2011

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


Re: S32_Business - Create business with just one line! (MySQL, YCMD, sscanf... A lot of functions & features) - [LaTinb0y]...$ag3R - 13.11.2011

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 !


Re: S32_Business - Create business with just one line! (MySQL, YCMD, sscanf... A lot of functions & features) - Astralis - 13.11.2011

woah nice job. Easy business creating. 5/5


Re: S32_Business - Create business with just one line! (MySQL, YCMD, sscanf... A lot of functions & features) - System64 - 13.11.2011

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


Re: S32_Business - Create business with just one line! (MySQL, YCMD, sscanf... A lot of functions & features) - ChickenInDark - 13.11.2011

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


Re: S32_Business - Create business with just one line! (MySQL, YCMD, sscanf... A lot of functions & features) - System64 - 13.11.2011

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


Re: S32_Business - Create business with just one line! (MySQL, YCMD, sscanf... A lot of functions & features) - ExTro - 13.11.2011

Looks Decent, good job.


Re: S32_Business - Create business with just one line! (MySQL, YCMD, sscanf... A lot of functions & features) - MS:RP Mason - 14.11.2011

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


Re: S32_Business - Create business with just one line! (MySQL, YCMD, sscanf... A lot of functions & features) - System64 - 14.11.2011

thanks

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


AW: S32_Business - Create business with just one line! (MySQL, YCMD, sscanf... A lot of functions & features) - Mellnik - 29.02.2012

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?


Re: S32_Business - Create business with just one line! (MySQL, YCMD, sscanf... A lot of functions & features) - System64 - 29.02.2012

find that 2 functions and uncomment them!


Re: S32_Business - Create business with just one line! (MySQL, YCMD, sscanf... A lot of functions & features) - Guitar - 29.02.2012

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


Re: S32_Business - Create business with just one line! (MySQL, YCMD, sscanf... A lot of functions & features) - System64 - 29.02.2012

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