Help With getting ID
#1

pawn Код:
forward BoughtCarInfo(playerid);
public BoughtCarInfo(playerid)
{
    new vstring[128], playername[MAX_PLAYER_NAME];
    GetPlayerName(playerid, playername,sizeof(playername));
    new INI:vfile = INI_Open(VehPath(playerid));
    new Float:X, Float:Y, Float:Z, Float:A;
    new vehicleid = GetPlayerVehicleID(vehicleid);
    new vcolor1,vcolor2;
    ChangeVehicleColor(vehicleid, vcolor1, vcolor2);
    GetVehiclePos(vehicleid,X,Y,Z);
    GetVehicleZAngle(vehicleid, A);
    INI_SetTag(vfile,"Vehicle Info");
    INI_WriteInt(vfile, "Owner",VehicleInfo[playerid][vOwner] = 1);
    INI_WriteInt(vfile, "Model", vehicleid);
    INI_WriteInt(vfile, "Plate",VehicleInfo[playerid][vPlate] = 0);
    INI_WriteFloat(vfile,"LocX",X);
    INI_WriteFloat(vfile,"LocY",Y);
    INI_WriteFloat(vfile,"LocZ",Z);
    INI_WriteFloat(vfile,"LocA",A);
    INI_WriteInt(vfile, "Color1",vColor1);
    INI_WriteInt(vfile, "Color1",vColor2);
    INI_WriteInt(vfile, "Mod1",VehicleInfo[playerid][vMod1] = 0);
    INI_WriteInt(vfile, "Mod2",VehicleInfo[playerid][vMod2] = 0);
    INI_WriteInt(vfile, "Mod3",VehicleInfo[playerid][vMod3] = 0);
    INI_WriteInt(vfile, "Mod4",VehicleInfo[playerid][vMod4] = 0);
    INI_WriteInt(vfile, "Mod5",VehicleInfo[playerid][vMod5] = 0);
    INI_WriteInt(vfile, "Mod6",VehicleInfo[playerid][vMod6] = 0);
    INI_WriteInt(vfile, "Mod7",VehicleInfo[playerid][vMod7] = 0);
    INI_WriteInt(vfile, "Mod8",VehicleInfo[playerid][vMod8] = 0);
    INI_WriteInt(vfile, "Mod9",VehicleInfo[playerid][vMod9] = 0);
    INI_WriteInt(vfile, "Mod10",VehicleInfo[playerid][vMod10] = 0);
    INI_WriteInt(vfile, "Mod11",VehicleInfo[playerid][vMod11] = 0);
    INI_WriteInt(vfile, "Mod12",VehicleInfo[playerid][vMod12] = 0);
    format(vstring, sizeof(vstring), "%s, You've Bought A %s Remember To /Park your vehicle",playername, VehNames[GetVehicleModel(vehicleid)-400]);
    SendClientMessage(playerid, ORANGE, vstring);
    INI_Close(vfile);
    return 1;
}
Im trying to get this code to get the Vehicle ID ... When purchased it .. But its working but only Putting this Into the Car Userfile

pawn Код:
[Vehicle Info]
Owner = 0
Model = 1 // This Aint the Car Model I purchased a Buffalo but it Puts ID 1
Plate = 0
LocX = 554.490966
LocY = -1284.950439
LocZ = 17.832199
LocA = 196.125122
Color1 = 8
Mod1 = 0
Mod2 = 0
Mod3 = 0
Mod4 = 0
Mod5 = 0
Mod6 = 0
Mod7 = 0
Mod8 = 0
Mod9 = 0
Mod10 = 0
Mod11 = 0
Mod12 = 0
Reply
#2

Change vehicleid for GetVehicleModel(vehicleid)
pawn Код:
INI_WriteInt(vfile, "Model", GetVehicleModel(vehicleid));
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)