Jump to content

MR.GRAND

Members
  • Posts

    854
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by MR.GRAND

  1. عدلته وضبط ^^ شغال يعني ؟ اي حاجة تاني ؟ الحين مايجي اي خطأ والباسوورد مايتغير
  2. سلآم عليكم # ممكن احد يقول لي ليش موراضي يغير الباسوورد ؟ مع العلم ان getPassword = الباسورد ( سترنق ) getitem = اسم الاعب انا جالبه مع الترايقر من القريد لست -- # Server Side addEvent( 'setAccPassword', true ) addEventHandler( 'setAccPassword', root, function( getitem, getPassword ) local playerSource = getPlayerFromName(getitem) local playerAccount = getAccountName(getPlayerAccount(playerSource)) if ( not playerAccount or isGuestAccount(playerAccount) ) then return end setAccountPassword ( playerAccount, getPassword ) end ) اللي يحلها يقول لي وين الخطأ وليش حط الشي اللي رح يغيره ّ
  3. اجل لو ضبطت اكواد السكربت ليش مايسوي سلاب ضبطه ويسوي سلاب 100%
  4. بتسألني بيكون زين ولا لا ؟ هذا انت تسأل نفسك فيه انت شوف اللي يريحك وسويه
  5. ايهه ووش هو سؤالك ؟
  6. عدل على سكربت الجرين زون وحط له اكواد ازالة السيارة عند الرسباون #
  7. بعد ذا أنا ما أحس أنا متأكد أن نيتك ماهي طيبة ممكن سؤال؟ ليه تبي باسورد واحد عنده ادمنية؟ عشان يعمل عملته في السيرفر نفس ماقال لك سفاح كل معلومات الأدمنية والزوار مسجلة بقواعد بيانات السيرفر وكلها مشفرة ومانها لغة lua عشان تفك تشفيرها ^ يعني بمعنى ثاني لو تبي تجيب باسوورد ادمن من قاعدة بيانات رح يكون الطريق مقفل عندك هنا ولو تبي تجيبه بطريقة ثانية لازم معك ادمنية كاملة على الأقل عشان تجيبه او تغيره
  8. كلنت addEventHandler ("onClientGUIClick", root, function () if source == GUIEditor.button[1] then triggerServerEvent("AK", source) outputChatBox ( "تم اخذت سلاحء" ) end end ) سيرفر addEvent ( "AK", true ) addEventHandler ( "AK", root, function ( ) giveWeapon(source, 5, 1) takePlayerMoney(source, 500) end end للمعلومة عندك زيادة اند بالسيرفر سايد ونقص قوس بالسيرفر والكلنت
  9. ممكن اعرف ليش زيادة الردود اللي مالها معنى ؟ خلص عطيته اللي يبغاه ض1
  10. ستروق ... كوده هو الصح بنسبة اكبر من كودك لآن اعطاء الفلوس بالكلنت وههمي ... والسلاح سيرفر سايد ^
  11. function getFreeID() local result = dbPoll(dbQuery(db, "SELECT ID FROM VehicleList ORDER BY ID ASC"), -1) newID = false for i, id in pairs (result) do if id["ID"] ~= i then newID = i break end end if newID then return newID else return #result + 1 end end function getVehicleByID(id) v = false for i, veh in ipairs (getElementsByType("vehicle")) do if getElementData(veh, "ID") == id then v = veh break end end return v end function updateVehicleInfo(player) if isElement(player) then local result = dbPoll(dbQuery(db, "SELECT * FROM VehicleList WHERE Account = ?", getAccountName(getPlayerAccount(player))), -1) if type(result) == "table" then setElementData(player, "VehicleInfo", result) end end end addEventHandler("onResourceStart", resourceRoot, function() db = dbConnect("sqlite", "database.db") dbExec(db, "CREATE TABLE IF NOT EXISTS VehicleList (ID, Account, Model, X, Y, Z, RotZ, Colors, Upgrades, Paintjob, Cost, HP)") for i, player in ipairs(getElementsByType("player")) do updateVehicleInfo(player) end end) addEvent("onOpenGui", true) addEventHandler("onOpenGui", root, function() updateVehicleInfo(source) end) function destroyVehicle(theVehicle) if isElement(theVehicle) then local Owner = getElementData(theVehicle, "Owner") if Owner then local x, y, z = getElementPosition(theVehicle) local _, _, rz = getElementRotation(theVehicle) local r1, g1, b1, r2, g2, b2 = getVehicleColor(theVehicle, true) local color = r1..","..g1..","..b1..","..r2..","..g2..","..b2 upgrade = "" for _, upgradee in ipairs (getVehicleUpgrades(theVehicle)) do if upgrade == "" then upgrade = upgradee else upgrade = upgrade..","..upgradee end end local Paintjob = getVehiclePaintjob(theVehicle) or 3 local id = getElementData(theVehicle, "ID") dbExec(db, "UPDATE VehicleList SET X = ?, Y = ?, Z = ?, RotZ = ?, HP = ?, Colors = ?, Upgrades = ?, Paintjob = ? WHERE Account = ? AND ID = ?", x, y, z, rz, getElementHealth(theVehicle), color, upgrade, Paintjob, getAccountName(getPlayerAccount(Owner)), id) updateVehicleInfo(Owner) local attached = getAttachedElements(theVehicle) if (attached) then for k,element in ipairs(attached) do if getElementType(element) == "blip" then destroyElement(element) end end end end destroyElement(theVehicle) end end addEvent("onBuyNewVehicle", true) addEventHandler("onBuyNewVehicle", root, function(Model, cost, r1, g1, b1, r2, g2, b2) abc = false local data = dbPoll(dbQuery(db, "SELECT * FROM VehicleList WHERE Account = ?", getAccountName(getPlayerAccount(source))), -1) for i, data in ipairs (data) do if data["Model"] == Model then abc = true break end end if #data >= 5 then outputChatBox("[Vehicle System] #FF0000Sorry, but Max vehicles is 5 only.", source, 255, 85, 0, true) return end if abc then outputChatBox("[Vehicle System] #FF0000You already bought this vehicle before.", source, 255, 85, 0, true) return end if (getElementData(source, "Money") or 0) >= tonumber(cost) then setElementData(source, "Money", getElementData(source, "Money") - cost) local x, y, z = getElementPosition(source) local _, _, rz = getElementRotation(source) local color = r1..","..g1..","..b1..","..r2..","..g2..","..b2 vehicle = createVehicle(Model, x-5, y+5, z, 0, 0, rz) setVehicleColor(vehicle, r1, g1, b1, r2, g2, b2) setElementData(vehicle, "Owner", source) local NewID = getFreeID() setElementData(vehicle, "ID", NewID) dbExec(db, "INSERT INTO VehicleList VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", NewID, getAccountName(getPlayerAccount(source)), Model, x-5, y+5, z, rz, color, "", 3, cost, 1000) outputChatBox("[Vehicle System] #FFFF00You Bought: #00FFFF"..getVehicleNameFromModel(Model), source, 255, 85, 0, true) outputChatBox("[Vehicle System] #FFFF00Cost: #00FF00$"..cost, source, 255, 85, 0, true) updateVehicleInfo(source) vv[vehicle] = setTimer(function(source) if not isElement(source) then killTimer(vv[source]) vv[source] = nil end if isElement(source) and getElementHealth(source) <= 255 then setElementHealth(source, 255.5) setVehicleDamageProof(source, true) setVehicleEngineState(source, false) end end, 50, 0, vehicle) addEventHandler("onVehicleDamage", vehicle, function(loss) local account = getAccountName(getPlayerAccount(getElementData(source, "Owner"))) setTimer(function(source) if isElement(source) then dbExec(db, "UPDATE VehicleList SET HP = ? WHERE Account = ? AND Model = ?", getElementHealth(source), account, getElementModel(source)) updateVehicleInfo(getElementData(source, "Owner")) end end, 100, 1, source) end) addEventHandler("onVehicleEnter", vehicle, function(player) if getElementHealth(source) <= 255.5 then setVehicleEngineState(source, false) else if isVehicleDamageProof(source) then setVehicleDamageProof(source, false) end end end) else outputChatBox("[Vehicle System] #FF0000You don't have enough money.", source, 255, 85, 0, true) end end) vv = {} addEvent("SpawnMyVehicle", true) addEventHandler("SpawnMyVehicle", root, function(id) local data = dbPoll(dbQuery(db, "SELECT * FROM VehicleList WHERE Account = ? AND ID = ?", getAccountName(getPlayerAccount(source)), id), -1) if type(data) == "table" and #data ~= 0 then if getVehicleByID(id) then outputChatBox("[Vehicle System] #58FAF4Your Vehicle #FFFF00"..getVehicleNameFromModel(data[1]["Model"]).." #58FAF4is already spawned.", source, 255, 85, 0, true) else local color = split(data[1]["Colors"], ',') r1 = color[1] or 255 g1 = color[2] or 255 b1 = color[3] or 255 r2 = color[4] or 255 g2 = color[5] or 255 b2 = color[6] or 255 vehicle = createVehicle(data[1]["Model"], data[1]["X"], data[1]["Y"], data[1]["Z"], 0, 0, data[1]["RotZ"]) setElementData(vehicle, "ID", id) local upd = split(tostring(data[1]["Upgrades"]), ',') for i, upgrade in ipairs(upd) do addVehicleUpgrade(vehicle, upgrade) end local Paintjob = data[1]["Paintjob"] or 3 setVehiclePaintjob(vehicle, Paintjob) setVehicleColor(vehicle, r1, g1, b1, r2, g2, b2) if data[1]["HP"] <= 255.5 then data[1]["HP"] = 255 end setElementHealth(vehicle, data[1]["HP"]) setElementData(vehicle, "Owner", source) vv[vehicle] = setTimer(function(source) if not isElement(source) then killTimer(vv[source]) vv[source] = nil end if isElement(source) and getElementHealth(source) <= 255 then setElementHealth(source, 255.5) setVehicleDamageProof(source, true) setVehicleEngineState(source, false) end end, 50, 0, vehicle) addEventHandler("onVehicleDamage", vehicle, function(loss) local account = getAccountName(getPlayerAccount(getElementData(source, "Owner"))) setTimer(function(source) if isElement(source) then dbExec(db, "UPDATE VehicleList SET HP = ? WHERE Account = ? AND Model = ?", getElementHealth(source), account, getElementModel(source)) updateVehicleInfo(getElementData(source, "Owner")) end end, 100, 1, source) end) addEventHandler("onVehicleEnter", vehicle, function(player) if getElementHealth(source) <= 255.5 then setVehicleEngineState(source, false) else if isVehicleDamageProof(source) then setVehicleDamageProof(source, false) end end end) outputChatBox("[Vehicle System] #58FAF4Your Vehicle #FFFF00"..getVehicleNameFromModel(data[1]["Model"]).." #00FF00has been spawned.", source, 255, 85, 0, true) end else outputChatBox("[Vehicle System] #FF0000There might be problem with this vehicle, please call an admin.", source, 255, 85, 0, true) end end) addEvent("DestroyMyVehicle", true) addEventHandler("DestroyMyVehicle", root, function(id) local vehicle = getVehicleByID(id) if isElement(vehicle) then local data = dbPoll(dbQuery(db, "SELECT * FROM VehicleList WHERE Account = ? AND ID = ?", getAccountName(getPlayerAccount(source)), id), -1) if type(data) == "table" and #data ~= 0 then destroyVehicle(vehicle) outputChatBox ("[Vehicle System] #58FAF4Your Vehicle #FFFF00"..getVehicleNameFromModel(data[1]["Model"]).." #FF0000has been destroyed.", source, 255, 85, 0, true) else outputChatBox("[Vehicle System] #FF0000Select the Vehicle that you want to destroy.", source, 255, 85, 0, true) end else outputChatBox("[Vehicle System] #58FAF4Your Vehicle #FF0000is not spawned.", source, 255, 85, 0, true) end end) addEvent("LightsMyVehicle", true) addEventHandler("LightsMyVehicle", root, function(id) local vehicle = getVehicleByID(id) if isElement(vehicle) then local Vehicle = getPedOccupiedVehicle(source) if Vehicle == vehicle then if getVehicleOverrideLights(vehicle) ~= 2 then setVehicleOverrideLights(vehicle, 2) outputChatBox("[Vehicle System] #58FAF4Your Vehicle #FFFF00"..getVehicleNameFromModel(getElementModel(vehicle)).." #00FF00lights turned on.", source, 255, 85, 0, true) elseif getVehicleOverrideLights(vehicle) ~= 1 then setVehicleOverrideLights(vehicle, 1) outputChatBox("[Vehicle System] #58FAF4Your Vehicle #FFFF00"..getVehicleNameFromModel(getElementModel(vehicle)).." #FF0000lights turned off.", source, 255, 85, 0, true) end else outputChatBox("[Vehicle System] #FF0000You aren't in the vehicle!", source, 255, 85, 0, true) end else outputChatBox("[Vehicle System] #58FAF4Your Vehicle #FF0000is not spawned.", source, 255, 85, 0, true) end end) addEvent("LockMyVehicle", true) addEventHandler("LockMyVehicle", root, function(id) local vehicle = getVehicleByID(id) if isElement(vehicle) then if not isVehicleLocked(vehicle) then setVehicleLocked(vehicle, true) setVehicleDoorsUndamageable(vehicle, true) setVehicleDoorState(vehicle, 0, 0) setVehicleDoorState(vehicle, 1, 0) setVehicleDoorState(vehicle, 2, 0) setVehicleDoorState(vehicle, 3, 0) outputChatBox("[Vehicle System] #58FAF4Your Vehicle #FFFF00"..getVehicleNameFromModel(getElementModel(vehicle)).." #FF0000locked.", source, 255, 85, 0, true) elseif isVehicleLocked(vehicle) then setVehicleLocked(vehicle, false) setVehicleDoorsUndamageable(vehicle, false) outputChatBox("[Vehicle System] #58FAF4Your Vehicle #FFFF00"..getVehicleNameFromModel(getElementModel(vehicle)).." #00FF00unlocked.", source, 255, 85, 0, true) end
  12. --server bindkey("F1",down,window, function() local accName = getPlayerAccount( source ) if (not accName or isGuestAccount) then return else if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Console" ) ) then triggerClientEvent(source,"open") end end end) --client function open( local_P ) if (local_P == localPlayer) then guiSetVisibe(window,true) showCursor(true) end end addEevent("open",true) addEeventHandler("open",source,open)
  13. guiSetVisible == server SIDE ? showCursor == server SIDE -- تسوي ترايقر للكلنت بعد التحقق من أن الاعب بالقروب المحدد ... triggerClientEvent if -- للتحقق من أن الهدف هو الاعب المحلي guiSetVisible -- تسوي إظهار للوحة بعد التحقق showCursor -- تسوي إظهار الماوس ^
  14. سويتها اجاني اللوحة بدون ايديت شي متوقع 100% لآنك غيرت المتغير حق الأيديت الأصلي وبكذا مارح يظهر مع اللوحة ^
  15. ممكن مثال ؟ Door1 = createObject(ID,X,Y,Z,XR,YR,ZR) markerDoor1 = createMarker(X,Y,Z,'cylinder',SIZE,0,0,0,0) addEventHandler('onMarkerHit',markerDoor1, function ( hitElement ) moveObject(Door1,SPEED,X,Y,Z) end ) addEventHandler('onMarkerLeave',markerDoor1, function ( hitElement ) moveObject(Door1,SPEED,X,Y,Z) end )
  16. بالنسبة لــ https://wiki.multitheftauto.com/wiki/CreateColCircle الأرقمنات حقته كـ التالي : colshape createColCircle ( float fX, float fY, float radius ) -- fX = إحداثي الأكس وسط الدائرة المراد تكوينها -- fY = احداثي الواي وسط الدائرة المراد تكوينها -- radius = حجم نصف القطر الخاص بالدائرة المراد تكوينها
  17. ماششفنا احد مستعمل هذا الحدث ! العادة onMarkerHit or onClientMarkerHit
  18. موموضح فكرته ... وضح فكرتك وقول لنا الماركر وش تبيه يسوي بالضبط ؟ عرفنا ماركر خروج لاكن ماركر خروج وش تبي يسوي مثلا يحط الديمنشن 0 ويرسبن الاعب خارج المقر ولا وش ؟
  19. الكود خاطيء ^^ مافي شي اسمه onPlayerMarkerHit في شغلتين اسمهم -- Client onClientMarkerHit -- Server onMarkerHit
  20. كفووو , شخصية روووعة من شخص ولا اروع شكرا للطرح ,, تقبل تحياتي ومروري البسيط
×
×
  • Create New...