SA-MP Forums Archive
CMD:vmodel issue - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: CMD:vmodel issue (/showthread.php?tid=429322)



CMD:vmodel issue - UnknownGamer - 09.04.2013

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?


Re: CMD:vmodel issue - Da_Noob - 09.04.2013

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