SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 09/12/2013, 07:05 PM   #1
Dorlevi1506
Big Clucker
 
Join Date: Aug 2013
Posts: 99
Reputation: 18
Default I tried to make business system 4 errors

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 Code:
format(string, sizeof(string), "* %s pushes the door and enters the shop.", RPN(playerid));

Pawn code:
pawn Code:
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;
            }
Dorlevi1506 is offline   Reply With Quote
Old 09/12/2013, 07:11 PM   #2
Nicks
Big Clucker
 
Join Date: Mar 2011
Posts: 71
Reputation: -2
Default Re: I tried to make business system 4 errors

Can you show me the errors ?
Nicks is offline   Reply With Quote
Old 09/12/2013, 07:16 PM   #3
Dorlevi1506
Big Clucker
 
Join Date: Aug 2013
Posts: 99
Reputation: 18
Default Re: I tried to make business system 4 errors

Quote:
Originally Posted by Nicks View Post
Can you show me the errors ?
There is link : http://prntscr.com/29xnfb
Dorlevi1506 is offline   Reply With Quote
Old 09/12/2013, 07:21 PM   #4
Areax
Huge Clucker
 
Areax's Avatar
 
Join Date: Mar 2013
Location: Slovenia
Posts: 464
Reputation: 14
Default Re: I tried to make business system 4 errors

Really ? You just need to add
pawn Code:
new string[150];
Areax is offline   Reply With Quote
Old 09/12/2013, 07:31 PM   #5
Dorlevi1506
Big Clucker
 
Join Date: Aug 2013
Posts: 99
Reputation: 18
Default Re: I tried to make business system 4 errors

Quote:
Originally Posted by Areax View Post
Really ? You just need to add
pawn Code:
new string[150];
Where? can you edit the pawn code and post here the new one?
Dorlevi1506 is offline   Reply With Quote
Old 09/12/2013, 07:38 PM   #6
Areax
Huge Clucker
 
Areax's Avatar
 
Join Date: Mar 2013
Location: Slovenia
Posts: 464
Reputation: 14
Default Re: I tried to make business system 4 errors

pawn Code:
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;
            }
Areax is offline   Reply With Quote
Old 09/12/2013, 07:55 PM   #7
Dorlevi1506
Big Clucker
 
Join Date: Aug 2013
Posts: 99
Reputation: 18
Default Re: I tried to make business system 4 errors

Quote:
Originally Posted by Areax View Post
pawn Code:
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 Code:
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();
            }
Dorlevi1506 is offline   Reply With Quote
Old 09/12/2013, 09:29 PM   #8
erminpr0
Huge Clucker
 
erminpr0's Avatar
 
Join Date: Jan 2013
Posts: 222
Reputation: 22
Default Re: I tried to make business system 4 errors

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 Code:
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;
}
erminpr0 is offline   Reply With Quote
Old 10/12/2013, 11:33 AM   #9
Dorlevi1506
Big Clucker
 
Join Date: Aug 2013
Posts: 99
Reputation: 18
Default Re: I tried to make business system 4 errors

Quote:
Originally Posted by erminpr0 View Post
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 Code:
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?
Dorlevi1506 is offline   Reply With Quote
Old 10/12/2013, 06:59 PM   #10
erminpr0
Huge Clucker
 
erminpr0's Avatar
 
Join Date: Jan 2013
Posts: 222
Reputation: 22
Default Re: I tried to make business system 4 errors

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

Give us code
erminpr0 is offline   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
Business System +Rep RenSoprano Scripting Help 2 04/11/2012 08:26 PM
How to make Housing + Business APPEAR on owner logoff? ahmetg Help Archive 3 26/06/2011 12:14 PM
Make an business ? Dennis_Sanchez Help Archive 0 18/10/2010 07:21 PM
How To make Business and Houses? Rickzor14 Help Archive 0 16/11/2009 04:30 PM


All times are GMT. The time now is 10:30 PM.


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