EH10 Posted December 29, 2013 Share Posted December 29, 2013 السلام عليكم ابي فنكشات رقم السياره وتضغط زر اختيار وتجيك السياره وماحد يقدر يركبها غيرك انت Edit تكتب في Link to comment
The Killer Posted December 29, 2013 Share Posted December 29, 2013 Event # 'onClientGUIClick' function # guiCreateEdit tonumber guiGetText triggerServerEvent getPlayerSerial createVehicle warpPedIntoVehicle outputChatBox Link to comment
EH10 Posted December 29, 2013 Author Share Posted December 29, 2013 اذا ممكن تسوي لي فنكش tonumber صعب علي اول مره يمر علي Link to comment
The Killer Posted December 29, 2013 Share Posted December 29, 2013 (edited) tonumber = يخليه بس ارقام يعني ما تقدر تكتب غير ارقام توضيح اكثر ادخل هنا http://www.lua.org/manual/5.1/manual.html#pdf-tonumber Edited December 29, 2013 by Guest Link to comment
EH10 Posted December 29, 2013 Author Share Posted December 29, 2013 tonumber = يخليه بس ارقام يعني ما تقدر تكتب غير ارقام بس ماعرف الكود اسوية مممكن تسوية Link to comment
The Killer Posted December 29, 2013 Share Posted December 29, 2013 راح اعطيك مثال بسيط جدا عليه if (tonumber(guiGetText(اسم الا يديت)) == nil) then guiSetText(اسم الايديت, "") Link to comment
EH10 Posted December 29, 2013 Author Share Posted December 29, 2013 الكود صح او خطى صححلي ok = guiCreateButton( 0, 0, 0, 0, "ok", true ) Edits = guiCreateEdit( 0, 0, 0, 0, "", true ) if (tonumber(guiGetText(Edits)) == nil) then guiSetText(Edits, "") addEventHandler("onClientGUIClick", root, function () if ( source == ok ) then triggerServerEvent("Car", localPlayer) outputChatBox ( "......", source, 255, 255, 255, true ) end end ) addEvent("Car", true) addEventHandler("Car", root, function () if getPlayerSerial ( source ) == "My Serial" then veh = createVehicle ( id, x, y, z ) warpPedIntoVehicle ( source, veh ) end ) Link to comment
The Killer Posted December 29, 2013 Share Posted December 29, 2013 ok = guiCreateButton( 0, 0, 0, 0, "ok", true ) Edits = guiCreateEdit( 0, 0, 0, 0, "", true ) addEventHandler("onClientGUIClick", root, function () if ( source == ok ) then if (tonumber(guiGetText(Edits)) == nil) then guiSetText(Edits, "") return end triggerServerEvent("Car", localPlayer, guiGetText(Edits)) end end ) addEvent("Car", true) addEventHandler("Car", root, function (id) veh = createVehicle ( id, x, y, z ) warpPedIntoVehicle ( source, veh ) end ) addEventHandler("onVehicleStartEnter", veh, function (player) if getPlayerSerial ( player ) == "My Serial" then outputChatBox("Welome Sir", player, 255, 255, 0) else cancelEvent () outputChatBox("This not your car this is اسمك's car", player, 255, 0, 0) end end ) Link to comment
EH10 Posted December 29, 2013 Author Share Posted December 29, 2013 شكرا لك يااحلى عضو Link to comment
EH10 Posted December 29, 2013 Author Share Posted December 29, 2013 حياك الله في مشكلة لما احط الكود مايشتغل الوحة ولما اشيل الكود تشتغل الوحة الكود # wnd = guiCreateWindow(237,154,382,294,"",false) Edits = guiCreateEdit(116,54,120,36,"",false,wnd) ok = guiCreateButton(105,114,148,31,"",false,wnd) function sw() if guiGetVisible ( wnd ) then guiSetVisible ( wnd, false ) showCursor(false) guiSetInputEnabled(false) else guiSetVisible ( wnd, true ) showCursor(true) guiSetInputEnabled(true) end end bindKey("F2", "down", sw) addEventHandler("onClientGUIClick", root, function () if ( source == ok ) then if (tonumber(guiGetText(Edits)) == nil) then guiSetText(Edits, "") return end triggerServerEvent("Car", localPlayer, guiGetText(Edits)) end end ) Link to comment
#DRAGON!FIRE Posted December 29, 2013 Share Posted December 29, 2013 # ججرب wnd = guiCreateWindow(237,154,382,294,"",false) Edits = guiCreateEdit(116,54,120,36,"",false,wnd) ok = guiCreateButton(105,114,148,31,"",false,wnd) guiSetVisible(wnd, false) bindKey("F2","Down",function() if ( guiGetVisible(wnd) == true ) then guiSetVisible(wnd, false); showCursor( false ); guiSetInputEnabled( false ); else guiSetVisible(wnd, true); showCursor( true ); guiSetInputEnabled( true ); end end) addEventHandler("onClientGUIClick", root, function ( ) if ( source == ok ) then local ZA7F = guiGetText( Edits ) if ( ZA7F and string.len( ZA7F ) == 3 ) then if ( ZA7F and tonumber ( ZA7F ) ) then triggerServerEvent("Car", localPlayer, guiGetText(Edits)) end end end end ) Link to comment
EH10 Posted December 29, 2013 Author Share Posted December 29, 2013 # ججرب wnd = guiCreateWindow(237,154,382,294,"",false) Edits = guiCreateEdit(116,54,120,36,"",false,wnd) ok = guiCreateButton(105,114,148,31,"",false,wnd) guiSetVisible(wnd, false) bindKey("F2","Down",function() if ( guiGetVisible(wnd) == true ) then guiSetVisible(wnd, false); showCursor( false ); guiSetInputEnabled( false ); else guiSetVisible(wnd, true); showCursor( true ); guiSetInputEnabled( true ); end end) addEventHandler("onClientGUIClick", root, function ( ) if ( source == ok ) then local ZA7F = guiGetText( Edits ) if ( ZA7F and string.len( ZA7F ) == 3 ) then if ( ZA7F and tonumber ( ZA7F ) ) then triggerServerEvent("Car", localPlayer, guiGetText(Edits)) end end end end ) الوحة تفتح وكل شي بس لما اكتب بالايديت رقم السياره واضغط الزر ماتجي السياره الاكواد # Client Side wnd = guiCreateWindow(237,154,382,294,"",false) Edits = guiCreateEdit(116,54,120,36,"",false,wnd) ok = guiCreateButton(105,114,148,31,"",false,wnd) guiSetVisible(wnd, false) bindKey("F2","Down",function() if ( guiGetVisible(wnd) == true ) then guiSetVisible(wnd, false); showCursor( false ); guiSetInputEnabled( false ); else guiSetVisible(wnd, true); showCursor( true ); guiSetInputEnabled( true ); end end) addEventHandler("onClientGUIClick", root, function ( ) if ( source == ok ) then local ZA7F = guiGetText( Edits ) if ( ZA7F and string.len( ZA7F ) == 3 ) then if ( ZA7F and tonumber ( ZA7F ) ) then triggerServerEvent("Car", localPlayer, guiGetText(Edits)) end end end end ) # Server Side addEvent("Car", true) addEventHandler("Car", root, function (id) veh = createVehicle ( id, x, y, z ) warpPedIntoVehicle ( source, veh ) end ) addEventHandler("onVehicleStartEnter", veh, function (player) if getPlayerSerial ( player ) == ">>>>>>>>>>>>>" then outputChatBox("Welome Sir", player, 255, 255, 0) else cancelEvent () outputChatBox("This not your car this is اسمك's car", player, 255, 0, 0) end end ) Link to comment
MR.S3D Posted December 29, 2013 Share Posted December 29, 2013 # Client Side wnd = guiCreateWindow(237,154,382,294,"",false) Edits = guiCreateEdit(116,54,120,36,"",false,wnd) ok = guiCreateButton(105,114,148,31,"",false,wnd) guiSetVisible(wnd, false) bindKey("F2","Down",function() local vis = not guiGetVisible(wnd) guiSetVisible(wnd, vis); showCursor( vis ); guiSetInputEnabled( vis ); end ) addEventHandler("onClientGUIClick", root, function ( ) if ( source == ok ) then local ZA7F = guiGetText( Edits ) if ( ZA7F and string.len( ZA7F ) == 3 and tonumber( ZA7F) ) then triggerServerEvent("Car", localPlayer, tonumber ( ZA7F )) end end end ) # Server Side addEvent("Car", true) addEventHandler("Car", root, function () local x,y,z= getElementPosition(source) veh = createVehicle ( id, x, y, z ) warpPedIntoVehicle ( source, veh ) end ) addEventHandler("onVehicleStartEnter", resourceRoot, function (player) if getPlayerSerial ( player ) == "سيريالك" then outputChatBox("Welome Sir", player, 255, 255, 0) else cancelEvent () outputChatBox("This not your car this is اسمك's car", player, 255, 0, 0) end end ) Link to comment
EH10 Posted December 29, 2013 Author Share Posted December 29, 2013 # Client Side wnd = guiCreateWindow(237,154,382,294,"",false) Edits = guiCreateEdit(116,54,120,36,"",false,wnd) ok = guiCreateButton(105,114,148,31,"",false,wnd) guiSetVisible(wnd, false) bindKey("F2","Down",function() local vis = not guiGetVisible(wnd) guiSetVisible(wnd, vis); showCursor( vis ); guiSetInputEnabled( vis ); end ) addEventHandler("onClientGUIClick", root, function ( ) if ( source == ok ) then local ZA7F = guiGetText( Edits ) if ( ZA7F and string.len( ZA7F ) == 3 and tonumber( ZA7F) ) then triggerServerEvent("Car", localPlayer, tonumber ( ZA7F )) end end end ) # Server Side addEvent("Car", true) addEventHandler("Car", root, function () local x,y,z= getElementPosition(source) veh = createVehicle ( id, x, y, z ) warpPedIntoVehicle ( source, veh ) end ) addEventHandler("onVehicleStartEnter", resourceRoot, function (player) if getPlayerSerial ( player ) == "سيريالك" then outputChatBox("Welome Sir", player, 255, 255, 0) else cancelEvent () outputChatBox("This not your car this is اسمك's car", player, 255, 0, 0) end end ) الوحة ماتفتح Link to comment
The Killer Posted December 30, 2013 Share Posted December 30, 2013 جرب wnd = guiCreateWindow(237,154,382,294,"",false) Edits = guiCreateEdit(116,54,120,36,"",false,wnd) ok = guiCreateButton(105,114,148,31,"",false,wnd) guiSetVisible(wnd, false) bindKey ( "F2" , "down" , function() guiSetVisible(wnd,not guiGetVisible(wnd)) showCursor(not isCursorShowing()) end ) addEventHandler("onClientGUIClick", root, function ( ) if ( source == ok ) then local ZA7F = guiGetText( Edits ) if ( ZA7F and string.len( ZA7F ) == 3 and tonumber( ZA7F) ) then triggerServerEvent("Car", localPlayer, tonumber ( ZA7F )) end end end ) # Server Side addEvent("Car", true) addEventHandler("Car", root, function (id) local x,y,z= getElementPosition(source) veh = createVehicle ( id, x, y, z ) warpPedIntoVehicle ( source, veh ) end ) addEventHandler("onVehicleStartEnter", resourceRoot, function (player) if getPlayerSerial ( player ) == "سيريالك" then outputChatBox("Welcome Sir", player, 255, 255, 0) else cancelEvent () outputChatBox("This not your car this is اسمك's car", player, 255, 0, 0) end end ) Link to comment
EH10 Posted December 30, 2013 Author Share Posted December 30, 2013 جرب wnd = guiCreateWindow(237,154,382,294,"",false) Edits = guiCreateEdit(116,54,120,36,"",false,wnd) ok = guiCreateButton(105,114,148,31,"",false,wnd) guiSetVisible(wnd, false) bindKey ( "F2" , "down" , function() guiSetVisible(wnd,not guiGetVisible(wnd)) showCursor(not isCursorShowing()) end ) addEventHandler("onClientGUIClick", root, function ( ) if ( source == ok ) then local ZA7F = guiGetText( Edits ) if ( ZA7F and string.len( ZA7F ) == 3 and tonumber( ZA7F) ) then triggerServerEvent("Car", localPlayer, tonumber ( ZA7F )) end end end ) # Server Side addEvent("Car", true) addEventHandler("Car", root, function (id) local x,y,z= getElementPosition(source) veh = createVehicle ( id, x, y, z ) warpPedIntoVehicle ( source, veh ) end ) addEventHandler("onVehicleStartEnter", resourceRoot, function (player) if getPlayerSerial ( player ) == "سيريالك" then outputChatBox("Welcome Sir", player, 255, 255, 0) else cancelEvent () outputChatBox("This not your car this is اسمك's car", player, 255, 0, 0) end end ) ماشتغلت الوحة Link to comment
#DRAGON!FIRE Posted December 30, 2013 Share Posted December 30, 2013 # ججرب , لو ما اشتغل المشكلة من عندك ... Client Side ! wnd = guiCreateWindow(237,154,382,294,"",false) Edits = guiCreateEdit(116,54,120,36,"",false,wnd) ok = guiCreateButton(105,114,148,31,"",false,wnd) guiSetVisible(wnd, false) bindKey ( "F2", "down", function( ) guiSetVisible(wnd, not guiGetVisible( wnd )); showCursor( guiGetVisible( wnd ) ); end ) addEventHandler("onClientGUIClick", root, function ( ) if ( source == ok ) then local ZA7F = guiGetText( Edits ) if ( ZA7F and string.len( ZA7F ) == 3 and tonumber( ZA7F ) ) then triggerServerEvent("Car", localPlayer, tonumber ( ZA7F )) end end end ) Server Side ! addEvent("Car", true) addEventHandler("Car", root, function (id) local x, y, z = getElementPosition(source) vehicle = createVehicle ( id, x+ 3, y, z ) if vehicle then warpPedIntoVehicle ( source, vehicle ) end end ) addEventHandler("onVehicleStartEnter", vehicle, function ( player ) if getPlayerSerial ( player ) == "سيريالك" then outputChatBox("Welome Sir", player, 255, 255, 0) else cancelEvent () outputChatBox("This not your car this is اسمك's car", player, 255, 0, 0) end end ) Link to comment
EH10 Posted December 30, 2013 Author Share Posted December 30, 2013 # ججرب , لو ما اشتغل المشكلة من عندك ...Client Side ! wnd = guiCreateWindow(237,154,382,294,"",false) Edits = guiCreateEdit(116,54,120,36,"",false,wnd) ok = guiCreateButton(105,114,148,31,"",false,wnd) guiSetVisible(wnd, false) bindKey ( "F2", "down", function( ) guiSetVisible(wnd, not guiGetVisible( wnd )); showCursor( guiGetVisible( wnd ) ); end ) addEventHandler("onClientGUIClick", root, function ( ) if ( source == ok ) then local ZA7F = guiGetText( Edits ) if ( ZA7F and string.len( ZA7F ) == 3 and tonumber( ZA7F ) ) then triggerServerEvent("Car", localPlayer, tonumber ( ZA7F )) end end end ) Server Side ! addEvent("Car", true) addEventHandler("Car", root, function (id) local x, y, z = getElementPosition(source) vehicle = createVehicle ( id, x+ 3, y, z ) if vehicle then warpPedIntoVehicle ( source, vehicle ) end end ) addEventHandler("onVehicleStartEnter", vehicle, function ( player ) if getPlayerSerial ( player ) == "سيريالك" then outputChatBox("Welome Sir", player, 255, 255, 0) else cancelEvent () outputChatBox("This not your car this is اسمك's car", player, 255, 0, 0) end end ) اشتغل وضبط بس انا ابي وابي اذا طلع سياره وبعدين طلع سياره ثانية تختفي السياره الاولى اسف اذا كثرت طلباتي Link to comment
MR.S3D Posted December 30, 2013 Share Posted December 30, 2013 Client Side ! wnd = guiCreateWindow(237,154,382,294,"",false) Edits = guiCreateEdit(116,54,120,36,"",false,wnd) ok = guiCreateButton(105,114,148,31,"",false,wnd) guiSetVisible(wnd, false) bindKey ( "F2", "down", function( ) local vis = not guiGetVisible( wnd ) guiSetVisible(wnd, vis); showCursor(vis); end ) addEventHandler("onClientGUIClick", root, function ( ) if ( source == ok ) then local ZA7F = guiGetText( Edits ) if ( ZA7F and string.len( ZA7F ) == 3 and tonumber( ZA7F ) ) then triggerServerEvent("Car", localPlayer, tonumber ( ZA7F )) end end end ) Server Side ! local vehicle = {} addEvent("Car", true) addEventHandler("Car", root, function (id) local x, y, z = getElementPosition(source) if vehicle[source] then if isElement( vehicle[source] ) then destroyElement(vehicle[source]) end vehicle[source] = nil end vehicle[source] = createVehicle ( id, x + 3, y, z ) if vehicle[source] then warpPedIntoVehicle ( source, vehicle[source] ) end end ) addEventHandler("onVehicleStartEnter", resourceRoot, function ( player ) if getPlayerSerial ( player ) == "سيريالك" then outputChatBox("Welome Sir", player, 255, 255, 0) else cancelEvent () outputChatBox("This not your car this is اسمك's car", player, 255, 0, 0) end end ) addEventHandler("onPlayerQuit",root,function() if vehicle[source] then if isElement( vehicle[source] ) then destroyElement(vehicle[source]) end vehicle[source] = nil end end) Link to comment
EH10 Posted December 30, 2013 Author Share Posted December 30, 2013 Client Side ! wnd = guiCreateWindow(237,154,382,294,"",false) Edits = guiCreateEdit(116,54,120,36,"",false,wnd) ok = guiCreateButton(105,114,148,31,"",false,wnd) guiSetVisible(wnd, false) bindKey ( "F2", "down", function( ) guiSetVisible(wnd, not guiGetVisible( wnd )); showCursor( guiGetVisible( wnd ) ); end ) addEventHandler("onClientGUIClick", root, function ( ) if ( source == ok ) then local ZA7F = guiGetText( Edits ) if ( ZA7F and string.len( ZA7F ) == 3 and tonumber( ZA7F ) ) then triggerServerEvent("Car", localPlayer, tonumber ( ZA7F )) end end end ) Server Side ! local vehicle = {} addEvent("Car", true) addEventHandler("Car", root, function (id) local x, y, z = getElementPosition(source) if vehicle[source] then if isElement( vehicle[source] ) then destroyElement(vehicle[source]) end vehicle[source] = nil end vehicle[source] = createVehicle ( id, x + 3, y, z ) if vehicle[source] then warpPedIntoVehicle ( source, vehicle[source] ) end end ) addEventHandler("onVehicleStartEnter", resourceRoot, function ( player ) if getPlayerSerial ( player ) == "سيريالك" then outputChatBox("Welome Sir", player, 255, 255, 0) else cancelEvent () outputChatBox("This not your car this is اسمك's car", player, 255, 0, 0) end end ) addEventHandler("onPlayerQuit",root,function() if vehicle[source] then if isElement( vehicle[source] ) then destroyElement(vehicle[source]) end vehicle[source] = nil end end) شكرا لك بس اذا ماتعبتك معي ابي شغلة اذا واحد خذ سياره تتسجل بسريالة وماحد يركبها غيره هو واي واحد يركبها يقول السياره ملك ويجي اسمة واذا ركب السياره ابو طيف يقول منور سيارتك ويجي اسمة Link to comment
MR.S3D Posted December 30, 2013 Share Posted December 30, 2013 #Server side! local vehicle = {} addEvent("Car", true) addEventHandler("Car", root, function (id) local x, y, z = getElementPosition(source) if vehicle[source] then if isElement( vehicle[source] ) then destroyElement(vehicle[source]) end vehicle[source] = nil end vehicle[source] = createVehicle ( id, x + 3, y, z ) if vehicle[source] then warpPedIntoVehicle ( source, vehicle[source] ) end setElementData(vehicle[source],'carData',{getPlayerSerial(source),getPlayerName(source)}) end ) addEventHandler("onVehicleStartEnter", resourceRoot, function ( player ) local serial = getElementData(source,'carData') if serial and serial[1] and serial[2] and getPlayerSerial ( player ) == serial[1] then outputChatBox(" منور سيارتك [".. serial[2] or '' ..']', player, math.random(0,255), math.random(0,255), math.random(0,255), true ) else cancelEvent () outputChatBox ( "* This not your car this is :[ " .. serial[2] or '' .. " ] s car", player, math.random(0,255), math.random(0,255), math.random(0,255), true ) end end ) addEventHandler("onPlayerQuit",root,function() if vehicle[source] then if isElement( vehicle[source] ) then destroyElement(vehicle[source]) end vehicle[source] = nil 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