Wysłany: 2021-02-08, 17:02
Patryk545
Wiek: 25 Na forum: 2225 dni Posty: 36
Nick w MP: Patryk545
Piwa : 1
Nie dzia?a maskowanie kod podam ni?ej.
elements = {}
elements [ "positions" ] = {
[ "EZ 1" ]={
marker = { 1946.84 , - 2033.00 , 13.55 },
cuboid = { 1946.84 , - 2033.00 , 13.55 , 6 },
text = "Monta? wzmocnie?"
}
}
createBlip ( 1941.00 , - 2007.68 , 13.55 , 42 , 2 , 0 , 0 , 0 , 0 , 0 , 175 )
local napis = createElement ( "text" )
setElementData ( napis , "name" , "Dost?pne ulepszenia:\nMaskowanie (50%)\nMaskowanie (100%)\nNitro (5x)" )
setElementPosition ( napis , 1946.84 , - 2033.00 , 13.55 - 0.2 )
for i , v in pairs ( elements [ "positions" ]) do
v . cuboid = ColShape . Sphere ( unpack ( v . cuboid ))
v . marker = Marker ( v . marker [ 1 ], v . marker [ 2 ], v . marker [ 3 ]- 0.90 , "cylinder" , 3 , 255 , 255 , 0 )
end
addEvent ( "maskowaniepolowiczne" , true )
addEventHandler ( "maskowaniepolowiczne" , getRootElement (), function()
local hajs = getPlayerMoney ( source )
local ccar = getPedOccupiedVehicle ( source )
local cena = 15000000
if getElementData ( ccar , "vehicle:ownedPlayer" ) == getElementData ( client , "player:sid" ) then
if hajs < cena then triggerClientEvent ( client , "onClientAddNotification" , client , "Nie sta? Ci? aby zakupi? to ulepszenie!" , "error" ) return end
local id = getElementData ( ccar , "vehicle:id" )
if not id then triggerClientEvent ( client , "onClientAddNotification" , client , "To nie jest pojazd prywatny!" , "error" ) return end
local qr = exports [ 'pystories-db' ]: dbGet ( "SELECT * FROM pystories_vehicles WHERE id=? AND masked=?" , getElementData ( ccar , "vehicle:id" ), "1" )
if qr == 1 then triggerClientEvent ( client , "onClientAddNotification" , client , "Posiadasz ju? to ulepszenie:\n#007affMaskowanie\n50%" , "info" ) return end
exports [ "pystories-vehicles" ]: onSaveVehicle ( ccar )
destroyElement ( ccar )
exports [ "pystories-db" ]: dbSet ( "UPDATE pystories_vehicles SET parking=1,tp_to_parking=? WHERE id=?" , "Maskowanie 50% zamontowany pomy?lnie" , id )
exports [ "pystories-db" ]: dbSet ( "UPDATE pystories_vehicles SET masked=1 WHERE id=?" , id )
triggerClientEvent ( client , "onClientAddNotification" , client , "Pomy?lnie zamontowano ulepszenie:\n#00c606Maskowanie\n50%" , "success" )
takePlayerMoney ( source , cena )
else
triggerClientEvent ( client , "onClientAddNotification" , client , "To nie jest Tw?j pojazd!" , "error" )
end
end )
addEvent ( "maskowanie" , true )
addEventHandler ( "maskowanie" , getRootElement (), function()
local hajs = getPlayerMoney ( source )
local ccar = getPedOccupiedVehicle ( source )
local cena = 25000000
if getElementData ( ccar , "vehicle:ownedPlayer" ) == getElementData ( client , "player:sid" ) then
if hajs < cena then triggerClientEvent ( client , "onClientAddNotification" , client , "Nie sta? Ci? aby zakupi? to ulepszenie!" , "error" ) return end
local id = getElementData ( ccar , "vehicle:id" )
if not id then triggerClientEvent ( client , "onClientAddNotification" , client , "To nie jest pojazd prywatny!" , "error" ) return end
local qr = exports [ 'pystories-db' ]: dbGet ( "SELECT * FROM pystories_vehicles WHERE id=? AND masked=?" , getElementData ( ccar , "vehicle:id" ), "2" )
if #qr == 1 then triggerClientEvent(client, "onClientAddNotification", client, "Posiadasz ju? to ulepszenie:\n#007affMaskowanie\n100%", "info") return end
exports [ "pystories-vehicles" ]: onSaveVehicle ( ccar )
destroyElement ( ccar )
exports [ "pystories-db" ]: dbSet ( "UPDATE pystories_vehicles SET parking=1,tp_to_parking=? WHERE id=?" , "Maskowanie 100% zamontowany pomy?lnie" , id )
exports [ "pystories-db" ]: dbSet ( "UPDATE pystories_vehicles SET masked=2 WHERE id=?" , id )
triggerClientEvent ( client , "onClientAddNotification" , client , "Pomy?lnie zamontowano ulepszenie:\n#00c606Maskowanie\n100%" , "success" )
takePlayerMoney ( source , cena )
else
triggerClientEvent ( client , "onClientAddNotification" , client , "To nie jest Tw?j pojazd!" , "info" )
end
end )
addEvent ( "nitro5x" , true )
addEventHandler ( "nitro5x" , getRootElement (), function()
local hajs = getPlayerMoney ( source )
local ccar = getPedOccupiedVehicle ( source )
local tuning = getVehicleUpgradeOnSlot ( ccar , 8 )
local cena = 50000000
if getElementData ( ccar , "vehicle:ownedPlayer" ) == getElementData ( client , "player:sid" ) then
if hajs < cena then triggerClientEvent ( client , "onClientAddNotification" , client , "Nie sta? Ci? aby zakupi? to ulepszenie!" , "error" ) return end
if tuning == 1009 then triggerClientEvent ( client , "onClientAddNotification" , client , "Posiadasz ju? to ulepszenie:\n#007affNitro\n5x" , "info" ) return end
if hajs < cena then triggerClientEvent ( client , "onClientAddNotification" , client , "Nie sta? Ci? aby zakupi? to ulepszenie!" , "error" ) return end
local id = getElementData ( ccar , "vehicle:id" )
if not id then triggerClientEvent ( client , "onClientAddNotification" , client , "To nie jest pojazd prywatny!" , "error" ) return end
addVehicleUpgrade ( ccar , 1009 )
takePlayerMoney ( source , cena )
else
triggerClientEvent ( client , "onClientAddNotification" , client , "To nie jest Tw?j pojazd!" , "error" )
end
end )
B??d db3: ERROR:[Tuning]/psrpg-workshop-1/s.lua:56: attempt to gry length of local qr (a boolean value)
Wysłany: 2021-02-08, 21:01
Wilq
Wiek: 24 Na forum: 4429 dni Posty: 3410
Piwa : 739
Masz skrypt pystories-db, a w nim funkcje dbGet? Baza popieta i dziala?
Wysłany: 2021-02-10, 14:24
SatuK
Wiek: 21 Na forum: 1957 dni Posty: 5
Nick w MP: Migeral.
Piwa : 1
Baza danych, mo?e by? ?le podpi?ta.
Zobacz czy masz z ni? jakie? problemy.
Je?li to dalej nie pomo?e to napisz, lub pobierz z serwis?w zajmuj?cych si? MTA nowy skrypt na maskowanie.
Je?li dalej ci to nie zadzia?a to napisz do mnie na discordzie: SatuK#*
Ostatnio zmieniony przez NotPaladyn 2021-02-15, 14:44, w całości zmieniany 1 raz
Wysłany: 2021-02-15, 14:29
PatryKK.
Emeryt LUA
Wiek: 26 Na forum: 3061 dni Posty: 1060
Nick w MP: PatryKK.
Piwa : 2322
Więcej informacji znajdziesz w Wikipedii MTA: dbGet
przyk?ad u?ycia:
local result = exports [ "bazadanych" ]: dbGet ( "SELECT * from tabela WHERE serial=? AND level=?" , getPlayerSerial ( plr ), level )
pokaz czy dobrze podpiales baze (zaslon swoje dane)
Tagi: maskowanie
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: