What is wrong -
boyan96 - 18.02.2012
PHP код:
(746)stock BuyHouse(playerid, houseid)
(747) {
(748) if (GetPlayerScore(playerid) >= 1000)
(749) new string2[256];
(750) new name[24];
(751) GetPlayerName(playerid, name, sizeof(name));
(752) #if defined PRINT_HOUSES
(753) printf("%s Bought House ID %d", name, houseid);
(754) #endif
(755) GivePlayerMoney(playerid, -hInfo[houseid][Cost]);
(756) format(string2,sizeof(string2), HOUSE_FILE, houseid);
(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(1272, 23, hInfo[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
Re: What is wrong -
JhnzRep - 18.02.2012
Which one is the error line?
Re: What is wrong -
Konstantinos - 18.02.2012
Which is line 749?
Re: What is wrong -
boyan96 - 18.02.2012
PHP код:
(746)stock BuyHouse(playerid, houseid)
(747) {
(748) if (GetPlayerScore(playerid) >= 1000)
(749) new string2[256];
(750) new name[24];
(751) GetPlayerName(playerid, name, sizeof(name));
(752) #if defined PRINT_HOUSES
(753) printf("%s Bought House ID %d", name, houseid);
(754) #endif
(755) GivePlayerMoney(playerid, -hInfo[houseid][Cost]);
(756) format(string2,sizeof(string2), HOUSE_FILE, houseid);
(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(1272, 23, hInfo[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
Re: What is wrong -
Konstantinos - 18.02.2012
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;
}
Re: What is wrong -
boyan96 - 18.02.2012
no the same error
Re: What is wrong -
boyan96 - 18.02.2012
i wont to make it if the player have 1000 score to can buy a house