What is wrong
#1

PHP код:
(746)stock BuyHouse(playeridhouseid)
(
747) {
(
748)  if (GetPlayerScore(playerid) >= 1000)
(
749)  new string2[256];
(
750)  new name[24];
(
751)  GetPlayerName(playeridnamesizeof(name));
(
752)  #if defined PRINT_HOUSES
(753)    printf("%s Bought House ID %d"namehouseid);
(
754#endif
(755)  GivePlayerMoney(playerid, -hInfo[houseid][Cost]);
(
756)  format(string2,sizeof(string2), HOUSE_FILEhouseid);
(
757)  INI_Open(string2);
(
758)  INI_WriteString("Name"name);
(
759)  INI_WriteInt("Locked"0);
(
760)  INI_Save();
(
761)  INI_Close();
(
762)  hInfo[houseid][Name] = name;
(
763)  hInfo[houseid][Locked] = 0;
(
764)  DestroyPickup(HousePickup[houseid]);
(
765)  HousePickup[houseid] = CreatePickup(127223hInfo[houseid][ExteriorX], hInfo[houseid][ExteriorY],    hInfo[houseid][ExteriorZ]);
(
766)  ShowBoughtHouseMessage(playerid);
 (
767) return 1;
(
768)} 
ERRORS


C:\Users\User\Desktop\1.pwn(749) : error 003: declaration of a local variable must appear in a compound block
C:\Users\User\Desktop\1.pwn(749) : warning 217: loose indentation
C:\Users\User\Desktop\1.pwn(749) : error 017: undefined symbol "string2"
C:\Users\User\Desktop\1.pwn(749) : warning 215: expression has no effect
C:\Users\User\Desktop\1.pwn(749) : error 001: expected token: ";", but found "]"
C:\Users\User\Desktop\1.pwn(749) : fatal error 107: too many error messages on one line
Reply
#2

Which one is the error line?
Reply
#3

Which is line 749?
Reply
#4

PHP код:
(746)stock BuyHouse(playeridhouseid)
(
747) {
(
748)  if (GetPlayerScore(playerid) >= 1000)
(
749)  new string2[256];
(
750)  new name[24];
(
751)  GetPlayerName(playeridnamesizeof(name));
(
752)  #if defined PRINT_HOUSES
(753)    printf("%s Bought House ID %d"namehouseid);
(
754#endif
(755)  GivePlayerMoney(playerid, -hInfo[houseid][Cost]);
(
756)  format(string2,sizeof(string2), HOUSE_FILEhouseid);
(
757)  INI_Open(string2);
(
758)  INI_WriteString("Name"name);
(
759)  INI_WriteInt("Locked"0);
(
760)  INI_Save();
(
761)  INI_Close();
(
762)  hInfo[houseid][Name] = name;
(
763)  hInfo[houseid][Locked] = 0;
(
764)  DestroyPickup(HousePickup[houseid]);
(
765)  HousePickup[houseid] = CreatePickup(127223hInfo[houseid][ExteriorX], hInfo[houseid][ExteriorY],    hInfo[houseid][ExteriorZ]);
(
766)  ShowBoughtHouseMessage(playerid);
 (
767) return 1;
(
768)} 
ERRORS


C:\Users\User\Desktop\1.pwn(749) : error 003: declaration of a local variable must appear in a compound block
C:\Users\User\Desktop\1.pwn(749) : warning 217: loose indentation
C:\Users\User\Desktop\1.pwn(749) : error 017: undefined symbol "string2"
C:\Users\User\Desktop\1.pwn(749) : warning 215: expression has no effect
C:\Users\User\Desktop\1.pwn(749) : error 001: expected token: ";", but found "]"
C:\Users\User\Desktop\1.pwn(749) : fatal error 107: too many error messages on one line
Reply
#5

Maybe.
pawn Код:
stock BuyHouse(playerid, houseid)
{
    if (GetPlayerScore(playerid) >= 1000)
    {
        new string2[128];
        new name[24];
        GetPlayerName(playerid, name, sizeof(name));
        #if defined PRINT_HOUSES
        printf("%s Bought House ID %d", name, houseid);
        #endif
        GivePlayerMoney(playerid, -hInfo[houseid][Cost]);
        format(string2,sizeof(string2), HOUSE_FILE, houseid);
        INI_Open(string2);
        INI_WriteString("Name", name);
        INI_WriteInt("Locked", 0);
        INI_Save();
        INI_Close();
        hInfo[houseid][Name] = name;
        hInfo[houseid][Locked] = 0;
        DestroyPickup(HousePickup[houseid]);
        HousePickup[houseid] = CreatePickup(1272, 23, hInfo[houseid][ExteriorX], hInfo[houseid][ExteriorY],    hInfo[houseid][ExteriorZ]);
        ShowBoughtHouseMessage(playerid);
    }
    return 1;
}
Reply
#6

no the same error
Reply
#7

i wont to make it if the player have 1000 score to can buy a house
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)