كلنت
addEventHandler("onClientGUIClick", resourceRoot, function( )
if source == shm then
triggerServerEvent("onAddArrowPlayerSpecialCar", localPlayer)
guiSetVisible(carbild, false)
showCursor(false)
elseif source == clour then
triggerServerEvent("onRandomColorPlayerSpecialCar", localPlayer)
guiSetVisible(carbild, false)
showCursor(false)
end
end)
سيرفر
addEvent("onRandomColorPlayerSpecialCar", true)
addEventHandler("onRandomColorPlayerSpecialCar", root, function( )
if isElement(vehicle[source]) then
if isTimer(timer[source]) then
killTimer(timer[source])
else
timer[source] = setTimer(function(plr)
setVehicleColor(vehicle[plr], math.random(255), math.random(255), math.random(255))
end, 1000, 0, source)
end
else
outputChatBox("not Found Car", source, math.random(0,255),math.random(0,255),math.random(0,255))
end
end)
addEvent("onAddArrowPlayerSpecialCar", true)
addEventHandler("onAddArrowPlayerSpecialCar", root, function( )
if isElement(vehicle[source]) then
if isElement(Arrow[source]) then
destroyElement(Arrow[source])
else
Arrow[source] = createObject(1318, 0, 0, 0)
attachElements(Arrow[source], vehicle[source], 0, 0, 1.5)
end
else
outputChatBox("not Found Car", source, math.random(0,255),math.random(0,255),math.random(0,255))
end
end)