I tried to make business system 4 errors
#1

Hello guys i tried to make business system and I got 4 errors can someone help me to fix it?
SS of the error: http://prntscr.com/29xnfb


This is the line with the problem :
pawn Код:
format(string, sizeof(string), "* %s pushes the door and enters the shop.", RPN(playerid));
Pawn code:
pawn Код:
for(new idx=1; idx<MAX_BIZ; idx++)
    {
        if(IsPlayerInRangeOfPoint(playerid, 2, BizInfo[idx][bX], BizInfo[idx][bY], BizInfo[idx][bZ]))
        {
            if(!BizInfo[idx][bStatus] && PlayerInfo[playerid][pBiz] != idx && !PlayerInfo[playerid][pVBiz]) return SendClientMessage(playerid, COLOR_GREY, "This business is closed.");
            if(BizInfo[idx][bType] == 1) // 24/7 Business
            {
                format(string, sizeof(string), "* %s pushes the door and enters the shop.", RPN(playerid));
                ProxDetector(15.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                SetPlayerPos(playerid, -25.884498,-185.868988,1003.546875);
                SetPlayerFacingAngle(playerid, 357.5915);
                SetCameraBehindPlayer(playerid);
                SetPlayerInterior(playerid, 17);
                SetPlayerVirtualWorld(playerid, idx+6000);
                format(string, sizeof(string), "** Welcome to %s's 24/7 Market (( /buy )) **", BizInfo[idx][bOwner]);
                SendClientMessage(playerid, COLOR_ORANGE, string);
                return 1;
            }
Reply
#2

Can you show me the errors ?
Reply
#3

Quote:
Originally Posted by Nicks
Посмотреть сообщение
Can you show me the errors ?
There is link : http://prntscr.com/29xnfb
Reply
#4

Really ? You just need to add
pawn Код:
new string[150];
Reply
#5

Quote:
Originally Posted by Areax
Посмотреть сообщение
Really ? You just need to add
pawn Код:
new string[150];
Where? can you edit the pawn code and post here the new one?
Reply
#6

pawn Код:
for(new idx=1; idx<MAX_BIZ; idx++)
    {
        if(IsPlayerInRangeOfPoint(playerid, 2, BizInfo[idx][bX], BizInfo[idx][bY], BizInfo[idx][bZ]))
        {
            if(!BizInfo[idx][bStatus] && PlayerInfo[playerid][pBiz] != idx && !PlayerInfo[playerid][pVBiz]) return SendClientMessage(playerid, COLOR_GREY, "This business is closed.");
            if(BizInfo[idx][bType] == 1) // 24/7 Business
            {
                new string[150];
                format(string, sizeof(string), "* %s pushes the door and enters the shop.", RPN(playerid));
                ProxDetector(15.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                SetPlayerPos(playerid, -25.884498,-185.868988,1003.546875);
                SetPlayerFacingAngle(playerid, 357.5915);
                SetCameraBehindPlayer(playerid);
                SetPlayerInterior(playerid, 17);
                SetPlayerVirtualWorld(playerid, idx+6000);
                format(string, sizeof(string), "** Welcome to %s's 24/7 Market (( /buy )) **", BizInfo[idx][bOwner]);
                SendClientMessage(playerid, COLOR_ORANGE, string);
                return 1;
            }
Reply
#7

Quote:
Originally Posted by Areax
Посмотреть сообщение
pawn Код:
for(new idx=1; idx<MAX_BIZ; idx++)
    {
        if(IsPlayerInRangeOfPoint(playerid, 2, BizInfo[idx][bX], BizInfo[idx][bY], BizInfo[idx][bZ]))
        {
            if(!BizInfo[idx][bStatus] && PlayerInfo[playerid][pBiz] != idx && !PlayerInfo[playerid][pVBiz]) return SendClientMessage(playerid, COLOR_GREY, "This business is closed.");
            if(BizInfo[idx][bType] == 1) // 24/7 Business
            {
                new string[150];
                format(string, sizeof(string), "* %s pushes the door and enters the shop.", RPN(playerid));
                ProxDetector(15.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                SetPlayerPos(playerid, -25.884498,-185.868988,1003.546875);
                SetPlayerFacingAngle(playerid, 357.5915);
                SetCameraBehindPlayer(playerid);
                SetPlayerInterior(playerid, 17);
                SetPlayerVirtualWorld(playerid, idx+6000);
                format(string, sizeof(string), "** Welcome to %s's 24/7 Market (( /buy )) **", BizInfo[idx][bOwner]);
                SendClientMessage(playerid, COLOR_ORANGE, string);
                return 1;
            }
Now I got more errors : http://prntscr.com/29y3ck

Maybe you got skype and you will help me there? It will be faster..
I post the line are not same errors
pawn Код:
format(BizInfo[idx][bOwner], 32, "%s", RPNU(playerid));
                format(string, sizeof(string), "%s\n\n{FFFFFF}%s\nOwner: %s\nID: %d", RBS(idx), RBT(idx), BizInfo[idx][bOwner], idx);
                UpdateDynamic3DTextLabelText(BizInfo[idx][bText], COLOR_WHITE, string);
                SendClientMessage(playerid, COLOR_GREEN, " You have successfully bought a business.");
                SendClientMessage(playerid, COLOR_WHITE, " Type /bizhelp to view your business commands.");
                format(string, sizeof(string), "%s has bought business id %d.", RPN(playerid), idx);
                Log("logs/business.log", string);
                idx = MAX_BIZ;
                done = 1;
                SaveBiz();
            }
            if(idx == MAX_BIZ-1 && !done)
            {
                SendClientMessage(playerid, COLOR_GREY, "This business is owned by someone else.");
            }
        }
        if(idx == MAX_BIZ-1 && !done)
        {
            SendClientMessage(playerid, COLOR_GREY, "You are not near a buyable business.");
        }
    }
    return 1;
}

CMD:sellbiztomarket(playerid, params[])
{
    new string[128];
    if(!IsPlayerConnected(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
    if(!PlayerInfo[playerid][pBiz] && !PlayerInfo[playerid][pVBiz]) return SendClientMessage(playerid, COLOR_GREY, "You don't own a business.");
    if(sscanf(params, "s[8]", params)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /sellbiztomarket [confirm]");
    if(!strcmp(params, "confirm", true))
    {
        new done;
        if(IsPlayerInRangeOfPoint(playerid, 2, BizInfo[PlayerInfo[playerid][pBiz]][bX], BizInfo[PlayerInfo[playerid][pBiz]][bY], BizInfo[PlayerInfo[playerid][pBiz]][bZ]))
        {
            GiveZaiatMoney(playerid, (75*BizInfo[PlayerInfo[playerid][pBiz]][bPrice])/100);
            BizInfo[PlayerInfo[playerid][pBiz]][bStatus] = 0;
            format(BizInfo[PlayerInfo[playerid][pBiz]][bOwner], 32, "The State");
            format(string, sizeof(string), "%s\n\n{FFFFFF}%s\nOwner: %s\nID: %d", RBS(PlayerInfo[playerid][pBiz]), RBT(PlayerInfo[playerid][pBiz]), BizInfo[PlayerInfo[playerid][pBiz]][bOwner], PlayerInfo[playerid][pBiz]);
            UpdateDynamic3DTextLabelText(BizInfo[PlayerInfo[playerid][pBiz]][bText], COLOR_WHITE, string);
            SendClientMessage(playerid, COLOR_GREEN, " You have successfully sold your business to The State. (75 percent of original price was paid back)");
            format(string, sizeof(string), "%s has sold business id %d to the market.", RPN(playerid), PlayerInfo[playerid][pBiz]);
            Log("logs/business.log", string);
            PlayerInfo[playerid][pBiz] = 0;
            done = 1;
        }
        if(!done)
        {
            new idx = PlayerInfo[playerid][pVBiz];
            if(IsPlayerInRangeOfPoint(playerid, 2, BizInfo[idx][bX], BizInfo[idx][bY], BizInfo[idx][bZ]))
            {
                GiveZaiatMoney(playerid, (75*BizInfo[idx][bPrice])/100);
                BizInfo[idx][bStatus] = 0;
                format(BizInfo[idx][bOwner], 32, "The State");
                format(string, sizeof(string), "%s\n\n{FFFFFF}%s\nOwner: %s\nID: %d", RBS(idx), RBT(idx), BizInfo[idx][bOwner], idx);
                UpdateDynamic3DTextLabelText(BizInfo[idx][bText], COLOR_WHITE, string);
                SendClientMessage(playerid, COLOR_GREEN, " You have successfully sold your business to The State. (75 percent of original price was paid back)");
                format(string, sizeof(string), "%s has sold business id %d to the market.", RPN(playerid), idx);
                Log("logs/business.log", string);
                PlayerInfo[playerid][pVBiz] = 0;
                done = 1;
                SaveBiz();
            }
Reply
#8

OK I see where you at, you have copy-pasted from somewhere and expect to work :/

You can't copy-paste, you should adjust other codes to your scripts..

I can give you RPN function but it won't help you alot ( but will fix 90% errors showed in screenshot )

pawn Код:
RPN(playerid)
{
    new Name[ MAX_PLAYER_NAME ], i = -1;
    GetPlayerName( playerid, Name, MAX_PLAYER_NAME );
    while( Name[ ++i ] )
    if( Name[ i ] == '_' )
    Name[ i ] = ' ';
    return Name;
}
Reply
#9

Quote:
Originally Posted by erminpr0
Посмотреть сообщение
OK I see where you at, you have copy-pasted from somewhere and expect to work :/

You can't copy-paste, you should adjust other codes to your scripts..

I can give you RPN function but it won't help you alot ( but will fix 90% errors showed in screenshot )

pawn Код:
RPN(playerid)
{
    new Name[ MAX_PLAYER_NAME ], i = -1;
    GetPlayerName( playerid, Name, MAX_PLAYER_NAME );
    while( Name[ ++i ] )
    if( Name[ i ] == '_' )
    Name[ i ] = ' ';
    return Name;
}
I fixed the errors but now when I try to make a business its told me the command doesnt exist, do you know how to fix it?
Reply
#10

It comes up when OnPlayerCommandText/OnPlayerCommandPerformed returns false (command doesn't exist), so be sure your command have returned true (success)

Give us code
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)