Witam , mam problem z zapisywaniem si? tuningu do przecho.Problem polega na tym ?e po stuningowaniu auta i oddania go do przecho tuning si? nie zapisuje , dane o tuningu powinny si? zapisywa? w bazie danych ale nic si? nie nadpisuje.
Prosz? o szybk? pomoc w nagrod? stawiam piwo
Witam, zacz??em si? bawi? w kalkulator cen tuningu pojazdu. W jaki spos?b zacz??? Wiem w jaki spos?b zrobi? dropdown itp. Tylko jak przypisac do tego kwot? i obliczy? ca?y og?lny tuning.
Siemka, mam problem z serwerem. Mianowicie nie zapisuje mi punkt?w premium, tuningu w aucie i chyba got?wki. Zapisuje srp, zapisuje auto w przecho ze je posiadam i zapisuje hajs w bankomacie, z g?ry dzieki za odpowiedz
Witam posiadam problem z pystories-vehicles , w skr?cie opisuj?c problem..
Polega na braku zapisu od strony wy?ej wymienionego zasobu.
B??d linijki 265
local nlOffsets={
[411]={-1,0,-0.6}, -- infernus
[470]={-1,0,-0.4}, -- patriot
[541]={-0.9,0,-0.4}, -- bulelt
[549]={-0.9,0,-0.4}, -- tampa
[587]={-1,0,-0.5}, -- euros
}
local nlIDX={
3962,2113,1784,2054,2428,2352
}
function getVehicleHandlingProperty ( element, property )
if isElement ( element ) and getElementType ( element ) == "vehicle" and type ( property ) == "string" then
local handlingTable = getVehicleHandling ( element )
local value = handlingTable[property]
if value then
return value
end
end
return false
end
function getAdmin2(plr,level)
if level then
local result=exports["pystories-db"]:dbGet("SELECT * from pystories_admins WHERE serial=? AND level=?", getPlayerSerial(plr), level)
if result and #result > 0 then
return true
else
return false
end
else
local result=exports["pystories-db"]:dbGet("SELECT * from pystories_admins WHERE serial=?", getPlayerSerial(plr))
if result and #result > 0 then
return true
else
retur...
addEvent("onVehicleTuningMontage", true)
addEventHandler("onVehicleTuningMontage", root, function(plr,veh,czesc,kwota,data)
if getElementData(veh, "vehicle:ownedPlayer") ~= getElementData(plr, "player:sid") then exports.nrpg_interface:showPlayerNotification(plr, "To nie jest tw?j pojazd!", "error", 15000) return end
montuj(plr,veh,czesc,kwota,data)
end)
function montuj(plr,veh,czesc,cena,data)
local id = getElementData(veh, "vehicle:id")
if not id then return end
if getElementData(veh, "vehicle:ownedPlayer") ~= getElementData(plr, "player:sid") then exports.nrpg_interface:showPlayerNotification(plr, "To nie jest tw?j pojazd!", "error", 15000) return end
local result = exports["pystories-db"]:dbSet("SELECT * FROM pystories_vehicles WHERE id=?", id)
if czesc == "MK1" then
if result[1].mk1 ~= 0 then
exports.nrpg_interface:showPlayerNotification(plr, "Posiadasz to ulepszenie", "error")
else
exports["pystories-db"]:dbSet("UPDATE pystories_vehicles SET mk1=? WHERE id=?", 1, id)
takePlayerMoney(plr, cena)
exports.nrpg_interface:showPlayerNotification(plr, "Zamontowano MK1. Pobrano "..cena.." PLN", "success"...
witam , nie dzia?a mi tuning a dok?adnie chodzi o to ?e si? nie wpisuje do bazy danych
b??d:
1.ERROR: [Podstawa]/pystories-vehicles/s_vehbuy.lua:476: bad argument #41 to 'format' (string expected, got boolean)
2.ERROR: [Podstawa]/RPG-Przecho/s_parking.lua:61: call: failed to call 'pystories-vehicles:onSaveVehicle' [string "?"]
kod (pystories-vehicles/s_vehbuy.lua)
[code]function onSaveVehicle(vehicle)
if getElementData(vehicle, "vehicle:spawn") then
-- Setting
local panelstates={}
local model=getElementModel(vehicle)
local health=getElementHealth(vehicle)
local x,y,z=getElementPosition(vehicle)
local rx,ry,rz=getElementRotation(vehicle)
local desc=getElementData(vehicle,"vehicle:desc") or ""
local id=getElementData(vehicle,"vehicle:id")
local silnik=getElementData(vehicle,"Pojemnosc:silnika") or "1.2"
local cylindry=getElementData(vehicle,"vehicle:cylindry") or "V4"
local naped=getElementData(vehicle,"vehicle:naped")
local trakcja=getElementData(vehicle,"vehicle:trakcja")
local hamulce=getElementData(vehicle,"vehicle:hamulce")
local zamow_komis=getElementData(vehicle,"vehicle:zamow_komis")
local skret=getElementData(vehicle,"vehicle:skret")
local fuel=getElementData(vehicle,"vehicle:fuel")
local mileage...
Cze??, mam skrypt o nazwie sa_customs wszystko ?miga jak powinno lecz jak wchodze w tuning wizualny --> kolor ?wiate? to nie mam paletki do wybrania koloru i pisze tylko "Kolor ?wiate? w posiadaniu". M?g?by kto? pom?c?
Mam drugie pytanie, jak doda? inne opcje tuningu np tune mechaniczny do tego systemu tune? ( wszystko podpiete pod pysa )
Witam mam problem z przechowywalni? jak robi? tuning maluje to auto daje je do przecho i wyjmuje to wszystko usuwa lub jak daje auto do przecho zepsute i je wyjme to jest naprawione prosze o pomoc daje
c_parking [lua]local screenW, screenH = guiGetScreenSize()
local marker=createMarker(-2048.17,346.43,35.13, "cylinder", 2, 255,255,255,50)
local sphere=createColSphere(-1743.54,955.78,24.48,5)
local t=createElement("text")
setElementData(t,"scale",1.5)
setElementData(t,"name","OdbiĂłr pojazdĂłw")
setElementPosition(t,-2048.17,346.43,35.17)
addEvent("onParkingGetVehicles", true)
addEventHandler("onParkingGetVehicles", root, function(result)
guiGridListClear(wm.gridlist)
if not result then return end
for i,v in pairs(result) do
if...
Witam mam problem gdy? jak auto jest zepsute i daje je do przecho potem wyjme je yo jest naprawione , gdy zrobie tuning pomaluje go itp dam go do przecho i wyjme to tak samo usuwa wszystko. Za pomoc daje
function TuningMarker(el,md)
if not md or getElementType(el) ~= "player" then return end
if not getPedOccupiedVehicle(el) then
outputChatBox("✘ Wejd? do pojazdu!",el, 255, 0, 0)
return
end
local veh = getPedOccupiedVehicle(el)
if Motocykle[getElementModel(veh)] then
outputChatBox("✘ Nie mo?esz zamontowa? ulepszenia do motocyklu!",el, 255, 0, 0)
return
end
triggerClientEvent(el, "PokazGuiTuning", resourceRoot)
setMarkerColor (MarkerTuning, 255, 0, 0, 145 )
end
addEventHandler( "onMarkerHit", MarkerTuning, TuningMarker)
addEventHandler("onMarkerLeave", MarkerTuning, function(el, md)
if not md or getElementType(el) ~= "player" then return end
setMarkerColor (MarkerTuning, 25, 213, 15, 145)
end)
Siemka,
chcialbym Was poprosic o pomoc, a mianowicie chcialbym powiekszyc miejsce w ktorym stoi auto do robienia tuningu, lecz nie wiem gdzie ise to robi. Pomzoe ktos? Daje repke i Warke
t=createElement("text")
setElementData(t,"name",v.text)
setElementPosition(t,v.mpos[1], v.mpos[2], v.mpos[3])
addEventHandler("onMarkerHit", v.marker, function(el,md)
if getElementType(el)~= "player" then return end
local cs=getElementData(source, "marker:cuboid")
if not cs then return end
local job=getElementData(source,"marker:duty")
local ljob=getElementData(el,"player:duty")
if job ~= ljob then
outputChatBox(" Nie jeste? zatrudniony w tym warsztacie.", el, 255, 0, 0)
return
end
local vehicles=getElementsWithinColShape(cs,"vehicle")
if #ve...
Witam, w jaki spos?b mog? sprawdzi?, czy m?j pojazd ma ju? dany tuning? Chodzi mi o te tuningi z Gta typu spoiler czy felgi. Dany tuning ma swoje ID i chc?, zrobi? system tuningu tylko nie wiem, jak sprawdzi?, czy dany pojazd ju? ma co? zamontowane. A teraz mo?na ca?y czas montowa? ten sam tuning, mimo ?e ju? go posiadam.
Witam, mam problem z zapisem tuningu. Kiedy montuj? tuning do tylko jednego auta, w momencie zapisu samochod?w zapisuje on te? dla wszystkich aut wy?ej w tabeli.
Witam, chcia?bym zrobi? zapis tuningu engineAcceleration. Jak to zrobi? ?
[lua]
handler = dbConnect("sqlite", "pojazdy.db")
--pojazdy
dbExec(handler, "CREATE TABLE IF NOT EXISTS pojazdy (id INTEGER PRIMARY KEY AUTOINCREMENT, wlasciciel TEXT, model INTEGER, x FLOAT, y FLOAT, z FLOAT, rot FLOAT, ca INTEGER, cb INTEGER, cc INTEGER, przebieg FLOAT, paliwo FLOAT)")
dbExec(handler, "CREATE UNIQUE INDEX IF NOT EXISTS IDX_id on pojazdy(id)")
--tuning
dbExec(handler, "CREATE TABLE IF NOT EXISTS tuning (id INTEGER, t0 INTEGER, t1 INTEGER, t2 INTEGER, t3 INTEGER, t4 INTEGER, t5 INTEGER, t6 INTEGER, t7 INTEGER, t8 INTEGER, t9 INTEGER, t10 INTEGER, t11 INTEGER, t12 INTEGER, t13 INTEGER, t14 INTEGER, t15 INTEGER, t16 INTEGER, paintjob INTEGER, hr INTEGER, hg INTEGER, hb INTEGER)")
dbExec(handler, "CREATE UNIQUE INDEX IF NOT EXISTS IDX_id on tuning(id)")
function onStartLoadVehicles()
local query = dbQuery(handler, "SELECT * FROM pojazdy")
local result, num_rows, errormsg = dbPoll (query, -1)
for i,v in pairs(result) do
local veh = createVehicle(v["model"], v["x"], v["y"], v["z"])
setElementRotation(veh, 0, 0, v["rot"])
setVehicleColor(veh, v["ca"], v["cb"], v["cc"])
ustawDanePojazdu(veh, v["id"], v["wlasciciel"])
--ustawiam paliwo i przebieg
setElementData(veh, "pojazd_paliwo&...
Witam tak jak w temacie zrobi?em sobie zapis pojazd?w ale chcia?bym r?wnie? zrobi? zapis tuningu i o to moje pytanie jak to zrobi? jakich funkcji event?w u?y? mo?e mi kto? to rozpisa? bo pr?bowa?em parena?cie razy ale mi nie wychodzi?o za pomoc i
Witam, czemu jak ju? nie ma tuningu a jeszcze raz wpisz? komend? na usuni?cie to dodaje mi kas? chod? nie ma go. Prosz? o pomoc.
[lua]
marker = createMarker(-145.853515625, 1165.5009765625, 19.795249938965, "cylinder", 0, 0, 0, 0, 130)
function addwheels ( sourcePlayer, command )
if isObjectInACLGroup ( "user." .. getAccountName(getPlayerAccount(sourcePlayer)), aclGetGroup ( "Mechanik_FC" ) ) then
if isElementWithinMarker(sourcePlayer,marker) then
theVehicle = getPlayerOccupiedVehicle ( sourcePlayer )
if ( theVehicle ) then
addVehicleUpgrade ( theVehicle, 1098 )
takePlayerMoney(sourcePlayer,3420)
outputChatBox ( "Zamontowano czesc w pojezdzie.", source, 255, 255, 255, true )
end
end
end
end
addCommandHandler ( "dodaj.1098", addwheels )
function remwheels ( sourcePlayer, command )
if isObjectInACLGroup ( "user." .. getAccountName(getPlayerAccount(sourcePlayer)), aclGetGroup ( "Mechanik_FC" ) ) then
if isElementWithinMarker(sourcePlayer,marker) then
theVehicle = getPlayerOccupiedVehicle ( sourcePlayer )
if ( theVehicle ) then
removeVehicleUpgrade ( theVehicle, 1098 )
givePlayerMoney(sourcePlayer,3249)
outputChatBox ( "Zdemontowano Czesc w pojezdzie.", source, 255, 255, 255, true )
end
end
end
end
addCommandHandler ( &quo...
Chce zrobic system zapisu na poczatek tylko felg, aby po kupnie poprostu zapisywalo do pliku. Mam zapis dof2. Z kolorem sobie poradzilem, lecz z felgami juz mam problem. Oto kod zapisu i wczytania :
[code]forward WczytajWozy();
public WczytajWozy()
{
new file[25];
for(new nr = 0; nr < ILOSC_WOZOW; nr++)
{
format(file,sizeof(file),WOZY_FILE,nr);
if(DOF_FileExists(file))
{
PrivateCar[nr][cAktywny]=DOF_GetInt(file,"Aktywny");
PrivateCar[nr][cKupiony]=DOF_GetInt(file,"Kupiony");
format(PrivateCar[nr][cWlasciciel], MAX_PLAYER_NAME, DOF_GetString(file,"Wlasciciel"));
PrivateCar[nr][cModel]=DOF_GetInt(file,"Model");
PrivateCar[nr][cX]=DOF_GetFloat(file,"X");
PrivateCar[nr][cY]=DOF_GetFloat(file,"Y");
PrivateCar[nr][cZ]=DOF_GetFloat(file,"Z");
PrivateCar[nr][cRX]=DOF_GetFloat(file,"rX");
PrivateCar[nr][cColor1]=DOF_GetInt(file,"Color1");
PrivateCar[nr][cColor2]=DOF_GetInt(file,"Color2");
PrivateCar[nr][cFelgi]=DOF_GetInt(file,"Felgi");
PrivateCar[nr][cRespawn]=DOF_GetInt(file,"Respawn");
PrivateCar[nr][cKoszt]=DOF_GetInt(file,"Koszt");
PrivateCar[nr][cLock]=DOF_GetInt(file,"Lock");
Witam! Dawno nic nie pisa?em, a wi?c mam pewne pytanie. Jaki jest argument na pobranie np. Spoileru z auta gracza? (Chodzi o zapis cz??ci tuningowych w aucie)