Leaderboard
Popular Content
Showing content with the highest reputation on 04/08/18 in Posts
-
اليوم بشرح الوضائف الجديدة الخاصة بالاكاونت { getAccountByID , getAccountID , getAccountIP , getAccountsByData , getAccountsByIP , setAccountName } بسم الله نبدأ x[ getAccountByID ]x شرح الوضيفة \ Explain the function This function returns the account with the specific ID. / تقوم الوضيفة بإرجاع الحساب عبر الايدي او المعرف الخآص به السانتكس \ Syntax account getAccountByID ( int id ) id = The ID to get account from / الآيدي الي تبي تجلب فيه الحساب عن طريقة العائدات / Returns Returns account associated with specified ID. Returns false if invalid arguments were specified or there is no account with this ID. / ارجاع الحساب المرتبط بالمعرف او الإيدي ,إرجاع قيمة منطقية بـ فولس إذا كان الحساب غير موجود مثآل \ Examble addCommandHandler("getAccount", -- نسوي امر جديد function (player, cmd, id) id = tonumber(id) -- نجلب الايدي من الامر local account = getAccountByID(id) -- نجيب الحساب من الايدي if account then -- نتحقق ان الحساب موجود او لا outputChatBox("The name of the account with that ID is: "..getAccountName(account), player) -- اخراج نص بـ أسم الحساب الي جبناه else -- اذا الحساب مو موجود outputChatBox("There is no account with this ID.", player) -- اخراج نص بـ ان لا يوجد حساب يمتلك هذا الاي دي end end) x[ getAccountID ]x شرح الوضيفة \ Explain the function This function retrieves the ID of an account. / تستخدم هذه الوضيفة لجلب الآيدي او المعرف الخاص بالحساب السانتكس \ Syntax int getAccountID ( account theAccount ) theAccount = The account you wish to get the ID of. / الحساب الذي تريد جلب الآيدي او المعرف الخاص به العائدات / Returns Returns a int containing the account's ID, false if the account does not exist or an invalid argument was passed to the function. / ارجاع رقم انتقر او رقم صحيح يحتوي ع ايدي الحساب المُدخل, إرجاع قيمة منطقية بـ فولس إذا كان الحساب غير موجود مثآل \ Examble function outputOnLogin ( previous_account, current_account, auto_login ) --when a player logs in / لما الاعب يسجل دخول outputConsole("["..getAccountID(previous_account).."] "..getAccountName(previous_account).." Logged into ["..getAccountID(current_account).."]"..getAccountName(current_account)) -- announce it into the console / استخراج نص للكونسل بـ أيدي حسابة القديم و الجديد end addEventHandler("onPlayerLogin",getRootElement(),outputOnLogin ) --add an event handler / اضافة حدث x[ getAccountIP ]x شرح الوضيفة \ Explain the function This function retrieves the IP-address of an account. / تستخدم هذي الوضيفة لجلب عنوان الايبي ادريسس للحساب المحدد السانتكس \ Syntax string getAccountIP ( account theAccount ) theAccount = The account you wish to get the IP of. / الحساب الذي تريد جلب الايبي ادريسس الخاص به العائدات / Returns Returns a string containing the account's IP, false if the account does not exist or an invalid argument was passed to the function. / إرجاع سلسلة نصية تحتوي على عنوان الايبي ادريسس للحساب المُدخل, إرجاع قيمة منطقية بـ فولس إذا كان الحساب غير موجود مثآل \ Examble function outputOnLogin ( previous_account, current_account, auto_login ) --when a player logs in / عند تسجيل دخول الاعب outputDebugScript(getPlayerName(source).."logged into his account with IP "..getAccountIP(previous_account)) -- announce it into the debugscript / إخراج نص للدي بق بـ عنوان الاإيبي ادريس للحساب إو الاعب end addEventHandler("onPlayerLogin",getRootElement(),outputOnLogin ) --add an event handler / اضافة حدث x[ getAccountsByData ]x شرح الوضيفة \ Explain the function This function returns a table containing all accounts with specified dataName and value (set with setAccountData). / تقوم هذه الوضيفة بإرجاع جدول يحتوي على جميع الحسابات التي تمتلك على داتا محددة ( setAccountData ) :تم تعينها بإستخدام وضيفة السانتكس \ Syntax table getAccountsByData ( string dataName, string value ) dataName = The name of the data / اسم الداتا value = The value the dataName should have / اشتراط ان تكون قيمة الداتا العائدات / Returns Returns table containing the accounts associated with specified value at dataName. Returns false if invalid arguments were specified. / جدول يحتوي على الحسابات المرتبطة بالقيمة المحددة في الداتا, إرجاع قيمة منطقية بـ فولس إذا تم تحديد ارقمنات غير صالحة مثآل \ Examble addCommandHandler("accountsbydata", function (player) -- add Command / إضافة امر local account = getPlayerAccount(player) -- Set the variable to the player account / تعين المتغير بـ حساب الاعب setAccountData(account, "test", "hello") -- Set the data and the value set on the account / وضع داتا معينة وقيمة لها على الحساب local accounts = getAccountsByData("test", "hello") -- Set the variable to the table containing the accounts associated with dataName and valueData / تعين المتغير بجدول يحتوي على الحسابات المرتبطة بالداتا والقيمة الخاصة بها outputChatBox(getAccountName(accounts[1]), player) -- The output text that contains the first account in the table / إخراج نص يحتوي على إول حساب في الجدول end) x[ getAccountsByIP ]x شرح الوضيفة \ Explain the function This function returns a table containing all accounts that were logged onto from specified IP-address. / تقوم هذه الوضيفة بإرجاع جدول يحتوي على كافة الحسابات التي تم تسجيلها من عنوان الإيبي ادريس المحدد السانتكس \ Syntax table getAccountsByIP ( string ip ) ip = The IP to get accounts from / الإيبي ادريس المراد الحصول على الحسابات المسجلة به العائدات / Returns Returns table containing the accounts associated with specified IP-address. Returns false if invalid arguments were specified. / تقوم هذه الوضيفة بإرجاع جدول يحتوي على الحسابات المرتبطة بعنوان الايبي ادريس المحدد, إرجاع قيمة منطقية بـ فولس اذا تم تحديد ارقمنات غير صالحة مثآل \ Examble addCommandHandler("getAccounts", -- add Command / إضافة امر function (player, cmd) local ip = getPlayerIP(player) -- Set the variable to the player IP / تعين المتغير بـ إيبي الاعب local accounts = getAccountsByIP(ip) -- Set the variable to the table containing the accounts associated with IP / تعين المتغير بجدول يحتوي على الحسابات المرتبطة بالإيبي المسجل بها outputChatBox("You have " .. #accounts .. " accounts.", player) -- Output text in the number of recorded accounts in player IP-address / إخراج نص بعدد الحسابات المسجلة في إيبي ادريس الاعب end) x[ setAccountName ]x شرح الوضيفة \ Explain the function This function sets the name of an account. / تقوم هذه الوضيفة بتحديد اسم الحساب المحدد السانتكس \ Syntax bool setAccountName ( account theAccount, string name [, bool allowCaseVariations = false] ) theAccount = The account you wish to change the name./الحساب الذي تريد تعين الاسم له name = The new name.. / الإسم الجديد للحساب allowCaseVariations = Whether the username is case sensitive (if this is set to true, usernames "Bob" and "bob" will refer to different accounts) العائدات/ Returns Returns a true if the account name was set, false if an invalid argument was specified. / تقوم هذه الوضيفة بإرجاع قيمة منطقية بـ ترو إذا تم تعين اسم الحساب, إرجاع قيمة منطقية بـ فولس اذا تم تحديد ارقمنات غير صالحة مثآل \ Examble addCommandHandler("changeaccountname", function(player, _, oldname, newname) -- add Command / اضافة امر if not oldname or not newname then -- Verify that the oldname and newname value exist / تحقق من وجود قيمة oldname و newname return end local account = getAccount(oldname)-- Set the variable to the account whose name will be changed / تعين المتغير بـ الحساب المراد تغير اسمه if not account then -- Verify that the specified account exists / تحقق من وجود الحساب المحدد return end setAccountName(account, newname) -- Set the specified account name to the newname / وضع إسم الحساب المحدد إلى الـ newname end) الحمد لله وصلنآ إلى نهاية الشرح إتمنى انه اعجبكم وماكان صعب عليكم الإهداءات/ Dedications @KhaledAlamri @#َxLysandeR @!#NssoR_) @#_iMr,[E]coo @#StrOnG_,) @iMr.WiFi..! @بويكا @Master_MTA @N3xT @#DRAGON!FIRE @[T]|O|[P]George @MrKAREEM @ccz @killerProject @#DesTroeyR @Rakan# @الباقي بالقلب9 points
-
ماتقدر تنفذ فنكشنات على لاعب غير موجود بالسيرفر, لكن مثلاً ممكن تضيف داتا على الحساب حقه واذا كانت القيمة مثلاً ترو ينفذ الفنكشن اللي تبيه4 points
-
getElementsOnPlayerScreen الوظيفة تجيب لك الكائنات او الألمنتات الي ظاهرين على شاشتك Syntax: table getElementsOnPlayerScreen(string/table elementType = "all") Source code: function getElementsOnPlayerScreen(element) local elementTypes = {['player']=true, ['ped']=true, ['vehicle']=true, ['object']=true, ['pickup']=true}; local element = ((type(element) == 'table' and element) or (element == 'all' and element)) if element then if type(element) == 'string' then element = {} for value in pairs(elementTypes) do element[#element+1] = value; end else local elementsTable = {}; for index = 1, #element do if elementTypes[element[index]] then elementsTable[#elementsTable+1] = element[index] end end element = elementsTable; end local elementsTable = {}; local elements = {}; for index = 1, #element do local element = getElementsByType(element[index]) for key = 1, #element do elements[#elements+1] = element[key]; end end for element = 1, #elements do if isElementOnScreen(elements[element]) and elements[element] ~= localPlayer then elementsTable[#elementsTable+1] = elements[element] end end return elementsTable end end شرح الأرقمنتات للفنكشن: Optional Arguments: elementType: نوع الألمنتات الي تبي تحقق اذا كانت موجودة في شاشة اللاعب القيمة ممكن تكون جدول او سترنق اذا كانت القيمة سترنق ف لازم تكون 'all' او اذا كانت القيمة جدول تقدر تحط فيه هذي القيم player ped vehicle object pickup Example: --#Client Side function getElementsOnPlayerScreen(element) local elementTypes = {['player']=true, ['ped']=true, ['vehicle']=true, ['object']=true, ['pickup']=true}; local element = ((type(element) == 'table' and element) or (element == 'all' and element)) if element then if type(element) == 'string' then element = {} for value in pairs(elementTypes) do element[#element+1] = value; end else local elementsTable = {}; for index = 1, #element do if elementTypes[element[index]] then elementsTable[#elementsTable+1] = element[index] end end element = elementsTable; end local elementsTable = {}; local elements = {}; for index = 1, #element do local element = getElementsByType(element[index]) for key = 1, #element do elements[#elements+1] = element[key]; end end for element = 1, #elements do if isElementOnScreen(elements[element]) and elements[element] ~= localPlayer then elementsTable[#elementsTable+1] = elements[element] end end return elementsTable end end function getNearestElementOnPlayerScreen(player, elementType) local player = (isElement(player) and getElementType(player) == 'player') and player local elementType = type(elementType) == 'string' and (elementType == 'all' and elementType or {elementType}) if player and elementType then local element = getElementsOnPlayerScreen(elementType); local nearest local playerX, playerY, playerZ = getElementPosition(player) for index = 1, #element do if isElement(nearest) then local oldDistance = getDistanceBetweenPoints3D(playerX, playerY, playerZ, getElementPosition(nearest)) local newDistance = getDistanceBetweenPoints3D(playerX, playerY, playerZ, getElementPosition(element[index])); if newDistance < oldDistance then nearest = element[index]; end else nearest = element[index]; end end return nearest end end addCommandHandler('warpVehicle', function() local vehicle = getNearestElementOnPlayerScreen(localPlayer, 'vehicle'); if vehicle then triggerServerEvent('givePlayerVehicle.', localPlayer, vehicle) else outputChatBox('There\'s no vehicle on you screen', 255, 0, 0, true) end end) --#Server Side addEvent('givePlayerVehicle.', true) addEventHandler('givePlayerVehicle.', root, function(vehicle) if not isPedInVehicle(client) then warpPedIntoVehicle(client, vehicle) end end) المثال هذا اذا كتبت /warpVehicle ينقلك الى اقرب مركبة3 points
-
السلام عليكم ورحمة الله تعالي وبركاته طبعا انا زمان ما نزلت شروحات واليوم راجعلكم بشرح لفنكشن engineReplaceAnimation طبعا الوظيفة كانت موجودة من زمان علي الويكي ولاكن شالوها ورجعوها امس ويلا نبدأ بسم الله طبعا الوظيفة للكلنت فقط الان نروح للساينتكس bool engineReplaceAnimation ( ped thePed, string InternalBlockName, string InternalAnimName, string CustomBlockName, string CustomAnimName ) ped thePed = اللاعب او البيد الي تبي تبدل الحركة عليه string InternalBlockName = البلوك نيم حق الحركة القديمة الي بالاغلب الناس تستخدم ped string InternalAnimName = الي هي الحركة الي جوا البلوك نيم مثلا weapon_crouch string CustomBlockName = اسم البلوك نيم حق حركتك الجديدة string CustomAnimName = اسم الحركات الي جوا الملف حق ifp وتقدر تفتحه عن طريق برنامج gta anim manager رابط تحميل البرنامج https://gamebanana.com/tools/5979 نيجي لمثال الحين موجود بالويكي --[[ طبعا ملف حق parkour.ifp الموجود بالويكي فيه شوية حركات : BckHndSpingBTuck BckHndSping CartWheel FrntHndSpring HandPlant ]] -- من هنا تقدر تغير اسم البلوك حق الحركة من هنا local customBlockName = "myNewBlock" -- نجيب الملف الي فيه الحركات local IFP = engineLoadIFP( "parkour.ifp", customBlockName ) -- يتحقق لو انه مش موجود يقولك فشل if not IFP then outputChatBox( "Failed to load 'parkour.ifp'" ) end -- تغيير حركة يوم تنزل علي الارض عن طريق c تسوي حركة جديدة engineReplaceAnimation( localPlayer, "ped", "weapon_crouch", customBlockName, "HandPlant" ) وقريبا المزيد من الامثلة وطبعا الفنكشن ما خلصوه بالكامل لان فيه اخطاء مثلا خطأ الاصدار 1.3 يملا الديبق يوم تسوي اي شي فيه وفي مود سواه واحد اجنبي تقدر منه تحط تغير منه مشيات وفيه حركات جديدة اكتشفوها بأنفسكم رابط التحميل https://drive.google.com/file/d/1L2NkQYuLS0YdoHECvxVRMdPBbEgaYUfH/view ومع السلامة2 points
-
الله يعطيك العافية ع الموضوع المنسق و المفيد , وبخصوص هاذا الاوبشن هذا ماهو ضروري ولكن وظيفته يكون دقيق اكثر بالحروف الي تكتبها يعني علي سبيل المثال حسابي اسمه كذا NssoR راح يقولك الاكاونت هذا موموجود , والسبب ان انت حاط " ترو" وبكذا راح يدقق ع الاحرف nssor وانت استخدمت هالخيار وخليته " ترو " وكتبت اسم الحساب اتمني وضحت المعلومة , تم وضع الموضوع كـ مميز و يثبت لفترة مؤقتة وشكرا لمساهمتك2 points
-
2 points
-
2 points
-
2 points
-
Eu fiz assim, pode testar: carro = createVehicle (411, 2475, -1657, 14, 0, 0, 0) -- Cria o veículo na coordenada específica. (essa posição é por padrão o ponto de respawn) globalTimer = {} -- tabela vazia global. function startRespawn (thePlayer) -- Evite usar letra maiúscula no início de variáveis. -- vehicle é uma palavra reservada, não use-a para dar nome de variável. if source ~= carro then return end -- Se o veículo que o jogador saiu não for o veículo deste script, nada acontece. if not isTimer (globalTimer[thePlayer]) then -- Verifica se o jogador já possui um timer ativo. outputChatBox ("Seu veiculo será respawnado em 10 segundos! Entre nele novamente", thePlayer) -- Mensagem de aviso para o player. globalTimer[thePlayer] = setTimer (function() -- Conta 10 segundos respawnVehicle (carro) -- Respawna o veículo. setVehicleEngineState (carro, false) -- Desliga o motor do veículo. end, 10000, 1) -- Tempo e repetições do timer. else resetTimer (globalTimer[thePlayer]) -- Se já existe o timer do jogador, reinicia ele. end end addEventHandler ("onVehicleExit", root, startRespawn) -- Executa essa função quando qualquer um sair de qualquer veículo. function cancelRespawn (thePlayer) if source ~= carro then return end -- Se o veículo que o jogador entrou não for o veículo deste script, nada acontece. if isTimer (globalTimer[thePlayer]) then -- Se existe o timer deste jogador, então: killTimer (globalTimer[thePlayer]) -- Cancela o timer deste jogador e o veículo não vai mais respawnar até que ele saia de novo do veículo. outputChatBox ("Seu veiculo não será mais respawnado.", thePlayer) -- Mensagem de aviso para o player. end end addEventHandler ("onVehicleEnter", root, cancelRespawn) -- Executa essa função quando qualquer um entrar em qualquer veículo. A hashtag indica o tamanho de uma tabela. No caso, a função getVehicleOccupants retorna uma tabela com todos os jogadores que estão dentro de um veículo. A tabela vazia tem tamanho 0. Por exemplo, essa tabela qualquer aqui: tabelaQualquer = {32, 15, 50} -- Table com 3 elementos de valores numéricos. No caso acima, se eu usar #tabelaQualquer, isso será igual a 3.2 points
-
2 points
-
2 points
-
2 points
-
Hello everyone! I'm making color picker with dx functions. How can i get pixel color under mouse cursor? I tried to use render targets but it always returns 0,0,0 (rgb). I don't know how to get screen pixels without losing performance (onClientRender). I'm making everything with DGS library so it gives additional troubles. Any suggestions?1 point
-
سلام عليكم ورحمه الله وبركاته - محتاج محترفين بلغة c# عشان يقولولي طريقة اربط فيها c# الى mysql خاص بموقعي محاولتي : using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using MySql.Data; using MySql.Data.MySqlClient; namespace LearnCSharp { class Program { static void Main(string[] args) { string server, database, uid, password, connectionString; server = "***"; database = "***"; uid = "***"; password = "***"; connectionString = "SERVER=" + server + ";" + "PORT=3306;" + "DATABASE=" + database + ";" + "UID=" + uid + ";" + "PASSWORD=" + password + ";compress=true;"; MySqlConnection connection = new MySqlConnection(connectionString); try { Console.WriteLine("Connecting to MySQL..."); connection.Open(); string sql = "SELECT username, password FROM users WHERE id='1'"; MySqlCommand cmd = new MySqlCommand(sql, connection); MySqlDataReader rdr = cmd.ExecuteReader(); while (rdr.Read()) { Console.WriteLine(rdr[0] + " -- " + rdr[1]); } rdr.Close(); } catch (Exception ex) { Console.WriteLine(ex.ToString()); } connection.Close(); Console.WriteLine("Done."); Console.ReadKey(); } } } وأتمنى الرد السريع (:1 point
-
1 point
-
شكرا لك جزيلل الشكر على تثبيت وتميز الموضوع ولو لفترة مؤقتة والمساهمه واجبنا شكرا1 point
-
1 point
-
1 point
-
1 point
-
Desculpe, não tinha visto essa pergunta. No caso, a função pertence ao timer, por isso não precisa dar nome a ela pois o nome está no timer. Eu preferi fazer assim pois é muito melhor fazer uma função inteira dentro do timer do que fazer 1 timer para cada comando que será feito após 10 segundos.1 point
-
É, pelo que vi não era para acontecer de respawnar com o jogador dentro, depois posso tentar verificar melhor... Exatamente, no script que mandei passou despercebido a verificação se o veículo que irá respawnar é o mesmo criado e armazenado na variável "carro"1 point
-
حياك الله حبيبي شكرا لك شكرا لك حيآك الله بأي وقت هذا هو الهدف من الموضوع شكرا1 point
-
E o exemplo que eu dei, só funciona no veículo do seu script, não funciona com os outros veículos pelo mapa.1 point
-
É que na verdade o exemplo do @MaligNos está mais avançado, ele está querendo evitar que o veículo respawne com outro jogador dentro. Eu apenas corrigi o seu exemplo para fazer somente o que vc quer que ele faça.1 point
-
Se quiser aproveitar algo: carro = createVehicle (411, 2475, -1657, 14, 0, 0, 0) addEventHandler("onVehicleExit", root, function(player) if (#getVehicleOccupants(source) == 0) then outputChatBox("Seu veiculo será respawnado em 10 segundos! Entre nele novamente",player) setTimer(function(veh) if (#getVehicleOccupants(veh) == 0) then respawnVehicle(veh) setVehicleEngineState(veh,false) end end,10000,1,source) end end ) Dessa forma ele não irá respawnar quando sair do veículo caso exista outros jogadores dentro.1 point
-
Sim, pois vc declarou o timer dentro de uma função. Se ela for local, as outras funções não terão acesso a ela. Declare a variável do timer como uma tabela vazia antes da primeira função e depois use-a, indexando com o jogador.1 point
-
1 point
-
1 point
-
1 point
-
Não existe nenhum evento nesse script que ative ao entrar no veículo. Como por exemplo um onVehicleEnter Além disso, você precisa colocar seu timer em uma variável para poder cancelá-lo depois.1 point
-
1 point
-
طيب ليه ماتوضح من الأول انك بدك تغير احداثيات الماركر المهم تفضل local bsMarker = createMarker(1937.98682,-2301.14429,12.6000,"cylinder",2,252,0,255,50) createBlipAttachedTo(bsMarker,56) local bsLocations = { {1443.55371, -2493.37646, 12.99999}, {1477.70557, 1304.07092, 12.99999}, {-1634.96631, -145.10735, 12.99999}, {1443.55371, -2493.37646, 12.99999}, {1477.70557, 1304.07092, 12.99999}, {-1634.96631, -145.10735, 12.99999}, {1443.55371, -2493.37646, 12.99999}, {1477.70557, 1304.07092, 12.99999}, {-1634.96631, -145.10735, 12.99999}, {1439.33911, -2596.01294, 12.99999}} local bsNumber = {} addEventHandler("onMarkerHit",bsMarker, function(hitElement,_) if (hitElement and getElementType(hitElement) == "player" and not isPedInVehicle(hitElement)) then if not (getElementData(hitElement,"AGJob2") == "plan driver") then -- we use this to check if the player did not take the job before triggerClientEvent("showbsGui2", hitElement, hitElement) else outputChatBox("Your job already started. Get back to your plan and continue to work!", hitElement,229,250,2) end end end) local bsVehicle = {} local bsVehicleBlip = {} local bsJobMarker = {} local bsJobBlip = {} function startbsJob(thePlayer) setElementData(thePlayer,"AGJob2","plandriver") bsVehicle[thePlayer] = createVehicle(593,1938.10779, -2320.12524, 13.54688) bsVehicleBlip[thePlayer] = createBlipAttachedTo(bsVehicle[thePlayer],5) setElementVisibleTo(bsVehicleBlip[thePlayer],getRootElement(),false) setElementVisibleTo(bsVehicleBlip[thePlayer],thePlayer,true) setElementData(bsVehicle[thePlayer],"JobOwner", getPlayerName(thePlayer)) setElementData(bsVehicle[thePlayer],"AGJob2","taxi") warpPedIntoVehicle(thePlayer,bsVehicle[thePlayer]) showDaBusMarker(thePlayer) end addEvent("givebsJob2",true) addEventHandler("givebsJob2", root,startbsJob) function showDaBusMarker(thePlayer) if bsNumber[thePlayer] then --outputChatBox("bsnumber") if bsNumber[thePlayer] == 1 then bsNumber[thePlayer] = bsNumber[thePlayer] + 1 --outputChatBox("bsnumber == 1, so + 1") elseif bsNumber[thePlayer] == 10 then bsNumber[thePlayer] = bsNumber[thePlayer] - math.random(1,8) --outputChatBox("bsnumber - ") else bsNumber[thePlayer] = bsNumber[thePlayer] + 1 --outputChatBox("bsnumber + 1") end bsJobMarker[thePlayer] = createMarker(bsLocations[bsNumber[thePlayer]][1],bsLocations[bsNumber[thePlayer]][2],bsLocations[bsNumber[thePlayer]][3],"cylinder",2,100,100,0,200) bsJobBlip[thePlayer] = createBlipAttachedTo(bsJobMarker[thePlayer],19) setElementData(bsJobMarker[thePlayer],"JobOwner",getPlayerName(thePlayer)) setElementVisibleTo(bsJobMarker[thePlayer],getRootElement(),false) setElementVisibleTo(bsJobBlip[thePlayer],getRootElement(),false) setElementVisibleTo(bsJobMarker[thePlayer],thePlayer,true) setElementVisibleTo(bsJobBlip[thePlayer],thePlayer,true) addEventHandler("onMarkerHit", bsJobMarker[thePlayer], givebsPay) else bsNumber[thePlayer] = math.random(1,10) --outputChatBox("no bsnumber") --outputChatBox(bsNumber[thePlayer]) bsJobMarker[thePlayer] = createMarker(bsLocations[bsNumber[thePlayer]][1],bsLocations[bsNumber[thePlayer]][2],bsLocations[bsNumber[thePlayer]][3],"cylinder",2,100,100,0,200) setElementData(bsJobMarker[thePlayer],"JobOwner",getPlayerName(thePlayer)) bsJobBlip[thePlayer] = createBlipAttachedTo(bsJobMarker[thePlayer],19) setElementVisibleTo(bsJobMarker[thePlayer],getRootElement(),false) setElementVisibleTo(bsJobBlip[thePlayer],getRootElement(),false) setElementVisibleTo(bsJobMarker[thePlayer],thePlayer,true) setElementVisibleTo(bsJobBlip[thePlayer],thePlayer,true) addEventHandler("onMarkerHit", bsJobMarker[thePlayer], givebsPay) end end function givebsPay(hitElement,_) if (getElementType(hitElement) == "player" and getElementData(hitElement,"AGJob2")== "busdriver" and isPedInVehicle(hitElement)) then --outputChatBox("first step") if (getElementData(source,"JobOwner") == getPlayerName(hitElement)) then --outputChatBox("second step") local vehicle = getPedOccupiedVehicle(hitElement) if (getElementData(vehicle,"JobOwner") == getElementData(source,"JobOwner" )) then setElementFrozen(vehicle,true) setElementFrozen(hitElement,true) outputChatBox("The passengers are getting down",hitElement,999,0,255) destroyElement(bsJobMarker[hitElement]) destroyElement(bsJobBlip[hitElement]) setTimer(givebsPayNow,3000,1,hitElement) else outputChatBox("Get back to your job vehicle!!!!",hitElement,0,246,255) end end end end function givebsPayNow(thePlayer) setElementFrozen(thePlayer,false) setElementFrozen(bsVehicle[thePlayer],false) givePlayerMoney(thePlayer,1500) showDaBusMarker(thePlayer) end function destroybs() if getElementData(source,"AGJob2") == "busdriver" then if isElement(bsVehicle[source]) then destroyElement(bsVehicle[source]) end if isElement(bsVehicleBlip[source]) then destroyElement(bsVehicleBlip[source]) end if isElement(bsJobMarker[source]) then destroyElement(bsJobMarker[source]) end if isElement(bsJobBlip[source]) then destroyElement(bsJobBlip[source]) end bsNumber[source] = nil end end addEventHandler("onPlayerQuit",getRootElement(), destroybs) addEventHandler("onVehicleExplode", getRootElement(), function() if getElementData(source,"AGJob2") == "busdriver" then local player = getPlayerFromName(getElementData(source,"JobOwner")) if isElement(bsVehicle[player]) then destroyElement(bsVehicle[player]) end if isElement(bsVehicleBlip[player]) then destroyElement(bsVehicleBlip[player]) end if isElement(bsJobMarker[player]) then destroyElement(bsJobMarker[player]) end if isElement(bsJobBlip[player]) then destroyElement(bsJobBlip[player]) end bsNumber[player] = nil setElementData(player,"AGJob2",nil) end end) addEventHandler("onVehicleStartEnter",getRootElement(), function(player,seat,jacked,door) if (getElementData(source,"AGJob2") and getElementData(source,"AGJob2")=="busdriver") then if (getElementData(source,"JobOwner") ~= getPlayerName(player)) then cancelEvent(true) outputChatBox("This is not your vehicle!!",player,144,0,50) end end end) addEventHandler("onElementDataChange",getRootElement(), function(dataName,oldValue) if getElementType(source) == "player" then if dataName == "AGJob2" then if oldValue == "busdriver" then if isElement(bsVehicle[source]) then destroyElement(bsVehicle[source]) end if isElement(bsVehicleBlip[source]) then destroyElement(bsVehicleBlip[source]) end if isElement(bsJobMarker[source]) then destroyElement(bsJobMarker[source]) end if isElement(bsJobBlip[source]) then destroyElement(bsJobBlip[source]) end bsNumber[source] = nil end end end end)1 point
-
1 point
-
شكرا لك حبيبي هههههههه حياك الله حبيبي شكرا وياك ي رب منور الموضوع حبيبي اذا فيه احد يشرح هذي لو تكرمتوا لاني م فهمتها شكرا1 point
-
بسيطه .. بأول مود غير اسم الترايقر والاحداثيات حقت الماركر وثاني مود خله زي ماهو وين الصعوبه بالموضوع ؟1 point
-
1 point
-
زي م قال الاخ N3xT يعني الفنكشنات اللي الارقمنت حقتها لأعب .. ماتقدر تستعملها على شخص مو موجود بيقولك ان الارقمنت ذا مو المنت يعني م ينفع تستعمل setElementData مثلًا على شخص مو موجود1 point
-
القسم خطاء . @!#NssoR_) القسم الصحيح : https://forum.multitheftauto.com/forum/134-البرمجة/ + ما تقدر تمسحهم بس في طريقه اخري | انك ترفع الصور علي رابط و تستخدم وظيفه fetchRemote1 point
-
1 point
-
يعني تبي تجيب حسابات اللاعب كلها ؟ اذا هيك تقدر تستخدم الوظيفه دي سويتها لك function getPlayerAccounts(player) local serial = getPlayerSerial(player) local emptyTable = {} for _,account in ipairs(getAccounts()) do if serial == getAccountSerial(account) then table.insert(emptyTable, account) end end return emptyTable end1 point
-
local bsMarker = createMarker(1949.56274, -2302.45239, 12.54688,"cylinder",1.5,252,0,255,50) createBlipAttachedTo(bsMarker,56) local bsLocations = { {1443.55371, -2493.37646, 12.99999}, {1477.70557, 1304.07092, 12.99999}, {-1634.96631, -145.10735, 12.99999}, {1443.55371, -2493.37646, 12.99999}, {1477.70557, 1304.07092, 12.99999}, {-1634.96631, -145.10735, 12.99999}, {1443.55371, -2493.37646, 12.99999}, {1477.70557, 1304.07092, 12.99999}, {-1634.96631, -145.10735, 12.99999}, {1439.33911, -2596.01294, 12.99999}} local bsNumber = {} addEventHandler("onMarkerHit",bsMarker, function(hitElement,_) if (hitElement and getElementType(hitElement) == "player" and not isPedInVehicle(hitElement)) then if not (getElementData(hitElement,"AGJob2") == "plan driver") then -- we use this to check if the player did not take the job before triggerClientEvent("showbsGui2", hitElement, hitElement) else outputChatBox("Your job already started. Get back to your plan and continue to work!", hitElement,229,250,2) end end end) local bsVehicle = {} local bsVehicleBlip = {} local bsJobMarker = {} local bsJobBlip = {} function startbsJob(thePlayer) setElementData(thePlayer,"AGJob2","plandriver") bsVehicle[thePlayer] = createVehicle(593,1938.10779, -2320.12524, 13.54688) bsVehicleBlip[thePlayer] = createBlipAttachedTo(bsVehicle[thePlayer],5) setElementVisibleTo(bsVehicleBlip[thePlayer],getRootElement(),false) setElementVisibleTo(bsVehicleBlip[thePlayer],thePlayer,true) setElementData(bsVehicle[thePlayer],"JobOwner", getPlayerName(thePlayer)) setElementData(bsVehicle[thePlayer],"AGJob2","taxi") warpPedIntoVehicle(thePlayer,bsVehicle[thePlayer]) showDaBusMarker(thePlayer) end addEvent("givebsJob2",true) addEventHandler("givebsJob2", root,startbsJob) function showDaBusMarker(thePlayer) if bsNumber[thePlayer] then --outputChatBox("bsnumber") if bsNumber[thePlayer] == 1 then bsNumber[thePlayer] = bsNumber[thePlayer] + 1 --outputChatBox("bsnumber == 1, so + 1") elseif bsNumber[thePlayer] == 10 then bsNumber[thePlayer] = bsNumber[thePlayer] - math.random(1,8) --outputChatBox("bsnumber - ") else bsNumber[thePlayer] = bsNumber[thePlayer] + 1 --outputChatBox("bsnumber + 1") end bsJobMarker[thePlayer] = createMarker(bsLocations[bsNumber[thePlayer]][1],bsLocations[bsNumber[thePlayer]][2],bsLocations[bsNumber[thePlayer]][3],"cylinder",2,100,100,0,200) bsJobBlip[thePlayer] = createBlipAttachedTo(bsJobMarker[thePlayer],19) setElementData(bsJobMarker[thePlayer],"JobOwner",getPlayerName(thePlayer)) setElementVisibleTo(bsJobMarker[thePlayer],getRootElement(),false) setElementVisibleTo(bsJobBlip[thePlayer],getRootElement(),false) setElementVisibleTo(bsJobMarker[thePlayer],thePlayer,true) setElementVisibleTo(bsJobBlip[thePlayer],thePlayer,true) addEventHandler("onMarkerHit", bsJobMarker[thePlayer], givebsPay) else bsNumber[thePlayer] = math.random(1,10) --outputChatBox("no bsnumber") --outputChatBox(bsNumber[thePlayer]) bsJobMarker[thePlayer] = createMarker(bsLocations[bsNumber[thePlayer]][1],bsLocations[bsNumber[thePlayer]][2],bsLocations[bsNumber[thePlayer]][3],"cylinder",2,100,100,0,200) setElementData(bsJobMarker[thePlayer],"JobOwner",getPlayerName(thePlayer)) bsJobBlip[thePlayer] = createBlipAttachedTo(bsJobMarker[thePlayer],19) setElementVisibleTo(bsJobMarker[thePlayer],getRootElement(),false) setElementVisibleTo(bsJobBlip[thePlayer],getRootElement(),false) setElementVisibleTo(bsJobMarker[thePlayer],thePlayer,true) setElementVisibleTo(bsJobBlip[thePlayer],thePlayer,true) addEventHandler("onMarkerHit", bsJobMarker[thePlayer], givebsPay) end end function givebsPay(hitElement,_) if (getElementType(hitElement) == "player" and getElementData(hitElement,"AGJob2")== "busdriver" and isPedInVehicle(hitElement)) then --outputChatBox("first step") if (getElementData(source,"JobOwner") == getPlayerName(hitElement)) then --outputChatBox("second step") local vehicle = getPedOccupiedVehicle(hitElement) if (getElementData(vehicle,"JobOwner") == getElementData(source,"JobOwner" )) then setElementFrozen(vehicle,true) setElementFrozen(hitElement,true) outputChatBox("The passengers are getting down",hitElement,999,0,255) destroyElement(bsJobMarker[hitElement]) destroyElement(bsJobBlip[hitElement]) setTimer(givebsPayNow,3000,1,hitElement) else outputChatBox("Get back to your job vehicle!!!!",hitElement,0,246,255) end end end end function givebsPayNow(thePlayer) setElementFrozen(thePlayer,false) setElementFrozen(bsVehicle[thePlayer],false) givePlayerMoney(thePlayer,1500) showDaBusMarker(thePlayer) end function destroybs() if getElementData(source,"AGJob2") == "busdriver" then if isElement(bsVehicle[source]) then destroyElement(bsVehicle[source]) end if isElement(bsVehicleBlip[source]) then destroyElement(bsVehicleBlip[source]) end if isElement(bsJobMarker[source]) then destroyElement(bsJobMarker[source]) end if isElement(bsJobBlip[source]) then destroyElement(bsJobBlip[source]) end bsNumber[source] = nil end end addEventHandler("onPlayerQuit",getRootElement(), destroybs) addEventHandler("onVehicleExplode", getRootElement(), function() if getElementData(source,"AGJob2") == "busdriver" then local player = getPlayerFromName(getElementData(source,"JobOwner")) if isElement(bsVehicle[player]) then destroyElement(bsVehicle[player]) end if isElement(bsVehicleBlip[player]) then destroyElement(bsVehicleBlip[player]) end if isElement(bsJobMarker[player]) then destroyElement(bsJobMarker[player]) end if isElement(bsJobBlip[player]) then destroyElement(bsJobBlip[player]) end bsNumber[player] = nil setElementData(player,"AGJob2",nil) end end) addEventHandler("onVehicleStartEnter",getRootElement(), function(player,seat,jacked,door) if (getElementData(source,"AGJob2") and getElementData(source,"AGJob2")=="busdriver") then if (getElementData(source,"JobOwner") ~= getPlayerName(player)) then cancelEvent(true) outputChatBox("This is not your vehicle!!",player,144,0,50) end end end) addEventHandler("onElementDataChange",getRootElement(), function(dataName,oldValue) if getElementType(source) == "player" then if dataName == "AGJob2" then if oldValue == "busdriver" then if isElement(bsVehicle[source]) then destroyElement(bsVehicle[source]) end if isElement(bsVehicleBlip[source]) then destroyElement(bsVehicleBlip[source]) end if isElement(bsJobMarker[source]) then destroyElement(bsJobMarker[source]) end if isElement(bsJobBlip[source]) then destroyElement(bsJobBlip[source]) end bsNumber[source] = nil end end end end) جربه ماغيرتله اسم الداتا1 point
-
1 point
-
1 point
-
1 point
-
addCommandHandler('out', function ( thePlayer ) local vehicle = getPedOccupiedVehicle ( thePlayer ) if vehicle then for i = 0,getVehicleMaxPassengers ( vehicle ) do local getPlayer = getVehicleOccupant( vehicle, i ) if thePlayer and getPlayer and getPlayer ~= thePlayer then removePedFromVehicle( getPlayer ) end end end end )1 point
-
0 points
-
0 points
-
0 points
