CMD:vmodel issue
#1

pawn Код:
CMD:vmodel(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] <= 4) return SCM(playerid, COLOR_LIGHTRED, "NOPE!!");
    new file[64], carid, model;
    if(sscanf(params, "dd", carid, model)) return SCM(playerid, COLOR_LIGHTRED, "USAGE: /vmodel [CarID] [ModelID]");
    format(file, sizeof(file),"LARP/Vehicles/%d.ini", carid);
    dini_IntSet(file, "Model", model);
    DestroyVehicle(carid);
    ownedcar[carid] = CreateVehicle(CarInfo[carid][cModel],CarInfo[carid][cLocationx],CarInfo[carid][cLocationy],CarInfo[carid][cLocationz],CarInfo[carid][cAngle],CarInfo[carid][cColorOne],CarInfo[carid][cColorTwo],60000);
    OnPropUpdate(4,carid);
    return 1;
}
Do you see any errors their, to why the vehicle doesn't save the new model id? (It's using the variable save?)

dini_IntSet(file, "Model", model);

That should be understanding what SSCANF is saying, and over-riding the current id, with the new one?
Reply
#2

Add this: CarInfo[carid][cModel] = model;
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)