SaedAmer Posted April 27, 2016 Share Posted April 27, 2016 ايه الخطاء هنا setTimer(function() guiSetProperty( GUIEditor.checkbox[1], "NormalTextColour", math.random(0,255), math.random(0,255), math.random(0,255)) end, 50, 0) --------------------------------------------------------------------------------------- هنا الكلام يتكرر في الشات كلنت --#Client addEventHandler("onClientGUIClick", root, function() if source == GUIEditor.checkbox[2] and guiCheckBoxGetSelected( GUIEditor.checkbox[2]) == true then Timer = setTimer(function() triggerServerEvent("VehicleColor", localPlayer) end, 500, 0) elseif source == GUIEditor.checkbox[2] and guiCheckBoxGetSelected( GUIEditor.checkbox[2]) == false then killTimer(Timer) end end) سيرفر --#Server addEvent("VehicleColor", true) addEventHandler("VehicleColor", root, function() if not isPedInVehicle(source) then outputChatBox("[RentSystem]: يجب ان تكون في السيارة اولا", source, 255, 0, 0, true) else local vehicle = getPedOccupiedVehicle(source) outputChatBox('[RentSystem]: لقد تم تشغيل الأوان العشوائية بنجاح ', source ,0,255,0,true ) setVehicleColor(vehicle, math.random(0,255), math.random(0,255), math.random(0,255)) end end ) ---------------------------------------------------------------------------------------------------- هنا السهم ما يظهر -- Client addEventHandler('onClientGUIClick',root, function () if source == GUIEditor.checkbox[3] and guiComboBoxGetSelected(GUIEditor.checkbox[3]) == true then triggerServerEvent('Create',localPlayer) elseif source == GUIEditor.checkbox[3] and guiComboBoxGetSelected(GUIEditor.checkbox[3]) == false then triggerServerEvent('Destroy',localPlayer) end end ) سيرفر addEvent('Create',true) addEvent('Delete',true) Object = { } addEventHandler('Create',root, function ( thePlayer ) outputChatBox('[RentSystem]: لقد تم اظهار السهم بنجاح ', thePlayer ,0 , 255, 0 , true ) local Interior , Dimension , xPosition, yPosition, zPosition = getElementInterior( thePlayer ) , getElementDimension( thePlayer) , getElementPosition( thePlayer ) Object[thePlayer] = createObject(1318,xPosition, yPosition + 10 , zPosition ) setElementInterior( Object[thePlayer] , Interior ) setElementDimension( Object[thePlayer] , Dimension ) end ) addEventHandler('Delete',root, function ( thePlayer ) if ( isElement( Object[thePlayer] ) ) then outputChatBox("[RentSystem]: تم اخفاء السهم بنجاح", thePlayer, 255, 0, 0, true) destroyElement( Object[thePlayer] ) end end ) Link to comment
Abdul KariM Posted April 27, 2016 Share Posted April 27, 2016 بالسيرفر سايد thePlayer ماهي معرفة source استبدلها بـ Link to comment
#Soking Posted April 27, 2016 Share Posted April 27, 2016 addEvent('Create',true) addEvent('Delete',true) Object = { } addEventHandler('Create',root, function ( source ) 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 ) addEventHandler('Delete',root, function ( source ) if ( isElement( Object[source] ) ) then outputChatBox("[RentSystem]: تم اخفاء السهم بنجاح", source, 255, 0, 0, true) destroyElement( Object[source] ) end end ) --#Server addEvent("VehicleColor", true) addEventHandler("VehicleColor", root, function ( ) if not ( isPedInVehicle(source) ) then local vehicle = getPedOccupiedVehicle(source) outputChatBox('[RentSystem]: لقد تم تشغيل الأوان العشوائية بنجاح ', source ,0,255,0,true ) setVehicleColor(vehicle, math.random(0,255), math.random(0,255), math.random(0,255)) else outputChatBox("[RentSystem]: يجب ان تكون في السيارة اولا", source, 255, 0, 0, true) end end ) --#Client addEventHandler("onClientGUIClick", root, function() if ( source == GUIEditor.checkbox[2] ) and ( guiCheckBoxGetSelected( GUIEditor.checkbox[2]) == true ) then Timer = setTimer(function( ) triggerServerEvent("VehicleColor", localPlayer) end, 500, 0) elseif ( source == GUIEditor.checkbox[2] ) and ( guiCheckBoxGetSelected( GUIEditor.checkbox[2]) == false ) then if isTimer(Timer) then killTimer(Timer) end end end ) setTimer(function() guiSetProperty(GUIEditor.checkbox[1], "NormalTextColour", string.format("%.2X%.2X%.2X%.2X", 255, math.random(255), math.random(255), math.random(255))) end, 50, 0) , جرب ض2 Link to comment
#|_oskar_|# Posted April 27, 2016 Share Posted April 27, 2016 --#Client function triggerServerEvent_() triggerServerEvent("VehicleColor", localPlayer,r,g,b) r,g,b = math.random(0,255), math.random(0,255), math.random(0,255) end -- addEventHandler("onClientGUIClick", root,function() if guiCheckBoxGetSelected (GUIEditor.checkbox[2]) == true then if not isPedInVehicle(localPlayer) then return outputChatBox("[RentSystem]: يجب ان تكون في السيارة اولا",255, 0, 0, true) end Timer = setTimer (triggerServerEvent_,500,0) outputChatBox('[RentSystem]: لقد تم تشغيل الأوان العشوائية بنجاح ', 0,255,0,true ) elseif guiCheckBoxGetSelected (GUIEditor.checkbox[2]) == false then if isTimer (Timer) then killTimer (Timer) end end end) --#Server addEvent("VehicleColor", true) addEventHandler("VehicleColor", root,function(r,g,b) local vehicle = getPedOccupiedVehicle(source) setVehicleColor(vehicle, r,g,b) end) Link to comment
SaedAmer Posted April 28, 2016 Author Share Posted April 28, 2016 تمام كلو اشتغل ما عدا السهم addEvent('Create',true) addEvent('Delete',true) Object = { } addEventHandler('Create',root, function ( source ) 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 ) addEventHandler('Delete',root, function ( source ) if ( isElement( Object[source] ) ) then outputChatBox("[RentSystem]: تم اخفاء السهم بنجاح", source, 255, 0, 0, true) destroyElement( Object[source] ) end end ) -- Client addEventHandler('onClientGUIClick',root, function () if source == GUIEditor.checkbox[3] and guiComboBoxGetSelected(GUIEditor.checkbox[3]) == true then triggerServerEvent('Create',localPlayer) elseif source == GUIEditor.checkbox[3] and guiComboBoxGetSelected(GUIEditor.checkbox[3]) == false then triggerServerEvent('Destroy',localPlayer) end end ) Link to comment
#Soking Posted April 28, 2016 Share Posted April 28, 2016 addEvent('Create',true) addEvent('Delete',true) Object = { } 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 ) addEventHandler('Delete',root, function ( ) if ( isElement( Object[source] ) ) then outputChatBox("[RentSystem]: تم اخفاء السهم بنجاح", source, 255, 0, 0, true) destroyElement( Object[source] ) end end ) Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now