02.10.2011, 09:15
pawn Код:
stock LoadVehicles(vehicleid)
{
new playerid;
new vstring[10];
new pName[MAX_PLAYER_NAME];
GetPlayerName(playerid,pName,sizeof(pName));
format(vstring,sizeof(vstring),"/VehicleOwnership/%s.txt",pName);
if(!dini_Exists(vstring))
{
dini_Create(vstring);
}
VehicleInfo[vehicleid][vPrice] = dini_Int(vstring,"VehPrice");
VehicleInfo[vehicleid][vModel] = dini_Int(vstring,"VehModel");
VehicleInfo[vehicleid][vOwned] = dini_Bool(vstring,"VehOwned") ? true : false;
VehicleInfo[vehicleid][vSell] = dini_Bool(vstring,"VehForSell") ? true : false;
VehicleInfo[vehicleid][vFloatY] = dini_Float(vstring,"VehFloatY");
VehicleInfo[vehicleid][vFloatZ] = dini_Float(vstring,"VehFloatZ");
VehicleInfo[vehicleid][vFloatX] = dini_Float(vstring,"VehFloatX");
strmid(VehicleInfo[vehicleid][vOwner], dini_Get(vstring, "VehOwner"), 0, false, strlen(dini_Get("VehOwner"))); // number of arguments does not match definition??(they DO?)
return 1;
}