24.01.2013, 06:53
Here is the part of public OnPlayerLogin
This the the code of Player owned vehicle , loading in guess.
Код:
for(new v = 0; v < MAX_PLAYERVEHICLES; v++) { format(string, 128, "pv%dPosX",v); if( strcmp( key , string , true ) == 0 ) { val = ini_GetValue( Data ); PlayerVehicleInfo[playerid][v][pvPosX] = floatstr( val ); } format(string, 128, "pv%dPosY",v); if( strcmp( key , string , true ) == 0 ) { val = ini_GetValue( Data ); PlayerVehicleInfo[playerid][v][pvPosY] = floatstr( val ); } format(string, 128, "pv%dPosZ",v); if( strcmp( key , string , true ) == 0 ) { val = ini_GetValue( Data ); PlayerVehicleInfo[playerid][v][pvPosZ] = floatstr( val ); } format(string, 128, "pv%dPosAngle",v); if( strcmp( key , string , true ) == 0 ) { val = ini_GetValue( Data ); PlayerVehicleInfo[playerid][v][pvPosAngle] = floatstr( val ); } format(string, 128, "pv%dModelId",v); if( strcmp( key , string , true ) == 0 ) { val = ini_GetValue( Data ); PlayerVehicleInfo[playerid][v][pvModelId] = strval( val ); } format(string, 128, "pv%dLock",v); if( strcmp( key , string , true ) == 0 ) { val = ini_GetValue( Data ); PlayerVehicleInfo[playerid][v][pvLock] = strval( val ); } format(string, 128, "pv%dLocked",v); if( strcmp( key , string , true ) == 0 ) { val = ini_GetValue( Data ); PlayerVehicleInfo[playerid][v][pvLocked] = strval( val ); } format(string, 128, "pv%dPaintJob",v); if( strcmp( key , string , true ) == 0 ) { val = ini_GetValue( Data ); PlayerVehicleInfo[playerid][v][pvPaintJob] = strval( val ); } format(string, 128, "pv%dColor1",v); if( strcmp( key , string , true ) == 0 ) { val = ini_GetValue( Data ); PlayerVehicleInfo[playerid][v][pvColor1] = strval( val ); } format(string, 128, "pv%dColor2",v); if( strcmp( key , string , true ) == 0 ) { val = ini_GetValue( Data ); PlayerVehicleInfo[playerid][v][pvColor2] = strval( val ); } format(string, 128, "pv%dPrice",v); if( strcmp( key , string , true ) == 0 ) { val = ini_GetValue( Data ); PlayerVehicleInfo[playerid][v][pvPrice] = strval( val ); } format(string, 128, "pv%dTicket",v); if( strcmp( key , string , true ) == 0 ) { val = ini_GetValue( Data ); PlayerVehicleInfo[playerid][v][pvTicket] = strval( val ); } format(string, 128, "pv%dWeapon0",v); if( strcmp( key , string , true ) == 0 ) { val = ini_GetValue( Data ); PlayerVehicleInfo[playerid][v][pvWeapons][0] = strval( val ); } format(string, 128, "pv%dWeapon1",v); if( strcmp( key , string , true ) == 0 ) { val = ini_GetValue( Data ); PlayerVehicleInfo[playerid][v][pvWeapons][1] = strval( val ); } format(string, 128, "pv%dWeapon2",v); if( strcmp( key , string , true ) == 0 ) { val = ini_GetValue( Data ); PlayerVehicleInfo[playerid][v][pvWeapons][2] = strval( val ); } format(string, 128, "pv%dWepUpgrade",v); if( strcmp( key , string , true ) == 0 ) { val = ini_GetValue( Data ); PlayerVehicleInfo[playerid][v][pvWepUpgrade] = strval( val ); } format(string, 128, "pv%dFuel",v); if( strcmp( key , string , true ) == 0 ) { val = ini_GetValue( Data ); PlayerVehicleInfo[playerid][v][pvFuel] = floatstr( val ); } format(string, 128, "pv%dImpound",v); if( strcmp( key , string , true ) == 0 ) { val = ini_GetValue( Data ); PlayerVehicleInfo[playerid][v][pvImpounded] = strval( val ); } format(string, 128, "pv%dNumPlate",v); //if( strcmp( key , string , true ) == 0 ) { val = ini_GetValue( Data ); strcpy(PlayerVehicleInfo[playerid][v][pvNumberPlate], Data, 32); } //PlayerVehicleInfo[playerid][v][pvNumberPlate] = floatstr( val ); } for(new m = 0; m < MAX_MODS; m++) { format(string, 128, "pv%dMod%d", v, m); if( strcmp( key , string , true ) == 0 ) { val = ini_GetValue( Data ); PlayerVehicleInfo[playerid][v][pvMods][m] = strval( val ); } } //format(string, 128, "pv%dAllowedPlayer",v); //if( strcmp( key , string , true ) == 0 ) { val = ini_GetValue( Data ); strmid(PlayerVehicleInfo[playerid][v][pvAllowPlayer], val, 0, strlen(val)-1, 255); } }