20.05.2012, 09:05
At first, Hello all! Here is my problem:
I have this code:
But when i try to Complie , it gives this error: array must be indexed (variable PlayerInfo ) this error is on line 51765 and here is line 51765:
Any help will be appreciated.
Thanks in advance!
I have this code:
pawn Код:
else if(strcmp(x_job,"ownablecar1",true) == 0)
{
if(OwnableCarOffer[playerid] < 999)
{
if(OwnableCarID[playerid] == 0) { return 1; }
if(OwnableCarPrice[playerid] == 0 || OwnableCarPrice[playerid] > 99999999) { return 1; }
if(OwnableCarID[playerid] == PlayerInfo[OwnableCarOffer[playerid]]) { }
else { SCM(playerid, COLOR_GREY, " Offer is no longer available"); return 1; }
if(GetPlayerMoney(playerid) >= OwnableCarPrice[playerid])
{
if(IsPlayerConnected(OwnableCarOffer[playerid]))
{
GetPlayerName(OwnableCarOffer[playerid], giveplayer, sizeof(giveplayer));
if(PlayerInfo[playerid][pVehKey1] == 0)
{
if(GetPlayerVehicleID(OwnableCarOffer[playerid]) == PlayerInfo[OwnableCarOffer[playerid]][pVehKey1])
{
PlayerInfo[playerid][pVehKey1] = PlayerInfo[OwnableCarOffer[playerid]][pVehKey1];
PlayerInfo[OwnableCarOffer[playerid]][pVehKey1] = 0;
}
else
{
SCM(playerid, COLOR_GREY, " Vehicle seller needs to be at his car !");
return 1;
}
format(string, sizeof(string), "* You bought a car for $%d from %s.",OwnableCarPrice[playerid],giveplayer);
SCM(playerid, COLOR_WHITE, string);
format(string, sizeof(string), "* %s has bought your car for $%d.",sendername,OwnableCarPrice[playerid]);
SCM(OwnableCarOffer[playerid], COLOR_WHITE, string);
RemovePlayerFromVehicle(OwnableCarOffer[playerid]);
GivePlayerMoney(playerid, - OwnableCarPrice[playerid]);
GivePlayerMoney(OwnableCarOffer[playerid], OwnableCarPrice[playerid]);
strmid(CarInfo[OwnableCarID[playerid]][cOwner], sendername, 0, strlen(sendername), 999);
}
else
{
SCM(playerid, COLOR_GREY, " You already have 1 car on slot 1 ! ");
return 1;
}
OnCarUpdate();
OnPlayerDateUpdate(playerid);
OnPlayerDateUpdate(OwnableCarOffer[playerid]);
OwnableCarOffer[playerid] = 999;
OwnableCarID[playerid] = 0;
OwnableCarPrice[playerid] = 0;
GameTextForPlayer(playerid, "~w~Congratulations~n~Don't forget to /v park it!", 5000, 3);
SCM(playerid, COLOR_GRAD2, "Congratulations on your new purchase!");
SCM(playerid, COLOR_GRAD2, "Type /vehiclehelp to view the vehicle manual!");
return 1;
}
else
{
SCM(playerid, COLOR_GREY, " Car seller is Offline !");
return 1;
}
}
}
else
{
SCM(playerid, COLOR_GREY, " No-one offerd you any Ownable Car !");
return 1;
}
}
pawn Код:
if(OwnableCarID[playerid] == PlayerInfo[OwnableCarOffer[playerid]]) { }
Thanks in advance!