Array Error
#10

You cannot use "bought" for both owner's name and price. Use another name for the price and use strcmp to compare strings:
pawn Код:
if (!strcmp(VehicleInfo[vehicleid][bought], pname, true, MAX_PLAYER_NAME))
and because strcmp returns 0 if one of them is NULL you can prevent it by doing:
pawn Код:
if (!isnull(VehicleInfo[vehicleid][bought]) && !strcmp(VehicleInfo[vehicleid][bought], pname, true, MAX_PLAYER_NAME))
and as I said before, use another name for the price here:
pawn Код:
VehicleInfo[vehicleid][bought] = 999;
or whatever it is anyways.
Reply


Messages In This Thread
Array Error - by ridhoswasta - 22.06.2014, 15:42
Re: Array Error - by Konstantinos - 22.06.2014, 15:45
Re: Array Error - by ridhoswasta - 22.06.2014, 15:47
Re: Array Error - by Konstantinos - 22.06.2014, 15:48
Re: Array Error - by ridhoswasta - 22.06.2014, 15:49
Re: Array Error - by ridhoswasta - 22.06.2014, 15:52
Re: Array Error - by Konstantinos - 22.06.2014, 15:54
Re: Array Error - by ridhoswasta - 22.06.2014, 15:56
Re: Array Error - by ridhoswasta - 22.06.2014, 16:00
Re: Array Error - by Konstantinos - 22.06.2014, 16:06

Forum Jump:


Users browsing this thread: 1 Guest(s)