09.04.2013, 07:35
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;
}
dini_IntSet(file, "Model", model);
That should be understanding what SSCANF is saying, and over-riding the current id, with the new one?

