-- Client
addEventHandler('onClientGUIClick',root,
function ()
if source == GUIEditor.checkbox[4] and guiCheckBoxGetSelected (GUIEditor.checkbox[4]) == true then
triggerServerEvent('FixNow',localPlayer)
elseif source == GUIEditor.checkbox[4] and guiCheckBoxGetSelected (GUIEditor.checkbox[4]) == false then
triggerServerEvent('StopHealth',localPlayer)
end
end
)
addEvent"FixNow",true)
addEventHandler('FixNow',root,
function ( )
local Veh = getPedOccupiedVehicle ( source )
if getElementHealth(Veh) ~= 100 then
setElementHealth(Veh,100)
setVehicleDamageProof(Veh, true)
end
end )
addEvent"StopHealth",true)
addEventHandler('StopHealth',root,
function ()
if getElementHealth(Veh) ~= 100 then return end
end
setVehicleDamageProof(Veh, false)
)
------------
-- Client
addEventHandler('onClientGUIClick',root,
function ()
if source == GUIEditor.checkbox[1] and guiCheckBoxGetSelected (GUIEditor.checkbox[1]) == true then
triggerServerEvent('nitro',localPlayer)
elseif source == GUIEditor.checkbox[1] and guiCheckBoxGetSelected (GUIEditor.checkbox[1]) == false then
triggerServerEvent('StopNitro',localPlayer)
end
end
)
addEvent('nitro',true)
addEventHandler('nitro',root,
function ( )
local Veh = getPedOccupiedVehicle ( source )
addVehicleUpgrade(Veh,1010)
end )
addEvent"StopNitro",true)
addEventHandler('StopNitro',root,
function ()
local Veh = getPedOccupiedVehicle ( source )
if not addVehicleUpgrade(Veh,1010) then return end
removeVehicleUpgrade(Veh,1010)
end
)
-- Client
addEventHandler('onClientGUIClick',root,
function ()
if (source == GUIEditor.button[3]) then
triggerServerEvent("FixCar", localPlayer)
end
end
)
--Server
-- Server
addEvent('FixCar',true)
addEventHandler( 'FixCar', root,
function ( )
if isPedInVehicle ( source ) then
local Veh = getPedOccupiedVehicle ( source )
fixVehicle(Veh)
outputChatBox('[RentSystem]: تم اصلاح سيارتك بنجاح ', source ,0,255,0,true )
else
outputChatBox('[RentSystem]: لايوجد سيارة لاصلاحها ', source ,0,255,0,true )
end
end
)
addEventHandler("onClientGUIClick", root,function()
if source == GUIEditor.checkbox[2] and guiCheckBoxGetSelected (GUIEditor.checkbox[2]) == true then
triggerServerEvent('StartRandomColor',localPlayer)
elseif source == GUIEditor.checkbox[2] and guiCheckBoxGetSelected (GUIEditor.checkbox[2]) == false then
triggerServerEvent('StopRandomColor',localPlayer)
addEvent("StartRandomColor",true)
addEventHandler('StartRandomColor', root,function( )
local vehicle = getPedOccupiedVehicle(source)
Timer[player] = setTimer(function( pla )
setVehicleColor(vehicle, math.random(0,255), math.random(0,255), math.random(0,255) )
end, 100,100 ,player)
outputChatBox('[RentSystem]: لقد تم تشغيل الأوان العشوائية بنجاح ', source)
end)
addEvent("StopRandomColor",true)
addEventHandler('StopRandomColor',root,
function ()
if isTimer( Timer) then return killTimer(Timer) end
end
)
---------------------------------
-- Client
addEventHandler('onClientGUIClick',root,
function ()
if source == GUIEditor.checkbox[3] and guiCheckBoxGetSelected(GUIEditor.checkbox[3]) == true then
triggerServerEvent('Create',localPlayer)
elseif source == GUIEditor.checkbox[3] and guiCheckBoxGetSelected(GUIEditor.checkbox[3]) == false then
triggerServerEvent('Destroy',localPlayer)
end
end
)
--server
Object = { }
addEvent('Create',true)
addEventHandler('Create',root,
function ( )
outputChatBox('[RentSystem]: لقد تم اظهار السهم بنجاح ', source ,0 , 255, 0 , true )
local Interior , Dimension , xPosition, yPosition, zPosition = getElementInterior( source ) , getElementDimension( source) , getElementPosition( source )
Object[source] = createObject(1318,xPosition, yPosition + 10 , zPosition )
setElementInterior( Object[source] , Interior )
setElementDimension( Object[source] , Dimension )
end )
addEvent('Delete',true)
addEventHandler('Delete',root,
function ( )
if ( isElement( Object[source] ) ) then
outputChatBox("[RentSystem]: تم اخفاء السهم بنجاح", source, 255, 0, 0, true)
destroyElement( Object[source] )
end
end )