Jump to content

AHMED MOSTAFA

Members
  • Posts

    1,367
  • Joined

  • Last visited

  • Days Won

    27

Everything posted by AHMED MOSTAFA

  1. انا فقط اجرب لأن خبرتي في السكل مرة مرة ضعيفة سويت مثال و شغال تمام db = dbConnect("sqlite", "killerProject.db") dbExec(db, "CREATE TABLE IF NOT EXISTS MYSQLTable ( playerName, playerMoney )") function E1 ( player, _, playerName ) if playerName and getPlayerFromName ( playerName ) then dbExec(db, "INSERT INTO MYSQLTable VALUES ( ?, ? )", getPlayerName ( getPlayerFromName ( playerName ) ), getPlayerMoney ( getPlayerFromName ( playerName ) ) ) dbExec(db, "UPDATE MYSQLTable SET playerName=?,playerMoney=? WHERE playerName=?", getPlayerName ( getPlayerFromName ( playerName ) ), getPlayerMoney ( getPlayerFromName ( playerName ) ), playerName ) playSoundFrontEnd(player, 43) result = dbPoll(dbQuery( db, "SELECT * FROM MYSQLTable WHERE playerName = ?", playerName ) , -1 ) if #result > 0 then outputChatBox ( "* Player Name: "..result[1]["playerName"].." Player Money: "..result[1]["playerMoney"], player, 0, 255, 0 ) else outputChatBox ( "sql <playerName>", root, 0, 255, 0 ) end end end addCommandHandler ( "sql", E1 ) function E2 () name = getPlayerName ( source ) result = dbPoll(dbQuery( db, "SELECT * FROM MYSQLTable WHERE playerName = ?", name ) , -1 ) if #result > 0 then setPlayerName ( source, result[1]["playerName"] ) setPlayerMoney ( source, result[1]["playerMoney"] ) outputChatBox ( "* Player Name: "..result[1]["playerName"].." Player Money: "..result[1]["playerMoney"], source, 0, 255, 0 ) end end addEventHandler ( "onPlayerJoin", root, E2 ) لكن اللي انا عايز اعرفه دلوقتي كل مرة هكتب فيها الكومند و اسم اللاعب رح يضيف داتا جديدة في الدي بي صح ؟ dbExec(db, "INSERT INTO MYSQLTable VALUES ( ?, ? )", getPlayerName ( getPlayerFromName ( playerName ) ), getPlayerMoney ( getPlayerFromName ( playerName ) ) ) وهذه شغالة تمام لكن هل بسوي تحديث لكل الكولمنات اللي في الداتا دي بي ؟ dbExec(db, "UPDATE MYSQLTable SET playerName=?,playerMoney=? WHERE playerName=?", getPlayerName ( getPlayerFromName ( playerName ) ), getPlayerMoney ( getPlayerFromName ( playerName ) ), playerName ) وفيه شئ ابي افهمه آخر if #result > 0 then outputChatBox ( "* Player Name: "..result[1]["playerName"].." Player Money: "..result[1]["playerMoney"], player, 0, 255, 0 ) else outputChatBox ( "sql <playerName>", root, 0, 255, 0 ) end result -- ليه اكبر من الصفر ؟ result[1]["playerName"] -- وش فائدة رقم 1 ؟؟ وآسف على تعبك معي بروس
  2. outputChatBox ( "* Player Name: "..result[1]["playerName"].." Player Money: "..result[1]["playerMoney"], player, 0, 255, 0 ) attempt to index field '?' (a nil value)
  3. السلام عليكم ورحمة الله وبركاته function E1 ( player, _, playerName ) if playerName and getPlayerFromName ( playerName ) then db = dbConnect("sqlite", "killerProject.db") dbExec(db, "CREATE TABLE IF NOT EXISTS MYSQLTable ( playerName, playerMoney )") dbExec(db, "INSERT INTO MYSQLTable VALUES ( ?, ? )", getPlayerName (player), getPlayerMoney (player) ) playSoundFrontEnd(player, 43) for i, rTable in ipairs( dbPoll( dbQuery( db, "SELECT * FROM MYSQLTable WHERE playerName = ?", playerName ) , -1 ) ) do outputChatBox ( "* Player Name: "..rTable["playerName"].." Player Money: "..rTable["playerMoney"], player, 0, 255, 0 ) end else outputChatBox ( "sql <playerName>", root, 0, 255, 0 ) end end addCommandHandler ( "sql", E1 ) فين المشكل هنا ؟ مع العلم اني مب عارف اي شئ عن السكل لكن حاولت اجرب مب قادر استعمل التاج لأن الانترنت ضعيف الدي بق فارغ outputChatBox( "* Player Name: "..rTable["playerName"].." Player Money: "..rTable["playerMoney"], player, 0, 255, 0 ) -- ما تطلع في الشات ولا اي شئ يتفعل اذا كان داخل هذا اللوب for i, rTable in ipairs( dbPoll( dbQuery( db, "SELECT * FROM MYSQLTable WHERE playerName = ?", playerName ) , -1 ) ) do -- هنا end
  4. function onPlayerQuitWeaponSave() local playeraccount = getPlayerAccount(source) if (playeraccount) and not isGuestAccount(playeraccount) then if getElementData(source,"22") == false then local ca = 3 setAccountData(playeraccount, "cadd", ca) else if getElementData(source,"22") == true then local caa = 2 setAccountData(playeraccount, "cadd", caa) end end if getElementData(source,"24") == false then local da = 3 setAccountData ( playeraccount, "dadd", da ) else if getElementData(source,"24") == true then local daa = 2 setAccountData ( playeraccount, "dadd", daa ) end end if getElementData(source,"23") == false then local sila = 3 setAccountData ( playeraccount, "siladd", sila ) else if getElementData(source,"23") == true then local silaa = 2 setAccountData ( playeraccount, "siladd", silaa ) end end if getElementData(source,"25") == false then local sha = 3 setAccountData ( playeraccount, "shadd", sha ) else if getElementData(source,"25") == true then local shaa = 2 setAccountData ( playeraccount, "shadd", shaa ) end end if getElementData(source,"26") == false then local swa = 3 setAccountData ( playeraccount, "swadd", swa ) else if getElementData(source,"26") == true then local swaa = 2 setAccountData ( playeraccount, "swadd", swaa ) end end if getElementData(source,"27") == false then local spa = 3 setAccountData ( playeraccount, "spadd", spa ) else if getElementData(source,"27") == true then local spaa = 2 setAccountData ( playeraccount, "spadd", spaa ) end end if getElementData(source,"30") == false then local aka = 3 setAccountData ( playeraccount, "akadd", aka ) else if getElementData(source,"30") == true then local akaa = 2 setAccountData ( playeraccount, "akadd", akaa ) end end if getElementData(source,"31") == false then local ma = 3 setAccountData ( playeraccount, "madd", ma ) else if getElementData(source,"31") == true then local maa = 2 setAccountData ( playeraccount, "madd", maa ) end end if getElementData(source,"28") == false then local ua = 3 setAccountData ( playeraccount, "uadd", ua ) else if getElementData(source,"28") == true then local uaa = 2 setAccountData ( playeraccount, "uadd", uaa ) end end if getElementData(source,"32") == false then local ta = 3 setAccountData ( playeraccount, "tadd", ta ) else if getElementData(source,"32") == true then local taa = 2 setAccountData ( playeraccount, "tadd", taa ) end end if getElementData(source,"29") == false then local mpa = 3 setAccountData ( playeraccount, "mpadd", mpa ) else if getElementData(source,"29") == true then local mpaa = 2 setAccountData ( playeraccount, "mpadd", mpaa ) end end if getElementData(source,"33") == false then local ra = 3 setAccountData ( playeraccount, "radd", ra ) else if getElementData(source,"33") == true then local raa = 2 setAccountData ( playeraccount, "radd", raa ) end end if getElementData(source,"34") == false then local sna = 3 setAccountData ( playeraccount, "snadd", sna ) else if getElementData(source,"34") == true then local snaa = 2 setAccountData ( playeraccount, "snadd", snaa ) end end if getElementData(source,"38") == false then local mia = 3 setAccountData ( playeraccount, "miadd", mia ) else if getElementData(source,"38") == true then local miaa = 2 setAccountData ( playeraccount, "miadd", miaa ) end end end end addEventHandler("onPlayerQuit", root, onPlayerQuitWeaponSave) addEventHandler("onPlayerWasted", root, onPlayerQuitWeaponSave) function onPlayerLoginWeaponSave(_, playeraccount) if ( playeraccount ) then local ca = getAccountData ( playeraccount, "cadd" ) if (ca == 2 ) then setElementData (source, "22", true) end local da = getAccountData ( playeraccount, "dadd" ) if (da == 2 ) then setElementData (source, "24", true) end local sila = getAccountData ( playeraccount, "siladd" ) if (sila == 2 ) then setElementData (source, "23", true) end local sha = getAccountData ( playeraccount, "shadd" ) if (sha == 2 ) then setElementData (source, "25", true) end local swa = getAccountData ( playeraccount, "swadd" ) if (swa == 2 ) then setElementData (source, "26", true) end local spa = getAccountData ( playeraccount, "spadd" ) if (spa == 2 ) then setElementData (source, "27", true) end local aka = getAccountData ( playeraccount, "akadd" ) if (aka == 2 ) then setElementData (source, "30", true) end local ma = getAccountData ( playeraccount, "madd" ) if (ma == 2 ) then setElementData (source, "31", true) end local ua = getAccountData ( playeraccount, "uadd" ) if (ua == 2 ) then setElementData (source, "28", true) end local ta = getAccountData ( playeraccount, "tadd" ) if (ta == 2 ) then setElementData (source, "32", true) end local mpa = getAccountData ( playeraccount, "mpadd" ) if (mpa == 2 ) then setElementData (source, "29", true) end local ra = getAccountData ( playeraccount, "radd" ) if (ra == 2 ) then setElementData (source, "33", true) end local sna = getAccountData ( playeraccount, "snadd" ) if (sna == 2 ) then setElementData (source, "34", true) end local mia = getAccountData ( playeraccount, "miadd" ) if (mia == 2 ) then setElementData (source, "38", true) end end end addEventHandler("onPlayerLogin", root, onPlayerLoginWeaponSave) addEventHandler("OnPlayerSpawn", root, onPlayerLoginWeaponSave)
  5. @Ricas u can use this too onVehicleStartEnter + cancelEvent
  6. @Abdul KariM الفكرة كويسة جداً لكن ما انصحك تكمل .. لأن بكل بساطة انت الحين تتعب نفسك في شي خلاص على وشك الانتهاء واللي هو اللعبة .. تقبل مروري يا بطل
  7. وش اللي تبيه الحين *مب الحين لكن ابي اعرف وش تبي من تصميمات* ووش المقابل ؟
  8. حياك الله يا محمد في البداية طلبات البرمجة في هذا القسم القسم الخاص بالبرمجة وهذي بعض الشروحات اللي مسويها لو تبي تستفيد اكثر وفيه اكثر من شرح لأكثر من كود تقدر تدور هنا دروس في البرمجة اما هنا ( في هذا القسم: القسم العام ) تقدر تدردش مع باقي الاعضاء القسم العام: يشمل كل هذي الاقسام وهذا قسم الخوادم لو تبي تشتري سيرفر او خادم سيرفرات او لو تبي شروحات عن الاستضافات الخ اما هذا القسم الخاص بالمساهمات واللي هو بيتم عرض مودات / سكربتات اعضاء المنتدى فيه واللي تقدر منه تحمل المودات اللي هم عارضينها او لو تبي تعرض انت كمان
  9. فكرت بالرد على هذا الاقتباس بأكثر من طريقة لكن مارح اضيع الوقت اللي جلسته هنا *في المنتدى* بسبب مجرد منشور افهمها متل ما تبي وياريت لا تسوي اقتباس او رد وملاحظة بس ترا مب انت اللي تقول تعلق او لا .. متل ما قلت لا تسوي لي اقتباس او رد لهذا الرد
  10. دور ورح تلاقي فيه موضوع بنفس طلبك ياريت تروح تشيك عليه
  11. ازاي جبتها هههههههههه على العموم شكراً للتصحيح
  12. test it commandList = { ["speaker"]=true, ["superman"]=true, } function onCommand ( command ) if commandList [ command ] and not ( getTeamName ( getPlayerTeam ( source ) ) == "Staff" ) then cancelEvent() end end addEventHandler("onPlayerCommand", root, onCommand )
  13. setAccountData ( getAccounName ( account ) , 'aPassowrd' , aPassword ) -- الداتا مب على اسم الاكونت لكن على الاكونت نفسه وش سالفتها معكم ؟ setAccountData ( ( account ) , 'aPassowrd' , aPassword ) -- لازم الاكونت يكون معرف
  14. @#!Error.xD شوف يالطيب سوي اديت في لوحة ومعها زر guiCreateWindow guiCreateEdit guiCreateButton -- "onClientRender" + متغيرات a = 0 text = "" dxDrowText -- ووقت اللاعب يضغط على الزر يجيب الكلام المكتوب في الاديت "onClientGUIClick" guiGetText بعدها سوي ترايجر مع ارجمنت زيادة واللي هو الكلام اللي انت جبته من الادت triggerServerEvent ( "trigger", localPlayer, guiGetText ( theEdit ) ) وطبعاً الاستقبال من ملف سيرفر وبعدها ترايجر ثاني لملف كلينت لكن رح يكون رووت function ( theText ) triggerClientEvent ( root, "trigger2", root, theText ) end ونفس الاستقبال في ملف كلينت function ( roottext ) a = 255 text = roottext -- وكمان تيمر setTimer ( function () a = 0 text = "" end, 15*1000, 1 ) end ما قدرت استعمل التاج بسبب ضعف الانترنت
  15. فكرة رهيبة لكن فيها تعقيد في النهاية .. ولازم يستعمل السكل
  16. لا ابداً ما تقصدني انت -__- ليه مسوي منشن لي في البداية وتقول نصيحة و مدري وش
×
×
  • Create New...