Sparrow Posted February 20, 2012 Share Posted February 20, 2012 إنها لا تدمر مركبة function destroyVeh() local theVehicle = getPedOccupiedVehicle (localPlayer) if (theVehicle) then destroyElement (theVehicle) outputChatBox("Your vehicle has been destroyed.", 0, 255, 0) guiSetVisible(window, false) showCursor(false) else outputChatBox("You aren't in a vehicle.", 255, 0, 0) guiSetVisible(window, false) showCursor(false) end end addEventHandler("onClientGUIClick", destroyButton, destroyVeh, false) Link to comment
JR10 Posted February 20, 2012 Share Posted February 20, 2012 هل الرسالة تظهر؟ ؟/debugscript 3 أى رسائل فى Link to comment
Micro Posted February 20, 2012 Share Posted February 20, 2012 تاكد من اسم زر الدي يدمر سيارة Link to comment
Sparrow Posted February 20, 2012 Author Share Posted February 20, 2012 لا رسائل في /debugscript 3 Link to comment
JR10 Posted February 20, 2012 Share Posted February 20, 2012 تظهر؟ "Your vehicle has been destroyed." هل الرسالة Link to comment
Sparrow Posted February 21, 2012 Author Share Posted February 21, 2012 نعم, تظهر الرسالة Link to comment
JR10 Posted February 21, 2012 Share Posted February 21, 2012 Server: addEvent("destroyVehicle",true) addEventHandler("destroyVehicle",root,function(vehicle) destroyElement(vehicle) end) Client: function destroyVeh() local theVehicle = getPedOccupiedVehicle (localPlayer) if (theVehicle) then triggerServerEvent("destroyVehicle",localPlayer,theVehicle) outputChatBox("Your vehicle has been destroyed.", 0, 255, 0) guiSetVisible(window, false) showCursor(false) else outputChatBox("You aren't in a vehicle.", 255, 0, 0) guiSetVisible(window, false) showCursor(false) end end addEventHandler("onClientGUIClick", destroyButton, destroyVeh, false) Link to comment
xTeacherx Posted February 21, 2012 Share Posted February 21, 2012 Server ccc addEvent("buyBommcar", true) addEventHandler("buyBommcar", rootElement, function() if ( getPlayerMoney (source) >= 2000000 ) then takePlayerMoney(source, 2000000) outputChatBox("All cars Is Boom", source, 255, 255, 0, true) vehicles = getElementsByType ( "vehicle" ) for vehicleKey, vehicleValue in ipairs(vehicles) do blowVehicle ( vehicleValue ) end else outputChatBox("Not enough money.", source, 255, 0, 0, true) end end ) Link to comment
Sparrow Posted February 22, 2012 Author Share Posted February 22, 2012 شكرا JR10. كيف أضع فقط يستطيع اللاعب أن يقوم بإنتاج سيارة واحدة, و إذا كانت له سيارة نضيع الأولى و ينتج أخرى Link to comment
TAPL Posted February 22, 2012 Share Posted February 22, 2012 شكرا JR10.كيف أضع فقط يستطيع اللاعب أن يقوم بإنتاج سيارة واحدة, و إذا كانت له سيارة نضيع الأولى و ينتج أخرى Solidsnake14 الكود لـ --Server side viewtopic.php?f=91&t=40571#p411826 Link to comment
Sparrow Posted February 22, 2012 Author Share Posted February 22, 2012 إنها لا تعمل local vehicles = {} function spawnVeh(model) local x, y, z = getElementPosition(source) local rot = getPedRotation(source) local theVehicle = createVehicle (model, x, y, z, 0, 0, rot) if isElement(vehicles[source]) then destroyElement(vehicles[source]) end warpPedIntoVehicle(source,theVehicle) end addEvent("onGUIClick",true) addEventHandler("onGUIClick",root,spawnVeh) Link to comment
TAPL Posted February 23, 2012 Share Posted February 23, 2012 local vehicles = {} function spawnVeh(model) local x, y, z = getElementPosition(source) local rot = getPedRotation(source) if isElement(vehicles[source]) then destroyElement(vehicles[source]) end local vehicles[source] = createVehicle (model, x, y, z, 0, 0, rot) warpPedIntoVehicle(source,vehicles[source]) end addEvent("onGUIClick",true) addEventHandler("onGUIClick",root,spawnVeh) addEventHandler("onPlayerQuit",root, function() if isElement(vehicles[source]) then destroyElement(vehicles[source]) vehicles[source] = nil end end) Link to comment
Sparrow Posted February 23, 2012 Author Share Posted February 23, 2012 server.lua:6: unexpected symbol near '[' Link to comment
TAPL Posted February 23, 2012 Share Posted February 23, 2012 ~_~ local vehicles = {} function spawnVeh(model) local x, y, z = getElementPosition(source) local rot = getPedRotation(source) if isElement(vehicles[source]) then destroyElement(vehicles[source]) end vehicles[source] = createVehicle (model, x, y, z, 0, 0, rot) warpPedIntoVehicle(source,vehicles[source]) end addEvent("onGUIClick",true) addEventHandler("onGUIClick",root,spawnVeh) addEventHandler("onPlayerQuit",root, function() if isElement(vehicles[source]) then destroyElement(vehicles[source]) vehicles[source] = nil end end) Link to comment
Sparrow Posted February 24, 2012 Author Share Posted February 24, 2012 (thanks/merci/شكرا) 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