[+1 REP] Errors in /myhouses
#1

Who can help me to fix this errors will get +1 REP :P

pawn Код:
/*20292*/if(strcmp(cmdtext,"/myhouses",true)==0)
/*20292*/   {
/*20293*/       new path[32],hown[MAX_STRING],hasker[MAX_STRING];
/*20294*/       /*20295*/SendClientMessage(playerid,COLOR_BRIGHTRED,"|___________________________[HOUSES]________/*20296*/___________________|");
/*20297*/       for(new i=0;i<sizeof(House);i++)
/*20298*/       {
/*20299*/           format(path,sizeof(path),"Houses/casa%d.txt",House[i][HouseID]);
/*20300*/           hown = dini_Get(path,"owner");
/*20301*/           format(hasker, MAX_STRING, "%s", PlayerName(playerid));
/*20302*/           if(House[i][cOwned] == 1 && strcmph(asker,hown,false)==0)
/*20303*/               {
/*20304*/                   if(strcmp(dini_Get(path,"owner"),PlayerName(playerid),false) == 0)
/*20305*/                   {
/*20306*/                       new text[60];
/*20307*/                       new atext[60];
/*20308*/                       if(Houses[i][cclosed] == 1) { text = "Closed"; }
/*20309*/                       if(Houses[i][cclosed] == 0) { text = "Open"; }
/*20310*/                       if(Houses[i][cbuyable] == 1) { atext = "On Sale"; }
/*20311*/                       if(Houses[i][cbuyable] == 0) { atext = "Not For Sale"; }
/*20312*/                       format(string, sizeof(string), "[House ID%d]  [%d]  [%d]  [Rent: %d][%s] ",houseid,Houses[i][cclosed],Houses[i][cbuyable],tmpprice,zoneinfoatext,text);
/*20313*/                       SendClientMessage(playerid,COLOR_GREY,string);
/*20314*/                   }
/*20315*/               }
/*20316*/           }
/*20317*/           else continue;
/*20318*/       }
/*20319*/       return 1;
/*20320*/   }
i get this errors
Код:
(20301) : warning 213: tag mismatch
(20301) : error 032: array index out of bounds (variable "House")
(20307) : error 017: undefined symbol "Houses"
(20307) : warning 215: expression has no effect
(20307) : error 001: expected token: ";", but found "]"
(20307) : error 029: invalid expression, assumed zero
(20307) : fatal error 107: too many error messages on one line

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


5 Errors.
Reply
#2

You have got one closing bracket "}" too much, I guess above "else continue;"...
Reply
#3

Nope .. the problem is because "house" isn't defined.. i don't know how to define :P If you can help me please
Reply
#4

You also got one damn bracket too much, look yourself then!

pawn Код:
#define HOUSES      100 //defines maximal 100 houses
At the top of your script...Otherwise, it looks like "Houses" is an enum or what?
Reply
#5

Alrigh here is what i do and i fix smth, But i still get error 029 on line 20077
pawn Код:
if(strcmp(cmdtext,"/myhouses",true)==0) // Still DEVELOPING
    {
        new path[32],hown[MAX_STRING],hasker[MAX_STRING];
        SendClientMessage(playerid,COLOR_BRIGHTRED,"|___________________________[HOUSES]___________________________|");
        for(new i=0;i<sizeof(House);i++)
        {
            format(path,sizeof(path),"Houses/casa%d.txt",House[i][HouseID]);
            hown = dini_Get(path,"owner");
            format(hasker, MAX_STRING, "%s", PlayerName(playerid));
/*line:20070*/          if(new MAX_HOUSES[i][House[h] == 1)
                {
                    if(strcmp(dini_Get(path,"owner"),PlayerName(playerid),false) == 0)
                    {
                        new text[60];
                        new atext[60];
                        if(Houses[i][cclosed] == 1) { text = "Closed"; }
                        if(Houses[i][cclosed] == 0) { text = "Open"; }
                        if(Houses[i][cbuyable] == 1) { atext = "On Sale"; }
                        if(Houses[i][cbuyable] == 0) { atext = "Not For Sale"; }
                        format(string, sizeof(string), "[House ID%d]  [%d]  [%d]  [Rent: %d]  [%s] ",houseid,Houses[i][cclosed],Houses[i][cbuyable],tmpprice,zoneinfoatext,text);
                        SendClientMessage(playerid,COLOR_GREY,string);
                    }
                }
            }
            else continue;
        }
        return 1;
    }
Here are the errors:
pawn Код:
(20077) : error 029: invalid expression, assumed zero
(20077) : error 029: invalid expression, assumed zero
(20077) : error 029: invalid expression, assumed zero
(20077) : fatal error 107: too many error messages on one line
Reply
#6

Insert this one:

pawn Код:
if(new MAX_HOUSES[i][House[h]] == 1)
You have left one "]"...
Reply
#7

I still get the errors.
Can someone re-write this for me. Please
Reply
#8

Go to the Scripting-request-topic then. We are here to help you, but not to write whole codes for you! You probably forgot something in the enum, some variable! Or, you should have been define it like this:

pawn Код:
#define MAX_HOUSES 100
Then, you wouldn't need to create that variable in your command again....
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)