Ja[B]er[X]Pro Posted April 27, 2016 Share Posted April 27, 2016 السلام عليكم ورحمة الله وبركاته معي وظيفة راعي غنم عدلت %80 من الوظيفة لكن اجتني مشكلة عندما اضغط على زر دخول الوظيفة يجيني خطأ بالترايقر والمشكلة انا ما عدلت اكواد زر الدخول والترايقر الاكواد addEventHandler("onClientGUIClick",root, function () if source == GUIEditor.button[1] then local skin = guiGridListGetItemText( GUIEditor.gridlist[1],guiGridListGetSelectedItem(GUIEditor.gridlist[1]),2) if skin ~= "" then guiSetVisible(GUIEditor.window[1],false) showCursor(false) triggerServerEvent("shep",localPlayer,skin) --- start end elseif source == GUIEditor.button[2] then guiSetVisible(GUIEditor.window[1],false) showCursor(false) end end) addEvent("shep",true) addEventHandler("shep",root, function (skin) setElementModel(client,tonumber(skin)) setElementData(source,'Job','ShepJob') ---- 'Job' setElementData ( client,'Job','ShepJob' ) end ) Link to comment
[iMr]-W[i]Fi,.! Posted April 27, 2016 Share Posted April 27, 2016 سطر الخامس في الكلينت احذفه وضيف ما بين السطر الثالث والرابع ذذ تحقق if guiGridListGetSelectedItem(GUIEditor.gridlist[1]) ~= -1 then --- وسطر الرابع في السيرفر بدل الكلينت ب سورس واحذف السطر ال6 Link to comment
Ja[B]er[X]Pro Posted April 27, 2016 Author Share Posted April 27, 2016 دي بق ERROR: : Client (Jaer[X]Pro) triggered serverside event shep, but event is not added severside Link to comment
Ja[B]er[X]Pro Posted April 27, 2016 Author Share Posted April 27, 2016 سطر الخامس في الكلينت احذفه وضيف ما بين السطر الثالث والرابع ذذ تحقق if guiGridListGetSelectedItem(GUIEditor.gridlist[1]) ~= -1 then --- وسطر الرابع في السيرفر بدل الكلينت ب سورس واحذف السطر ال6 ما تغيير شيئ والدي بق نفسه Link to comment
[iMr]-W[i]Fi,.! Posted April 27, 2016 Share Posted April 27, 2016 جابر لاتعدل في كودك شيء بس بدل اللوكال بلاير ب root النتيجة addEventHandler("onClientGUIClick",root, function () if source == GUIEditor.button[1] then local skin = guiGridListGetItemText( GUIEditor.gridlist[1],guiGridListGetSelectedItem(GUIEditor.gridlist[1]),2) if skin ~= "" then guiSetVisible(GUIEditor.window[1],false) showCursor(false) triggerServerEvent("shep",root,skin) --- start end elseif source == GUIEditor.button[2] then guiSetVisible(GUIEditor.window[1],false) showCursor(false) end end) Link to comment
Ja[B]er[X]Pro Posted April 27, 2016 Author Share Posted April 27, 2016 جابر لاتعدل في كودك شيء بس بدل اللوكال بلاير ب root النتيجة addEventHandler("onClientGUIClick",root, function () if source == GUIEditor.button[1] then local skin = guiGridListGetItemText( GUIEditor.gridlist[1],guiGridListGetSelectedItem(GUIEditor.gridlist[1]),2) if skin ~= "" then guiSetVisible(GUIEditor.window[1],false) showCursor(false) triggerServerEvent("shep",root,skin) --- start end elseif source == GUIEditor.button[2] then guiSetVisible(GUIEditor.window[1],false) showCursor(false) end end) ما تغيير شيئ Link to comment
#Soking Posted April 27, 2016 Share Posted April 27, 2016 --Client Side function SetPanelShow( Panel , True , False ) guiSetVisible(Panel,True) showCursor(False) end addEventHandler("onClientGUIClick",root, function ( ) if ( source == GUIEditor.button[1] ) then if ( Skin ~= "" ) then local Skin = guiGridListGetItemText( GUIEditor.gridlist[1],guiGridListGetSelectedItem(GUIEditor.gridlist[1]),2) SetPanelShow( GUIEditor.window[1] , false , false ) triggerServerEvent("Shep",localPlayer,Skin) end elseif ( source == GUIEditor.button[2] ) then SetPanelShow( GUIEditor.window[1] , false , false ) end end ) -- Server Side addEvent("Shep",true) addEventHandler("Shep",root, function ( Skin ) setElementModel(client,tonumber(Skin) ) setElementData ( client,'Job','ShepJob' ) end ) Link to comment
Ja[B]er[X]Pro Posted April 28, 2016 Author Share Posted April 28, 2016 حتى الان المشكلة ما تغيرت المشكلة اجت يوم ضفت الكود دا addCommandHandler("meat",function() if getElementHealth(source) =< 50 then setElementHealth(source,getElementHealth(source) + 50) setElementData(source,"meat",getElementData(source,"meat") - 1 ) else outputChatBox("Your Health is > 50",source,255,0,0) end end) Link to comment
#Soking Posted April 28, 2016 Share Posted April 28, 2016 addCommandHandler("meat", function( ) if ( getElementHealth(source) <= 50 ) then setElementHealth(source,getElementHealth(source) + 50) setElementData(source,"meat",getElementData(source,"meat") - 1 ) else outputChatBox("Your Health is > 50",source,255,0,0,true) end end ) ضض Link to comment
Ja[B]er[X]Pro Posted April 28, 2016 Author Share Posted April 28, 2016 addCommandHandler("meat", function( ) if ( getElementHealth(source) <= 50 ) then setElementHealth(source,getElementHealth(source) + 50) setElementData(source,"meat",getElementData(source,"meat") - 1 ) else outputChatBox("Your Health is > 50",source,255,0,0,true) end end ) ضض شكراً لك لكن ما شوف غيرت شيئ غير ,true Link to comment
#Soking Posted April 28, 2016 Share Posted April 28, 2016 if ( getElementHealth(source) <= 50 ) then Link to comment
Ja[B]er[X]Pro Posted April 28, 2016 Author Share Posted April 28, 2016 if ( getElementHealth(source) <= 50 ) then اها شكرأً عند كتابة الكلمة باف8 يجي خطأ بالكود دا الدي بق ERROR: Shep/Server.lua:26: attempt to compare boolean with number سطر 26 = سطر هذا الكود Link to comment
[iMr]-W[i]Fi,.! Posted April 28, 2016 Share Posted April 28, 2016 مافي سطر 26 اطرح سطر 26 Link to comment
Ja[B]er[X]Pro Posted April 28, 2016 Author Share Posted April 28, 2016 مافي سطر 26 اطرح سطر 26 if ( getElementHealth(source) <= 50 ) then Link to comment
#Soking Posted April 28, 2016 Share Posted April 28, 2016 if ( getElementHealth(source) < 51) then Link to comment
Ja[B]er[X]Pro Posted April 28, 2016 Author Share Posted April 28, 2016 ضفت هذا التحقق if getElementData(source,"meat") >= 1 then صار يجيني خطأ بالسطر الخاص به وجربته بالحالات دي ايضاً if getElementData(source,"meat") > 0 then if getElementData(source,"meat") > 0 or getElementData(source,"meat") == 0 then Link to comment
iMr.WiFi..! Posted April 28, 2016 Share Posted April 28, 2016 جرب if getElementData(source,"meat") ~= 0 then Link to comment
#Soking Posted April 28, 2016 Share Posted April 28, 2016 متاكد انه معاك الداتا حقت meat Link to comment
Ja[B]er[X]Pro Posted April 28, 2016 Author Share Posted April 28, 2016 متاكد انه معاك الداتا حقت meat يب Link to comment
#Soking Posted April 28, 2016 Share Posted April 28, 2016 if ( getElementData(source,"meat") > 0 ) and ( getElementData(source,"meat") < 2 ) then Link to comment
Ja[B]er[X]Pro Posted April 28, 2016 Author Share Posted April 28, 2016 WARNING: Sheep/server.lua:26: Bad argument @ 'getElementData' [Expected element at argument 1, got nil] ERROR: Shep/Server.lua:26: attempt to compare boolean with number if getElementData(source,"meat") >= 1 then Link to comment
Jupi Posted April 28, 2016 Share Posted April 28, 2016 WARNING: Sheep/server.lua:26: Bad argument @ 'getElementData' [Expected element at argument 1, got nil]ERROR: Shep/Server.lua:26: attempt to compare boolean with number if getElementData(source,"meat") >= 1 then وريني كودك كامل مشان اعرف تعريف السورس Link to comment
Ja[B]er[X]Pro Posted April 28, 2016 Author Share Posted April 28, 2016 addCommandHandler("meat", function( ) if getElementData(source,"meat") >= 1 then if ( getElementHealth(source) < 49 ) then setElementHealth(source,getElementHealth(source) + 50) setElementData(source,"meat",getElementData(source,"meat") - 1 ) outputChatBox("You Was get Health",source,0,255,0,true) else outputChatBox("Your Health is > 50",source,255,0,0,true) end 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