z24d Posted August 10, 2015 Share Posted August 10, 2015 السلام عليكم ابغا شرح يعني مثلاً انا سويت ايدت تمام ؟ طيب انا ابغا اذا ضغط الزر يشوف اذا هي ارقام او حروف اذا حروف يطلع كلام بالشات Link to comment
iMr.SFA7 Posted August 10, 2015 Share Posted August 10, 2015 + "onClientGUIClick" outputChatBox Link to comment
z24d Posted August 10, 2015 Author Share Posted August 10, 2015 string.find ممكن تشرحلياه ؟ Link to comment
; Mr.T76eM # Posted August 10, 2015 Share Posted August 10, 2015 string.find يعني اذا وجد سترنق "" بالشيء الي تبيه مثال local text = guiGetText(edit) if string.fine(text,"الكلام الي تبيه") then يعني اذا وجد هذا السترنق في الاديت حقك يتحقق الشرط وتكمل كودكـ Link to comment
z24d Posted August 10, 2015 Author Share Posted August 10, 2015 (edited) كلينت addEventHandler("onClientResourceStart", resourceRoot, function() wnd = guiCreateWindow(294, 202, 475, 393, "", false) guiWindowSetSizable(wnd, false) btn = guiCreateButton(65, 245, 350, 93, "Get a Car", false, wnd) guiSetProperty(btn, "NormalTextColour", "FFAAAAAA") edt = guiCreateEdit(164, 127, 131, 54, "", false, wnd) end ) addEventHandler ( "onClientGUIClick", resourceRoot, function () if ( source == btn ) then local veha = guiGetText(edt) if string.find(veha,"master") then outputChatBox('Wrong',255,255,0) triggerServerEvent( "GiveCar", localPlayer, veha ) end end ) -- server side local Vehicle = { }; addEvent ( "GiveCar", true ) addEventHandler ( "GiveCar", root, veha function ( ) if ( isElement ( Vehicle[source] ) ) then destroyElement ( Vehicle[source] ) else local x, y, z = getElementPosition ( source ) Vehicle[source] = createVehicle ( veha, x, y, z ) addVehicleUpgrade ( Vehicle[source], 1074 ) addVehicleUpgrade ( Vehicle[source], 1087 ) addVehicleUpgrade ( Vehicle[source], 1010 ) setPedArmor(source, 100) attachElements ( Marker,Vehicle[source] , 0, 0, 2 ) outputChatBox("Welcome To The Car", source, 255, 0, 0) setPlayerMoney(source, 5000) createBlipAttachedTo ( source, 55 ) warpPedIntoVehicle ( source, Vehicle[source] ) end end ) addEventHandler ( "onVehicleExplode", resourceRoot, function ( ) if ( isElement ( Vehicle[source] ) ) then destroyElement ( Vehicle[source] ) Vehicle[source] = nil end end ) addEventHandler ( "onPlayerQuit", resourceRoot, function ( ) if ( isElement ( Vehicle[source] ) ) then destroyElement ( Vehicle[source] ) Vehicle[source] = nil end end ) wheres the wrong thing ? Edited August 10, 2015 by Guest Link to comment
iMr.SFA7 Posted August 10, 2015 Share Posted August 10, 2015 string.find يعني اذا وجد سترنق "" بالشيء الي تبيه مثال local text = guiGetText(edit) if string.fine(text,"الكلام الي تبيه") then يعني اذا وجد هذا السترنق في الاديت حقك يتحقق الشرط وتكمل كودكـ local text = guiGetText(edit) if string.find(text,"الكلام الي تبيه") then addEventHandler("onClientResourceStart", resourceRoot, function() wnd = guiCreateWindow(294, 202, 475, 393, "", false) guiWindowSetSizable(wnd, false) btn = guiCreateButton(65, 245, 350, 93, "Get a Car", false, wnd) guiSetProperty(btn, "NormalTextColour", "FFAAAAAA") edt = guiCreateEdit(164, 127, 131, 54, "", false, wnd) end ) addEventHandler ( "onClientGUIClick", resourceRoot, function () if ( source == btn ) then local veha = guiGetText(edt) triggerServerEvent( "GiveCar", localPlayer, veha ) end end ) -- server side local Vehicle = { }; addEvent ( "GiveCar", true ) addEventHandler ( "GiveCar", root, function ( veha ) if ( isElement ( Vehicle[source] ) ) then destroyElement ( Vehicle[source] ) else local x, y, z = getElementPosition ( source ) Vehicle[source] = createVehicle ( veha, x, y, z ) addVehicleUpgrade ( Vehicle[source], 1074 ) addVehicleUpgrade ( Vehicle[source], 1087 ) addVehicleUpgrade ( Vehicle[source], 1010 ) setPedArmor(source, 100) attachElements ( Marker,Vehicle[source] , 0, 0, 2 ) outputChatBox("Welcome To The Car", source, 255, 0, 0) setPlayerMoney(source, 5000) createBlipAttachedTo ( source, 55 ) warpPedIntoVehicle ( source, Vehicle[source] ) end end ) addEventHandler ( "onVehicleExplode", resourceRoot, function ( ) if ( isElement ( Vehicle[source] ) ) then destroyElement ( Vehicle[source] ) Vehicle[source] = nil end end ) addEventHandler ( "onPlayerQuit", resourceRoot, function ( ) if ( isElement ( Vehicle[source] ) ) then destroyElement ( Vehicle[source] ) Vehicle[source] = nil end end ) Link to comment
z24d Posted August 10, 2015 Author Share Posted August 10, 2015 string.find يعني اذا وجد سترنق "" بالشيء الي تبيه مثال local text = guiGetText(edit) if string.fine(text,"الكلام الي تبيه") then يعني اذا وجد هذا السترنق في الاديت حقك يتحقق الشرط وتكمل كودكـ local text = guiGetText(edit) if string.find(text,"الكلام الي تبيه") then addEventHandler("onClientResourceStart", resourceRoot, function() wnd = guiCreateWindow(294, 202, 475, 393, "", false) guiWindowSetSizable(wnd, false) btn = guiCreateButton(65, 245, 350, 93, "Get a Car", false, wnd) guiSetProperty(btn, "NormalTextColour", "FFAAAAAA") edt = guiCreateEdit(164, 127, 131, 54, "", false, wnd) end ) addEventHandler ( "onClientGUIClick", resourceRoot, function () if ( source == btn ) then local veha = guiGetText(edt) triggerServerEvent( "GiveCar", localPlayer, veha ) end end ) -- server side local Vehicle = { }; addEvent ( "GiveCar", true ) addEventHandler ( "GiveCar", root, function ( veha ) if ( isElement ( Vehicle[source] ) ) then destroyElement ( Vehicle[source] ) else local x, y, z = getElementPosition ( source ) Vehicle[source] = createVehicle ( veha, x, y, z ) addVehicleUpgrade ( Vehicle[source], 1074 ) addVehicleUpgrade ( Vehicle[source], 1087 ) addVehicleUpgrade ( Vehicle[source], 1010 ) setPedArmor(source, 100) attachElements ( Marker,Vehicle[source] , 0, 0, 2 ) outputChatBox("Welcome To The Car", source, 255, 0, 0) setPlayerMoney(source, 5000) createBlipAttachedTo ( source, 55 ) warpPedIntoVehicle ( source, Vehicle[source] ) end end ) addEventHandler ( "onVehicleExplode", resourceRoot, function ( ) if ( isElement ( Vehicle[source] ) ) then destroyElement ( Vehicle[source] ) Vehicle[source] = nil end end ) addEventHandler ( "onPlayerQuit", resourceRoot, function ( ) if ( isElement ( Vehicle[source] ) ) then destroyElement ( Vehicle[source] ) Vehicle[source] = nil end end ) مايشتغل Link to comment
z24d Posted August 10, 2015 Author Share Posted August 10, 2015 Debugscript say ERROR: Client (##00FFFFMaster) triggered serverside event GiveCar, but event is not added server side Link to comment
; Mr.T76eM # Posted August 10, 2015 Share Posted August 10, 2015 اعمل ريستارت للمود واطرح وش يقول لك الديبق يوم تعمل ريستارت لأن عندكـ خطأ في ملف السيرفر الي مخليه ما يشتغل كما يجب Link to comment
z24d Posted August 10, 2015 Author Share Posted August 10, 2015 اعمل ريستارت للمود واطرح وش يقول لك الديبق يوم تعمل ريستارتلأن عندكـ خطأ في ملف السيرفر الي مخليه ما يشتغل كما يجب حليت المشكلة لكن اذا كتبت master بالايديت وضغطت الزر مايسوي شيء ! Link to comment
iMr.SFA7 Posted August 10, 2015 Share Posted August 10, 2015 انت ما حطيت انه يجيب الايدي من اسم السيارة getVehicleIDFromName Link to comment
z24d Posted August 10, 2015 Author Share Posted August 10, 2015 انت ما حطيت انه يجيب الايدي من اسم السيارة; getVehicleIDFromName طيب حليت المشكلة لكن هنا وش المشكلة حطيت كم كلمة بجدول ولا نفع addEventHandler("onClientResourceStart", resourceRoot, function() wnd = guiCreateWindow(294, 202, 475, 393, "", false) guiWindowSetSizable(wnd, false) btn = guiCreateButton(65, 245, 350, 93, "Get a Car", false, wnd) guiSetProperty(btn, "NormalTextColour", "FFAAAAAA") edt = guiCreateEdit(164, 127, 131, 54, "", false, wnd) end ) Table = { 432,"master","monster","faster",412 } addEventHandler ( "onClientGUIClick", resourceRoot, function () if ( source == btn ) then local veha = guiGetText(edt) triggerServerEvent( "GiveCar", localPlayer, veha ) for _,i in ipairs ( Table ) do if string.find(veha,Table) then return outputChatBox("Wrong",255,255,0) end end end end ) Link to comment
iMr.SFA7 Posted August 10, 2015 Share Posted August 10, 2015 الجدول خطأ حط المفتاح هو اسم السيارة والقيمة هي الايدي واستعمل باللوب pairs Link to comment
z24d Posted August 10, 2015 Author Share Posted August 10, 2015 الجدول خطأحط المفتاح هو اسم السيارة والقيمة هي الايدي واستعمل باللوب pairs [f] addEventHandler("onClientResourceStart", resourceRoot, function() wnd = guiCreateWindow(294, 202, 475, 393, "", false) guiWindowSetSizable(wnd, false) btn = guiCreateButton(65, 245, 350, 93, "Get a Car", false, wnd) guiSetProperty(btn, "NormalTextColour", "FFAAAAAA") edt = guiCreateEdit(164, 127, 131, 54, "", false, wnd) end ) Table = { "master","monster","faster" } addEventHandler ( "onClientGUIClick", resourceRoot, function () if ( source == btn ) then local veha = guiGetText(edt) triggerServerEvent( "GiveCar", localPlayer, veha ) for _,i in pairs ( Table ) do if string.find(veha,Table) then return outputChatBox("Wrong",255,255,0) end end end end ) [/f] Link to comment
iMr.SFA7 Posted August 10, 2015 Share Posted August 10, 2015 لول حاط اللوب والتحقق قبل الترايقر حطهم قبل الترايقر وأسم السيارات اكتبها زين مثلا انت حاط monster وهي بالاصل Monster https://wiki.multitheftauto.com/wiki/Vehicle_IDs Link to comment
z24d Posted August 10, 2015 Author Share Posted August 10, 2015 لول حاط اللوب والتحقق قبل الترايقر حطهم قبل الترايقر وأسم السيارات اكتبها زين مثلا انت حاط monster وهي بالاصل Monster https://wiki.multitheftauto.com/wiki/Vehicle_IDs لآلالا فهمت غلط انت انا ابي اذا حط الكلمات بالادت بوكس وضغط زر يشوف اذا كانت 432 او ماستر او مونستر او فاستر يعني كلها اشياء اتعلم فيها البرمجه شويء شوي فهمت ؟ Link to comment
iMr.SFA7 Posted August 10, 2015 Share Posted August 10, 2015 اها اذا كذا بس حبيت اقولك فيه فرق بين الكابيتال والسمول بالفنكشات واسماء المواتر monster -- خطأ Monster -- صحيح GeT -- خطأ get -- صحيح Set -- خطأ set -- صحيح Link to comment
z24d Posted August 10, 2015 Author Share Posted August 10, 2015 اها اذا كذابس حبيت اقولك فيه فرق بين الكابيتال والسمول بالفنكشات واسماء المواتر monster -- خطأ Monster -- صحيح GeT -- خطأ get -- صحيح Set -- خطأ set -- صحيح تسلم هذي من الي ماعرفها طيب اسمع وش الخطأ بالله : ( Link to comment
iMr.SFA7 Posted August 10, 2015 Share Posted August 10, 2015 أطرح الكلنت والسيرفر بعد ما صححت الاخطاء الي قلتها Link to comment
z24d Posted August 10, 2015 Author Share Posted August 10, 2015 أطرح الكلنت والسيرفر بعد ما صححت الاخطاء الي قلتها addEventHandler("onClientResourceStart", resourceRoot, function() wnd = guiCreateWindow(294, 202, 475, 393, "", false) guiWindowSetSizable(wnd, false) btn = guiCreateButton(65, 245, 350, 93, "Get a Car", false, wnd) guiSetProperty(btn, "NormalTextColour", "FFAAAAAA") edt = guiCreateEdit(164, 127, 131, 54, "", false, wnd) end ) Table = { "master","monster","faster" } addEventHandler ( "onClientGUIClick", resourceRoot, function () if ( source == btn ) then local veha = guiGetText(edt) triggerServerEvent( "GiveCar", localPlayer, veha ) for _,i in pairs ( Table ) do if string.find(veha,Table) then return outputChatBox("Wrong",255,255,0) end end end end ) -- Server side ~# local Vehicle = { }; addEvent ( "GiveCar", true ) addEventHandler ( "GiveCar", root, function ( veha ) if ( isElement ( Vehicle[source] ) ) then destroyElement ( Vehicle[source] ) else local x, y, z = getElementPosition ( source ) Vehicle[source] = createVehicle ( veha, x, y, z ) addVehicleUpgrade ( Vehicle[source], 1074 ) addVehicleUpgrade ( Vehicle[source], 1087 ) addVehicleUpgrade ( Vehicle[source], 1010 ) setPedArmor(source, 100) attachElements ( Marker,Vehicle[source] , 0, 0, 2 ) outputChatBox("Welcome To The Car", source, 255, 0, 0) setPlayerMoney(source, 5000) createBlipAttachedTo ( source, 55 ) warpPedIntoVehicle ( source, Vehicle[source] ) end end ) addEventHandler ( "onVehicleExplode", resourceRoot, function ( ) if ( isElement ( Vehicle[source] ) ) then destroyElement ( Vehicle[source] ) Vehicle[source] = nil end end ) addEventHandler ( "onPlayerQuit", resourceRoot, function ( ) if ( isElement ( Vehicle[source] ) ) then destroyElement ( Vehicle[source] ) Vehicle[source] = nil end end ) Link to comment
iMr.SFA7 Posted August 10, 2015 Share Posted August 10, 2015 طيب تبيه يعطي اللاعب السيارة بس صحيح ؟ والا وش الحوسة الي بملف السيرفر يعطيه درع ومدري وش Link to comment
z24d Posted August 10, 2015 Author Share Posted August 10, 2015 طيب تبيه يعطي اللاعب السيارة بس صحيح ؟والا وش الحوسة الي بملف السيرفر يعطيه درع ومدري وش لا معليك منها ذي انا مزودها من راسي لكن ابغاك تحددلي اخطاأي عشان معاد اسويها Link to comment
iMr.SFA7 Posted August 10, 2015 Share Posted August 10, 2015 لم يتم التجربة # -- Client side addEventHandler("onClientResourceStart", resourceRoot, function() wnd = guiCreateWindow(294, 202, 475, 393, "", false) guiWindowSetSizable(wnd, false) btn = guiCreateButton(65, 245, 350, 93, "Get a Car", false, wnd) guiSetProperty(btn, "NormalTextColour", "FFAAAAAA") edt = guiCreateEdit(164, 127, 131, 54, "", false, wnd) end ) addEventHandler ( "onClientGUIClick", root, function () if ( source == btn ) then local veha = guiGetText(edt) triggerServerEvent( "GiveCar", localPlayer, veha ) end end ) -- Server side addEvent ( "GiveCar", true ) addEventHandler ( "GiveCar", root, function ( veha ) local ID = getVehicleModelFromName ( veha ) if isElement ( Vehicle[source] ) then destroyElement ( Vehicle[source] ) else local x, y, z = getElementPosition ( source ) Vehicle[source] = createVehicle ( ID, x, y, z ) addVehicleUpgrade ( Vehicle[source], 1074 ) addVehicleUpgrade ( Vehicle[source], 1087 ) addVehicleUpgrade ( Vehicle[source], 1010 ) attachElements ( Marker,Vehicle[source] , 0, 0, 2 ) outputChatBox("Welcome To The Car", source, 255, 0, 0) warpPedIntoVehicle ( source, Vehicle[source] ) end end ) addEventHandler ( "onVehicleExplode", resourceRoot, function ( ) if ( isElement ( Vehicle[source] ) ) then destroyElement ( Vehicle[source] ) Vehicle[source] = nil end end ) addEventHandler ( "onPlayerQuit", resourceRoot, function ( ) if ( isElement ( Vehicle[source] ) ) then destroyElement ( Vehicle[source] ) Vehicle[source] = nil end end ) Link to comment
z24d Posted August 11, 2015 Author Share Posted August 11, 2015 لا ماأقصد كذا انا ابي مثلا Table = { {"الكلمة الي مأبيها بالادت"} {"الكلمة الثانية ^"} } فهمت كيف يعني ابيك تشرحلي اخطائي 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