SA-MP Forums Archive
[Tutorial] 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: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Tutorials (https://sampforum.blast.hk/forumdisplay.php?fid=70)
+---- Thread: [Tutorial] Business System (/showthread.php?tid=349466)

Pages: 1 2 3


Re: Business System - maxmax1 - 12.09.2012

Finaly i got it work. Good tutorial. That tutorial showed me, i must read more about Y_ini and other scripting stuff.


Re: Business System - DeadLy™ - 12.09.2012

Nice work! da, good job


Re: Business System - JhnzRep - 17.09.2012

Quote:
Originally Posted by Guitar
View Post
Can you make it

/sellbiztoplayer playerid price

or

/sellbizpublic price and another player comes and buys it and the money goes to the old owner?
I could, I'm probably going to end up fixing up this script and make it more organized in the near future.


Re: Business System - xMaGmOtAnEtHx - 18.09.2012

Very nice tutorial, but today my head is starting to hurt. Can you please post up a Filterscript or the Game Mode. Thank you!


Re: Business System - Brandon_More - 27.09.2012

Wow 100/10 Best one by far


Re: Business System - RenovanZ - 13.10.2012

I've convert this Bizz System to ZCMD, but why i can't use /buybiz ?
Anyone can help me ?


Re: Business System - RenovanZ - 14.10.2012

/exit Command ?


Re: Business System - JhnzRep - 04.11.2012

Quote:
Originally Posted by Kiyozi_Mu
View Post
/exit Command ?
Sorry for the late response, but yea.../enter is also the exit command.


Re: Business System - MrCreed - 29.03.2013

thanks dude, u helped me alot


Re: Business System - FeaRR - 13.04.2013

wow thanks il use this


Re: Business System - kosa451 - 15.09.2013

Thanks


Re: Business System - Dorlevi1506 - 13.11.2013

Can you help me i got 5 errors..
pawn Code:
C:\Users\Winseven\Desktop\Samp\Pro RP SAMP Server\filterscripts\Testbiz.pwn(70) : error 010: invalid function or declaration
C:\Users\Winseven\Desktop\Samp\Pro RP SAMP Server\filterscripts\Testbiz.pwn(73) : error 021: symbol already defined: "INI_ParseFile"
C:\Users\Winseven\Desktop\Samp\Pro RP SAMP Server\filterscripts\Testbiz.pwn(73) : error 010: invalid function or declaration
C:\Users\Winseven\Desktop\Samp\Pro RP SAMP Server\filterscripts\Testbiz.pwn(73 -- 77) : error 010: invalid function or declaration
C:\Users\Winseven\Desktop\Samp\Pro RP SAMP Server\filterscripts\Testbiz.pwn(73 -- 77) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


5 Errors.
pawn Code:
new szStr[40];
    for(new idx =1 ; idx < sizeof(BusinessInfo); idx++)//Creates a loop, that goes through all of the businesses.
    {
        format(str, sizeof(str), BPATH, idx);//formats the file path, with the biz ID
        INI_ParseFile(str, "loadbiz_%s", .bExtra = true, .extra = idx );
        BusinessInfo[idx][bOutsideIcon] = CreateDynamicPickup(1272, 1, BusinessInfo[idx][bEntranceX], BusinessInfo[idx][bEntranceY], BusinessInfo[idx][bEntranceZ], BusinessInfo[idx][bWorld]);
        BusinessInfo[idx][bInsideIcon] = CreateDynamicPickup(1272, 1, BusinessInfo[idx][bExitX], BusinessInfo[idx][bExitY], BusinessInfo[idx][bExitZ], BusinessInfo[idx][bInsideWorld]);
    }
    for(new id = 1; id < sizeof(BusinessInfo); id++)//Loops through the businesses.
    {
        if(BusinessInfo[id][bPrice] == 0) break;//Breaks the loop if the price is 0(Meaning it doesn't exist)
        SaveBusiness(id);//Calls the SaveBusiness function.
    }



Re: Business System - Tama - 07.02.2014

Code:
 : error 047: array sizes do not match, or destination array is too small
 : error 047: array sizes do not match, or destination array is too small
pawn Code:
//enums
enum bInfo
{
    bOwned,
    bPrice,
    bOwner[MAX_PLAYER_NAME],
    bType,
    bLocked,
    bMoney,
    Float:bEntranceX,
    Float:bEntranceY,
    Float:bEntranceZ,
    Float:bEntranceA,
    Float:bExitX,
    Float:bExitY,
    Float:bExitZ,
    Float:bExitA,
    bInt,
    bWorld,
    bInsideInt,
    bInsideWorld,
    bInsideIcon,
    bOutsideIcon,
    bName[128]
}
new BusinessInfo[200][bInfo];
//loading
forward loadbiz_data(idx, name[], value[]);
public loadbiz_data(idx, name[], value[])
{
    INI_Int("bOwned", BusinessInfo[idx][bOwned]);
    INI_Int("bPrice", BusinessInfo[idx][bPrice]);
    INI_String("bOwner", BusinessInfo[idx][bOwner], 24); // this is error 1
    INI_Int("bType", BusinessInfo[idx][bType]);
    INI_Int("bLocked", BusinessInfo[idx][bLocked]);
    INI_Int("bMoney", BusinessInfo[idx][bMoney]);
    INI_Float("bEntranceX", BusinessInfo[idx][bEntranceX]);
    INI_Float("bEntranceY", BusinessInfo[idx][bEntranceY]);
    INI_Float("bEntranceZ", BusinessInfo[idx][bEntranceZ]);
    INI_Float("bEntranceA", BusinessInfo[idx][bEntranceA]);
    INI_Float("bExitX", BusinessInfo[idx][bExitX]);
    INI_Float("bExitY", BusinessInfo[idx][bExitY]);
    INI_Float("bExitZ", BusinessInfo[idx][bExitZ]);
    INI_Float("bExitA", BusinessInfo[idx][bExitA]);
    INI_Int("bInt", BusinessInfo[idx][bInt]);
    INI_Int("bWorld", BusinessInfo[idx][bWorld]);
    INI_Int("bInsideInt", BusinessInfo[idx][bInsideInt]);
    INI_Int("bInsideWorld", BusinessInfo[idx][bInsideWorld]);
    INI_String("bName", BusinessInfo[idx][bName], 128); // this is error 2
    return 1;
}
what should i do?


Re: Business System - alex02 - 01.03.2014

Code:
D:\Games\Stunt Server By Johnny\pawno\include\YSI\y_debug.inc(277) : warning 219: local variable "str" shadows a variable at a preceding level
D:\Games\Stunt Server By Johnny\pawno\include\YSI\y_debug.inc(339) : warning 219: local variable "str" shadows a variable at a preceding level
D:\Games\Stunt Server By Johnny\pawno\include\YSI\y_debug.inc(344) : warning 219: local variable "str" shadows a variable at a preceding level
D:\Games\Stunt Server By Johnny\pawno\include\YSI\y_amx.inc(454) : warning 219: local variable "str" shadows a variable at a preceding level
D:\Games\Stunt Server By Johnny\pawno\include\YSI\y_amx.inc(904) : warning 219: local variable "str" shadows a variable at a preceding level
D:\Games\Stunt Server By Johnny\pawno\include\YSI\y_amx.inc(926) : warning 219: local variable "str" shadows a variable at a preceding level
D:\Games\Stunt Server By Johnny\pawno\include\YSI\y_utils.inc(246) : warning 219: local variable "str" shadows a variable at a preceding level
D:\Games\Stunt Server By Johnny\pawno\include\YSI\y_utils.inc(369) : warning 219: local variable "str" shadows a variable at a preceding level
D:\Games\Stunt Server By Johnny\pawno\include\YSI\y_utils.inc(396) : warning 219: local variable "str" shadows a variable at a preceding level
D:\Games\Stunt Server By Johnny\pawno\include\YSI\y_utils.inc(475) : warning 219: local variable "str" shadows a variable at a preceding level
D:\Games\Stunt Server By Johnny\pawno\include\YSI\y_commands.inc(219) : warning 201: redefinition of constant/macro (symbol "CMD:%0(%1)")
D:\Games\Stunt Server By Johnny\pawno\include\YSI\y_commands.inc(220) : warning 201: redefinition of constant/macro (symbol "COMMAND")
D:\Games\Stunt Server By Johnny\pawno\include\YSI\y_malloc.inc(488) : warning 219: local variable "str" shadows a variable at a preceding level
D:\Games\Stunt Server By Johnny\pawno\include\YSI\y_malloc.inc(613) : warning 219: local variable "str" shadows a variable at a preceding level
D:\Games\Stunt Server By Johnny\pawno\include\YSI\y_ini.inc(1074) : warning 219: local variable "str" shadows a variable at a preceding level
D:\Games\Stunt Server By Johnny\pawno\include\YSI\y_ini.inc(1192) : warning 219: local variable "str" shadows a variable at a preceding level
C:\DOCUME~1\MITACH~1\Desktop\LuxAdmin.pwn(114) : error 010: invalid function or declaration
C:\DOCUME~1\MITACH~1\Desktop\LuxAdmin.pwn(141) : error 010: invalid function or declaration
C:\DOCUME~1\MITACH~1\Desktop\LuxAdmin.pwn(144) : error 021: symbol already defined: "INI_ParseFile"
C:\DOCUME~1\MITACH~1\Desktop\LuxAdmin.pwn(144) : error 017: undefined symbol "bExtra"
C:\DOCUME~1\MITACH~1\Desktop\LuxAdmin.pwn(144) : warning 201: redefinition of constant/macro (symbol "COLOR_BLUE")
C:\DOCUME~1\MITACH~1\Desktop\LuxAdmin.pwn(144 -- 165) : warning 201: redefinition of constant/macro (symbol "COLOR_PURPLE")
C:\DOCUME~1\MITACH~1\Desktop\LuxAdmin.pwn(144 -- 166) : warning 201: redefinition of constant/macro (symbol "COLOR_BLACK")
C:\DOCUME~1\MITACH~1\Desktop\LuxAdmin.pwn(373) : error 001: expected token: "}", but found "-identifier-"
C:\DOCUME~1\MITACH~1\Desktop\LuxAdmin.pwn(374) : error 010: invalid function or declaration
C:\DOCUME~1\MITACH~1\Desktop\LuxAdmin.pwn(520) : warning 219: local variable "str" shadows a variable at a preceding level
C:\DOCUME~1\MITACH~1\Desktop\LuxAdmin.pwn(525) : error 017: undefined symbol "CreateDynamicPickup"
C:\DOCUME~1\MITACH~1\Desktop\LuxAdmin.pwn(526) : error 017: undefined symbol "CreateDynamicPickup"
C:\DOCUME~1\MITACH~1\Desktop\LuxAdmin.pwn(1756) : warning 235: public function lacks forward declaration (symbol "OnPlayerPickUpDynamicPickup")
C:\DOCUME~1\MITACH~1\Desktop\LuxAdmin.pwn(1931) : error 017: undefined symbol "DestroyDynamicPickup"
C:\DOCUME~1\MITACH~1\Desktop\LuxAdmin.pwn(1932) : error 017: undefined symbol "DestroyDynamicPickup"
C:\DOCUME~1\MITACH~1\Desktop\LuxAdmin.pwn(1933) : error 017: undefined symbol "CreateDynamicPickup"
C:\DOCUME~1\MITACH~1\Desktop\LuxAdmin.pwn(1934) : error 017: undefined symbol "CreateDynamicPickup"
C:\DOCUME~1\MITACH~1\Desktop\LuxAdmin.pwn(1988) : error 017: undefined symbol "DestroyDynamicPickup"
C:\DOCUME~1\MITACH~1\Desktop\LuxAdmin.pwn(1999) : error 017: undefined symbol "PlayerInfo"
C:\DOCUME~1\MITACH~1\Desktop\LuxAdmin.pwn(1999) : warning 215: expression has no effect
C:\DOCUME~1\MITACH~1\Desktop\LuxAdmin.pwn(1999) : error 001: expected token: ";", but found "]"
C:\DOCUME~1\MITACH~1\Desktop\LuxAdmin.pwn(1999) : error 029: invalid expression, assumed zero
C:\DOCUME~1\MITACH~1\Desktop\LuxAdmin.pwn(1999) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


17 Errors.



Re: Business System - Dziugsas - 17.04.2014

Delete /enter and get this

pawn Code:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if (PRESSED(KEY_SECONDARY_ATTACK))
    {
        for(new b = 1; b < sizeof(BusinessInfo); b++)//Loops through all the businesses.
        {
            if(IsPlayerInRangeOfPoint(playerid, 1.0, BusinessInfo[b][bEntranceX], BusinessInfo[b][bEntranceY], BusinessInfo[b][bEntranceZ]))//Checks if player is near the entrance.
            {
                if(BusinessInfo[b][bLocked] == 1) return SendClientMessage(playerid, COLOR_GREY, "This Business is locked!");//Checks it it is locked/
                SetPlayerPos(playerid, BusinessInfo[b][bExitX], BusinessInfo[b][bExitY], BusinessInfo[b][bExitZ]);
                SetPlayerFacingAngle(playerid, BusinessInfo[b][bExitA]);
                SetPlayerInterior(playerid, BusinessInfo[b][bInsideInt]);
                SetPlayerVirtualWorld(playerid, BusinessInfo[b][bInsideWorld]);
                InsideBiz[playerid] = b;
                return 1;
            }
            if(IsPlayerInRangeOfPoint(playerid, 2.0, BusinessInfo[b][bExitX], BusinessInfo[b][bExitY], BusinessInfo[b][bExitZ]) && GetPlayerVirtualWorld(playerid) == BusinessInfo[b][bInsideWorld])//Checks if player is in near the exit.
            {
                SetPlayerPos(playerid, BusinessInfo[b][bEntranceX], BusinessInfo[b][bEntranceY], BusinessInfo[b][bEntranceZ]);
                SetPlayerFacingAngle(playerid, BusinessInfo[b][bEntranceA]);
                SetPlayerInterior(playerid, BusinessInfo[b][bInt]);
                SetPlayerVirtualWorld(playerid, BusinessInfo[b][bWorld]);
                InsideBiz[playerid] = 0;
                return 1;
            }
        }
    }
    return 1;
}
By the way thanks nice script.Got some few errors but fixed.


