w7sH Posted May 8, 2017 Posted May 8, 2017 السلام عليكم .. أبي كود اذا اللاعب ضغط على شيك بوكس يحمي شخصيته من كل شي طلقات الرصاص القتل واللخ..
Ahmed Ly Posted May 8, 2017 Posted May 8, 2017 setElementData getElementData "onClientPlayerDamage" cancelEvent "onClientGUIClick" guiCheckBoxSetSelected guiCheckBoxGetSelected
w7sH Posted May 8, 2017 Author Posted May 8, 2017 لا أبي تفصيل .. كأن الواحد يطركم أعوذ بالله .. المقصد من أبي مثال يعني أطرح لي كيف تسوي عدم التأثير على الشخصية على أقدر أحطها ع اكثر من مود ##
iMr.WiFi..! Posted May 9, 2017 Posted May 9, 2017 addEventHandler ( 'onClientGUIClick', mycheck, ..... ( ) if guiCheckBoxGetSelected ( mycheck) == true .... triggerServerEvent ( 'Ex', localPlayer,true ) elseif guiCheckBoxGetSelected ( mycheck) == false .... triggerServerEvent ( 'Ex', localPlayer,false ) end end ) --- Server addEvent ( 'Ex', true ) addEventHandler ( 'Ex', root, function ( bool ) if getElementData ( source, "root" ) == bool .... setElementData(source,"root",not bool) end setElementData(source,"root",true) end ) addEventHandler ( 'onPlayerDamage',.......,...... ( ) if getElementData ( source,'root' ) == .... then cancelEvent ( ) end end ) ^ في فراغات في المثال انت كملهم وخلاص تسوي المود Experienced MTA developer for 4 years. | MTA خبرة 4 سنين في برمجة ليس عليك اسعاد الجميع , ولكن عليك بإن لا تؤذي أحداً =========You do not have to make everyone happy, But you should not hurt anyone Want to contact with me? Discord: JustCarry#2616 (Always there)Skype: Live:JustCarry10 (Not always)
#STZ Posted May 9, 2017 Posted May 9, 2017 (edited) addEventHandler ( 'onClientGUIClick', mycheck,root ( ) if guiCheckBoxGetSelected ( mycheck) == true then triggerServerEvent ( 'Ex', localPlayer,true ) elseif guiCheckBoxGetSelected ( mycheck) == false then triggerServerEvent ( 'Ex', localPlayer,false ) end end ) --- Server addEvent ( 'Ex', true ) addEventHandler ( 'Ex', root, function () if getElementData ( source, "root" ) == NoDmg setElementData(source,"root",NoDmg) end setElementData(source,"root",true) end ) addEventHandler ( 'onPlayerDamage',root ( ) if getElementData ( source,'root' ) == NoDmg then cancelEvent ( ) end end ) Edited May 9, 2017 by MR.NaiF-MTA
' A F . Posted May 9, 2017 Posted May 9, 2017 onPlayerDamage ماتقدر تسوي له cancelEvent 'onClientPlayerDamage' Dis ; AF.#0941
#DRAGON!FIRE Posted May 9, 2017 Posted May 9, 2017 كل الاكواد اللي فوق غلط ! addEventHandler ( "onClientGUIClick", resourceRoot, function ( ) if ( source == checkbox ) then local checkBox_state = guiCheckBoxGetSelected ( source ) setElementData ( source, "damgeState", checkBox_state ) end end ) addEventHandler ( "onClientPlayerDamage", localPlayer, function ( ) if ( getElementData ( localPlayer, "damgeState" ) ) then cancelEvent ( ) end end ) To Contact Me at Skype : [email protected]
' A F . Posted May 9, 2017 Posted May 9, 2017 (edited) سطر 4 انت حاط الداتا على الزر موب على اللاعب .. شكلك مسوية مستعجل @#ZA7F //= Edited May 9, 2017 by Default 1 Dis ; AF.#0941
#DRAGON!FIRE Posted May 9, 2017 Posted May 9, 2017 @Default ايوهـ يعطيك العافية ع التنبيه التعديل : addEventHandler ( "onClientGUIClick", resourceRoot, function ( ) if ( source == checkbox ) then local checkBox_state = guiCheckBoxGetSelected ( source ) setElementData ( localPlayer, "damgeState", checkBox_state ) end end ) addEventHandler ( "onClientPlayerDamage", localPlayer, function ( ) if ( getElementData ( localPlayer, "damgeState" ) ) then cancelEvent ( ) end end ) 1 To Contact Me at Skype : [email protected]
#Soking Posted May 9, 2017 Posted May 9, 2017 5 hours ago, #ZA7F //= said: @Default ايوهـ يعطيك العافية ع التنبيه التعديل : addEventHandler ( "onClientGUIClick", resourceRoot, function ( ) if ( source == checkbox ) then local checkBox_state = guiCheckBoxGetSelected ( source ) setElementData ( localPlayer, "damgeState", checkBox_state ) end end ) addEventHandler ( "onClientPlayerDamage", localPlayer, function ( ) if ( getElementData ( localPlayer, "damgeState" ) ) then cancelEvent ( ) end end ) ممكن تسوى متغير و خلاص ض
#BrosS Posted May 9, 2017 Posted May 9, 2017 56 minutes ago, #Soking said: ممكن تسوى متغير و خلاص ض داتا أحسن “من أراد الفشل عليه بالنجاح”
#BrosS Posted May 10, 2017 Posted May 10, 2017 1 hour ago, #Soking said: ليه ماعليك يا عشاق المتغيرات aValue يلا سوي اهئ “من أراد الفشل عليه بالنجاح”
#Soking Posted May 10, 2017 Posted May 10, 2017 15 minutes ago, #BrosS said: ماعليك يا عشاق المتغيرات aValue يلا سوي اهئ يا حبي اأداتا تستهلك المتغير افضل
#DRAGON!FIRE Posted May 10, 2017 Posted May 10, 2017 اذا استخدمتها بكثرهـ راح تستهلك بكثرهـ او اذا استخدمتها بطريقة خطأ !!! واذا ع المتغير اتوقع يقدر يسويها بنفسه مو صعبة .. ما يحتاج تكبرو الموضوع وهو بسيط 1 To Contact Me at Skype : [email protected]
#Soking Posted May 10, 2017 Posted May 10, 2017 22 minutes ago, #ZA7F //= said: اذا استخدمتها بكثرهـ راح تستهلك بكثرهـ او اذا استخدمتها بطريقة خطأ !!! واذا ع المتغير اتوقع يقدر يسويها بنفسه مو صعبة .. ما يحتاج تكبرو الموضوع وهو بسيط لا انا احاول اخلى الاجابه تدقيقه و أقل استهلاك عموما حياك الله ض 1
w7sH Posted May 14, 2017 Author Posted May 14, 2017 On ٩/٥/٢٠١٧ at 18:35, #ZA7F //= said: @Default ايوهـ يعطيك العافية ع التنبيه التعديل : addEventHandler ( "onClientGUIClick", resourceRoot, function ( ) if ( source == checkbox ) then local checkBox_state = guiCheckBoxGetSelected ( source ) setElementData ( localPlayer, "damgeState", checkBox_state ) end end ) addEventHandler ( "onClientPlayerDamage", localPlayer, function ( ) if ( getElementData ( localPlayer, "damgeState" ) ) then cancelEvent ( ) end end ) يعطيك الف عافية, لكن أقدر احلي اللاعب اذا ضغط على الشيك بوكس وطلع ودخل يكون على نفس حالة مضغوط
Master_MTA Posted May 15, 2017 Posted May 15, 2017 7 hours ago, w7sH said: يعطيك الف عافية, لكن أقدر احلي اللاعب اذا ضغط على الشيك بوكس وطلع ودخل يكون على نفس حالة مضغوط accountdata or sql Skype : 01100001 01101100 01101001 01011111 01101101 01110100 00110001 00111001 00111001 00111001 every thing is gonna be alright every thing is gonna be okay it's gonna be a good good life that's what my therapist say
#DRAGON!FIRE Posted May 15, 2017 Posted May 15, 2017 (edited) Client : addEventHandler ( "onClientGUIClick", resourceRoot, function ( ) if ( source == checkbox ) then local checkBox_state = guiCheckBoxGetSelected ( source ) setElementData ( localPlayer, "damgeState", checkBox_state ) triggerServerEvent ( "saveNewState", localPlayer, checkBox_state ) end end ) addEventHandler ( "onClientPlayerDamage", localPlayer, function ( ) if ( getElementData ( localPlayer, "damgeState" ) ) then cancelEvent ( ) end end ) addEvent ( "setCheckBox", true ) addEventHandler ( "setCheckBox", root, function ( nState ) stateToValue = nState == "on" and true or false guiCheckBoxSetSelected ( YourCheckBox, stateToValue ) end ) Server : addEventHandler ( "onResourceStart", resourceRoot, function ( ) executeSQLQuery ( "CREATE TABLE IF NOT EXISTS statusSQL ( serial, state )" ) for k,v in ipairs ( getElementsByType "player" ) do stRow = executeSQLQuery ( "SELECT * FROM statusSQL WHERE serial=?", getPlayerSerial ( v ) ) if stRow and #stRow > 0 then stToValue = stRow[1].state == "on" and true or false setElementData ( v, "damgeState", stToValue ) triggerClientEvent ( v, "setCheckBox", v, stRow[1].state ) end end end ) addEventHandler ( "onPlayerJoin", root, function ( ) local sRow = executeSQLQuery ( "SELECT * FROM statusSQL WHERE serial=?", getPlayerSerial ( source ) ) if sRow and #sRow > 0 then stateToValue = sRow[1].state == "on" and true or false setElementData ( source, "damgeState", stateToValue ) triggerClientEvent ( source, "setCheckBox", source, sRow[1].state ) end end ) addEvent ( "saveNewState", true ) addEventHandler ( "saveNewState", root, function ( nState ) local stateString = nState == true and "on" or "off" local sRow = executeSQLQuery ( "SELECT * FROM statusSQL WHERE serial=?", getPlayerSerial ( source ) ) if sRow and #sRow > 0 then executeSQLQuery ( "UPDATE statusSQL SET state=? WHERE serial=?", stateString, getPlayerSerial ( source ) ) else executeSQLQuery ( "INSERT INTO statusSQL ( serial, state ) VALUES ( ?,? )", getPlayerSerial ( source ), stateString ) end end ) Edited May 15, 2017 by #ZA7F //= 1 To Contact Me at Skype : [email protected]
#BrosS Posted May 15, 2017 Posted May 15, 2017 @#ZA7F //= يا محب أفعال الخير ض 1 “من أراد الفشل عليه بالنجاح”
#DRAGON!FIRE Posted May 15, 2017 Posted May 15, 2017 @#BrosS حبيبي ولله ض 1 To Contact Me at Skype : [email protected]
w7sH Posted May 15, 2017 Author Posted May 15, 2017 6 hours ago, #ZA7F //= said: Client : addEventHandler ( "onClientGUIClick", resourceRoot, function ( ) if ( source == checkbox ) then local checkBox_state = guiCheckBoxGetSelected ( source ) setElementData ( localPlayer, "damgeState", checkBox_state ) triggerServerEvent ( "saveNewState", localPlayer, checkBox_state ) end end ) addEventHandler ( "onClientPlayerDamage", localPlayer, function ( ) if ( getElementData ( localPlayer, "damgeState" ) ) then cancelEvent ( ) end end ) addEvent ( "setCheckBox", true ) addEventHandler ( "setCheckBox", root, function ( nState ) stateToValue = nState == "on" and true or false guiCheckBoxSetSelected ( YourCheckBox, stateToValue ) end ) Server : addEventHandler ( "onResourceStart", resourceRoot, function ( ) executeSQLQuery ( "CREATE TABLE IF NOT EXISTS statusSQL ( serial, state )" ) for k,v in ipairs ( getElementsByType "player" ) do stRow = executeSQLQuery ( "SELECT * FROM statusSQL WHERE serial=?", getPlayerSerial ( v ) ) if stRow and #stRow > 0 then stToValue = stRow[1].state == "on" and true or false setElementData ( v, "damgeState", stToValue ) triggerClientEvent ( v, "setCheckBox", v, stRow[1].state ) end end end ) addEventHandler ( "onPlayerJoin", root, function ( ) local sRow = executeSQLQuery ( "SELECT * FROM statusSQL WHERE serial=?", getPlayerSerial ( source ) ) if sRow and #sRow > 0 then stateToValue = sRow[1].state == "on" and true or false setElementData ( source, "damgeState", stateToValue ) triggerClientEvent ( source, "setCheckBox", source, sRow[1].state ) end end ) addEvent ( "saveNewState", true ) addEventHandler ( "saveNewState", root, function ( nState ) local stateString = nState == true and "on" or "off" local sRow = executeSQLQuery ( "SELECT * FROM statusSQL WHERE serial=?", getPlayerSerial ( source ) ) if sRow and #sRow > 0 then executeSQLQuery ( "UPDATE statusSQL SET state=? WHERE serial=?", stateString, getPlayerSerial ( source ) ) else executeSQLQuery ( "INSERT INTO statusSQL ( serial, state ) VALUES ( ?,? )", getPlayerSerial ( source ), stateString ) end end ) يعطيك العافية على مساعدتك لكن الكود ما اشتغل معي
#DRAGON!FIRE Posted May 15, 2017 Posted May 15, 2017 100% جربته وشغال استبدلت اسماء الشيك بوكس ؟ .. شوف الديبوق To Contact Me at Skype : [email protected]
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