22.01.2012, 03:03
pawn Код:
CMD:vehicles( playerid, params[] )
{
SendClientMessage( playerid, -1, "You own these vehicles:");
new szString[256],carkey;
for(new i = 1; i < 6; i++)
{
if(i == 1) { carkey = PlayerInfo[playerid][VehKey1]; }
else if(i == 2) { carkey = PlayerInfo[playerid][VehKey2]; }
else if(i == 3) { carkey = PlayerInfo[playerid][VehKey3]; }
else if(i == 4) { carkey = PlayerInfo[playerid][VehKey4]; }
else if(i == 5) { carkey = PlayerInfo[playerid][VehKey5]; }
if(carkey != 255)
{
format( szString, 256, "{6699cc}[Vehicle %d]:{ffffff} [Key: %d] [Name: %s] [Cost: %d] [Color 1: %d] [Color 2: %d] [ImpoundCost: %d] [Insurances: %d] [GPS: %d]", i, carkey, GetVehicleName( VehicleInfo[carkey][Model] ), VehicleInfo[carkey][Cost], VehicleInfo[carkey][Color1], VehicleInfo[carkey][Color2], VehicleInfo[carkey][ImpoundCost], VehicleInfo[carkey][Insurances], VehicleInfo[carkey][GPS] );
SendClientMessage( playerid, -1, szString );
}
}
SendClientMessage( playerid, 0x6699ccff, "______________________________________________");
return 1;
}
EDIT:
You could've done this in playerinfo enum: VehKey[5], the use of that would be PlayerInfo[playerid][VehKey][0-4]
Just a suggestion