29.03.2016, 17:26
Quote:
Can you show us which system do you use? So send us at least the link where you got the dynamic script from.
|
here is a snippet, if you don't have enough from only that tell me.
pawn Код:
if(tmpid!=-1 && biz[tmpid][biztype]==21)
{
format(nomefile,sizeof(nomefile),"%s.txt",biz[tmpid][bizname]);
{
if(GetPlayerCars(playerid) >= 4 && PlayerInfo[playerid][premium] == 0)
{
return SendClientError(playerid, "Sorry, you have no slots left! You may donate to get more slots!");
}
if(GetPlayerCars(playerid) >= 6)
{
return SendClientError(playerid, "Sorry, you have no slots left!");
}
if(dini_Int(nomefile, "comps") <= 0) return SendClientError(playerid, "No cars in stock!");
if(PlayerTemp[playerid][sm] < jobcars[listitem][jcprice]) return SendClientError(playerid, "Not enough cash!");
new carid = GetUnusedCar();
if(carid == -1) return SendClientWarning(playerid, "Error occured, please report the problem. (F8)");
new
string[ 128 ];
format(string, sizeof(string), "Dealership: You have bought a %s for $%s! Enter it and park it! (/car help)", jobcars[listitem][jcname], number_format(jobcars[listitem][jcprice]));
SendClientInfo(playerid, string);
GivePlayerMoneyEx(playerid, -jobcars[listitem][jcprice]);
dini_IntSet(nomefile,"bizcash",dini_Int(nomefile,"bizcash") + jobcars[listitem][jcprice]/2);
dini_IntSet(nomefile,"comps", dini_Int(nomefile, "comps") - 1);
UnModCar(carid);
// 1705.0454,-1475.6901,13.1665,169.0701
//2838.0874,,,
dini_FloatSet(CarFile(carid), "x", 1859.228637);
dini_FloatSet(CarFile(carid), "y", -1849.452026);
dini_FloatSet(CarFile(carid), "z", 13.579807);
dini_FloatSet(CarFile(carid), "a", 8.9621);
dini_IntSet(CarFile(carid), "resetted", 0);
dini_IntSet(CarFile(carid), "cartype", 0);
dini_IntSet(CarFile(carid), "carteam", 0);
dini_IntSet(CarFile(carid), "model", jobcars[listitem][jcmodel]);
dini_Set(CarFile(carid), "owner", PlayerName(playerid));
ReloadVehicle(carid);
PutPlayerInVehicle(playerid, carid, 0);
format(string, sizeof(string), "6[VEHICLE] %s has bought a %s for $%s from the %s!", PlayerName(playerid), GetVehicleName(GetPlayerVehicleID(playerid)), number_format(jobcars[listitem][jcprice]), biz[tmpid][bizname]);
iEcho(string);
return 1;
}
}
}