--RAİNBOW ARAÇ RENGİ
addEvent("aracrenkdegis",true)
addEventHandler("aracrenkdegis",root,function(veh,r,g,b)
setVehicleColor(veh,r,g,b)
end)
-- RAİNBOW FAR RENGİ
addEvent("farrenkdegis",true)
addEventHandler("farrenkdegis",root,function(vehf,rf,gf,bf)
setVehicleHeadLightColor(vehf,rf,gf,bf)
end)
-- TAMİR VE FLİP
addEvent("fixflip",true)
addEventHandler("fixflip",root,function()
local arac = getPedOccupiedVehicle(source)
if arac then
fixVehicle(arac)
local rotX, rotY, rotZ = getElementRotation(arac)
setElementRotation(arac,0,0,rotZ)
outputChatBox(getPlayerName(source).." #FFFFFFVIP Panel'den aracını tamir ettirdi.",root,255,255,255,true)
else
outputChatBox("Sadece araçtayken aracını tamir ettirebilirsin!",source,255,0,0,false)
end
end)
-- SKİN ALMA VE UYGULAMA
addEvent("skinkullan",true)
addEventHandler("skinkullan",root,function(skin)
local hesap = getPlayerAccount(source)
setAccountData(hesap,"skin",skin)
skinac()
end)
function skinac()
for _, player in ipairs(getElementsByType("player")) do
local acc = getPlayerAccount(player)
if not isGuestAccount(acc) then
local driving, vehicle = isPedDrivingVehicle ( player )
if driving then
local skin = getAccountData(acc,"skin")
if skin then
setVehicleColor(vehicle,255,255,255)
triggerClientEvent(root,"skinuygula",source,skin,vehicle,source,getSkinTextures())
end
end
end
end
end
-- HER EL BAŞI OTOMATİK UYGULAMA
function elbasi()
skinac()
end
addEventHandler("onResourceStart",resourceRoot,elbasi)
addEventHandler("onPlayerVehicleEnter",root,elbasi)
-- GEREKLİ FONKSİYONLAR (ELLEME)
function getSkinTextures()
if ayar("ayar15") == "default" then
return {"map","vehiclegrunge256"}
elseif ayar("ayar15") ~= "default" and type(fromJSON(ayar("ayar15"))) == "table" then
return fromJSON(ayar("ayar15"))
else
return {"map","vehiclegrunge256"}
end
end
function ayar(value)
if tonumber(get(value)) == nil then
return tostring(get(value))
else
return tonumber(get(value))
end
end
function isPedDrivingVehicle(ped)
assert(isElement(ped) and (getElementType(ped) == "ped" or getElementType(ped) == "player"), "Bad argument @ isPedDrivingVehicle [ped/player expected, got " .. tostring(ped) .. "]")
local isDriving = isPedInVehicle(ped) and getVehicleOccupant(getPedOccupiedVehicle(ped)) == ped
return isDriving, isDriving and getPedOccupiedVehicle(ped) or nil
end