04.04.2009, 21:36
Hi
I followed this tutorial on how to read from ini files. Currently, I'm stuck with my script:
Thanks in advance!
I followed this tutorial on how to read from ini files. Currently, I'm stuck with my script:
Код:
D:\Documents and Settings\Vince\Mijn Documenten\SA-MP SERVER\gamemodes\island.pwn(440) : error 033: array must be indexed (variable "owner") Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 1 Error.
pawn Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
new inimessage[256], inisection[32];
new owner[MAX_PLAYER_NAME], buyprice[32], rent[32];
for(new p = 0; p <= sizeof(Icons_Houses_A); p++)
{
if(pickupid == Icons_Houses_A[p])
{
format(inisection, sizeof(inisection), "HOUSE_%d", p);
getINIStringDefault("HOUSES_A.ini", inisection, "owner", "No-one", owner);
getINIStringDefault("HOUSES_A.ini", inisection, "price", "0", buyprice);
getINIStringDefault("HOUSES_A.ini", inisection, "rent", "0", rent);
if(owner == "No-one") // <= this is the line with the error
{
format(inimessage, sizeof(inimessage), "~w~This house is ~r~FOR SALE~w~~n~Buy for: ~g~$%d", buyprice);
GameTextForPlayer(playerid, inimessage, 5000, 5);
}
else
{
format(inimessage, sizeof(inimessage), "~w~This house is owned by: ~r~%s ~w~~n~Rent: ~~g$%d", owner, rent);
GameTextForPlayer(playerid, inimessage, 3000, 5);
}
}
}
return 1;
}