DaVeCS
Mapper
Wiek: 31 Na forum: 3386 dni Posty: 193
Nick w MP: DaVe
Piwa : 59
Witajcie, mam problem z Eazy Workshop a dok?adniej z Mk1 i Mk2, mo?na je zamontowa? lecz nie poprawiaj? one osi?g?w auta.
Tak wygl?da cz??? skryptu odpowiadaj?ca za MK:
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
addEvent ( "mk2" , true )
addEventHandler ( "mk2" , getRootElement (), function()
local hajs = getPlayerMoney ( source )
local ccar = getPedOccupiedVehicle ( source )
if not ccar then outputChatBox ( "Musisz by? w poje?dzie" , source , 255 , 255 , 255 ) return end
if getElementData ( source , "player:organization" ) ~= "Eazy Workshop" then outputChatBox ( "Nie nale?ysz do organizacji Eazy Workshop" , source , 255 , 255 , 255 ) return end
if hajs < 0 then outputChatBox ( "Nie sta? Ci? na te ulepszenie" , source , 255 , 255 , 255 ) return end
local id = getElementData ( ccar , "vehicle:id" )
if not id then return end
local qr = exports [ 'ogrpg-db' ]: dbGet ( "SELECT * FROM ogrpg_vehicles WHERE id=? AND mk2=?" , getElementData ( ccar , "vehicle:id" ), "1" )
if #qr == 1 then outputChatBox("Posiadasz ju? te ulepszenie!", source, 255, 255, 255) return end
exports [ "ogrpg-vehicles" ]: onSaveVehicle ( ccar )
destroyElement ( ccar )
exports [ "ogrpg-db" ]: dbSet ( "UPDATE ogrpg_vehicles SET parking=1,tp_to_parking=? WHERE id=?" , "MONTAZ US2" , id )
exports [ "ogrpg-db" ]: dbSet ( "UPDATE ogrpg_vehicles SET mk2=1 WHERE id=?" , id )
outputChatBox ( "Monta? systemu US2 przebieg? pomy?lnie, pojazd zosta? przeniesiony do przechowywalni" , source , 255 , 255 , 255 )
takePlayerMoney ( source , 0 )
end )
addEvent ( "mk1" , true )
addEventHandler ( "mk1" , getRootElement (), function()
local hajs = getPlayerMoney ( source )
local ccar = getPedOccupiedVehicle ( source )
if not ccar then outputChatBox ( "Musisz by? w poje?dzie" , source , 255 , 255 , 255 ) return end
if getElementData ( source , "player:organization" ) ~= "Eazy Workshop" then outputChatBox ( "Nie nale?ysz do organizacji Eazy Workshop" , source , 255 , 255 , 255 ) return end
if hajs < 0 then outputChatBox ( "Nie sta? Ci? na te ulepszenie" , source , 255 , 255 , 255 ) return end
local id = getElementData ( ccar , "vehicle:id" )
if not id then return end
local qr = exports [ 'ogrpg-db' ]: dbGet ( "SELECT * FROM ogrpg_vehicles WHERE id=? AND mk1=?" , getElementData ( ccar , "vehicle:id" ), "1" )
if #qr == 1 then outputChatBox("Posiadasz ju? te ulepszenie!", source, 255, 255, 255) return end
-- exports [ "ogrpg-db" ]: dbSet ( "UPDATE ogrpg_vehicles SET mk1=1 WHERE ownedPlayer=? AND id=?" , getElementData ( source , "player:uid" ), getElementData ( ccar , "vehicle:id" ))
exports [ "ogrpg-vehicles" ]: onSaveVehicle ( ccar )
destroyElement ( ccar )
exports [ "ogrpg-db" ]: dbSet ( "UPDATE ogrpg_vehicles SET mk1=1 WHERE id=?" , id )
exports [ "ogrpg-db" ]: dbSet ( "UPDATE ogrpg_vehicles SET parking=1,tp_to_parking=? WHERE id=?" , "MONTAZ US1" , id )
outputChatBox ( "Monta? systemu US1 przebieg? pomy?lnie, pojazd zosta? przeniesiony do przechowywalni" , source , 255 , 255 , 255 )
takePlayerMoney ( source , 0 )
end )