Re: Business System - Dziugsas - 17.04.2014

Delete:
pawn Code:
#include <YSI\y_commands>
Add:
pawn Code:
#include <zcmd>
And change all commands from YCMD to CMD.

This will fix some errors .


Re: Business System - Mey6155 - 26.05.2014

Where do I have to put the BizID? I put it under the enum with new BizID; Many Errors!

Code:
F:\Mustafa\Dutch-RealLife\gamemodes\Haci.pwn(1396) : warning 213: tag mismatch
F:\Mustafa\Dutch-RealLife\gamemodes\Haci.pwn(1444) : warning 213: tag mismatch
F:\Mustafa\Dutch-RealLife\gamemodes\Haci.pwn(1446) : error 017: undefined symbol "Money"
F:\Mustafa\Dutch-RealLife\gamemodes\Haci.pwn(1448) : warning 213: tag mismatch
F:\Mustafa\Dutch-RealLife\gamemodes\Haci.pwn(1449) : error 017: undefined symbol "Money"
F:\Mustafa\Dutch-RealLife\gamemodes\Haci.pwn(1454) : error 017: undefined symbol "RemoveUnderScore"
F:\Mustafa\Dutch-RealLife\gamemodes\Haci.pwn(1475) : warning 213: tag mismatch
F:\Mustafa\Dutch-RealLife\gamemodes\Haci.pwn(1476) : warning 213: tag mismatch
F:\Mustafa\Dutch-RealLife\gamemodes\Haci.pwn(1484) : error 017: undefined symbol "Money"
F:\Mustafa\Dutch-RealLife\gamemodes\Haci.pwn(1488) : error 017: undefined symbol "Skin"
F:\Mustafa\Dutch-RealLife\gamemodes\Haci.pwn(1663) : warning 203: symbol is never used: "sellbiz"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


5 Errors.



Re: Business System - Mey6155 - 26.05.2014

I ment
Code:
F:\Mustafa\Dutch-RealLife\gamemodes\Haci.pwn(1396) : warning 213: tag mismatch
F:\Mustafa\Dutch-RealLife\gamemodes\Haci.pwn(1444) : warning 213: tag mismatch
F:\Mustafa\Dutch-RealLife\gamemodes\Haci.pwn(1448) : warning 213: tag mismatch
F:\Mustafa\Dutch-RealLife\gamemodes\Haci.pwn(1461) : warning 213: tag mismatch
F:\Mustafa\Dutch-RealLife\gamemodes\Haci.pwn(1462) : warning 213: tag mismatch
F:\Mustafa\Dutch-RealLife\gamemodes\Haci.pwn(1467) : warning 213: tag mismatch
F:\Mustafa\Dutch-RealLife\gamemodes\Haci.pwn(1475) : warning 213: tag mismatch
F:\Mustafa\Dutch-RealLife\gamemodes\Haci.pwn(1476) : warning 213: tag mismatch
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


8 Warnings.
It all where stands BizID.


Re: Business System - Ghazal - 26.05.2014

Nice tutorial.
But, It will be better if you add paycheck.


Re: Business System - Jack_Leslie - 26.05.2014

Thanks for giving credit, mate. Nice tutorial. I actually used some of your y_ini coding on a new script, so I guess we both helped each other out a bit. Cheers!