Jump to content

Mohab

Members
  • Posts

    11
  • Joined

  • Last visited

Everything posted by Mohab

  1. Seems like a good idea, well done.. I will try it later good luck
  2. @Burak5312 @The_GTA Thank you guys it really helped me .
  3. I forgot one line at client side local ifp = engineLoadIFP( "otur.ifp", "otur" ) so the client side will be :
  4. hello , I have a custom animation and I made a simple script by using it. so when you start the resource in the server and type /outr22 in chat the player will do the custom animation client side : addEvent( "otur", true ) addEventHandler( "otur", root, function(enable) if (enable) then setPedAnimation(source, "otur", "WEAPON_crouch", -1, true, false) else setPedAnimation(source) end end ) addEventHandler("onClientResourceStart", resourceRoot, function() triggerServerEvent("onClientSync", resourceRoot) end ) addEventHandler("onClientResourceStop", resourceRoot, function() if ifp then for _,player in ipairs(getElementsByType("player")) do local _, otur = getPedAnimation(player) if (otur == "WEAPON_crouch") then setPedAnimation(player) end end destroyElement(ifp) end end ) server side : local animEnable = {} local syncPlayers = {} addCommandHandler("otur2", function(player) if (not animEnable[player]) then animEnable[player] = true triggerClientEvent(syncPlayers, "otur", player, true) outputChatBox("[!]#FFFFFF animation enabled.", player, 0, 255, 0, true) else animEnable[player] = false triggerClientEvent(syncPlayers, "otur", player, false) outputChatBox("[!]#FFFFFF animation disabled.", player, 255, 0, 0, true) end end) addEvent("onClientSync", true ) addEventHandler("onClientSync", resourceRoot, function() outputChatBox("done") table.insert(syncPlayers, client) for player, enable in ipairs(animEnable) do if (enable) then triggerClientEvent(client, "otur", player, true) end end end ) addEventHandler("onPlayerQuit", root, function() for i, player in ipairs(syncPlayers) do if source == player then table.remove(syncPlayers, i) break end end if (animEnable[source] == true or animEnable[source] == false) then animEnable[source] = nil end end ) Now I have decided to change the command you type in chat to do the animation(outr22) from this addCommandHandler("otur2", function(player) if (not animEnable[player]) then animEnable[player] = true triggerClientEvent(syncPlayers, "otur", player, true) outputChatBox("[!]#FFFFFF animation enabled.", player, 0, 255, 0, true) else animEnable[player] = false triggerClientEvent(syncPlayers, "otur", player, false) outputChatBox("[!]#FFFFFF animation disabled.", player, 255, 0, 0, true) end end) to this addEvent("otur2",true) addEventHandler("otur2",root, function(player) if (not animEnable[player]) then animEnable[player] = true triggerClientEvent(syncPlayers, "otur", player, true) outputChatBox("[!]#FFFFFF animation enabled.", player, 0, 255, 0, true) else animEnable[player] = false triggerClientEvent(syncPlayers, "otur", player, false) outputChatBox("[!]#FFFFFF animation disabled.", player, 255, 0, 0, true) end end) so what I did is I changed the way to do the animation from typing a command --> to press a button to do the custom animation clarification : when I press a button , the client side will trigger the server event which called otur2 to do the custom animation and here's the client side : function mouse2() if isMouseInPosition(1500, 240, 120, 120) and getKeyState("mouse1") then playSound("SFX/click.mp3") triggerServerEvent("otur2", localPlayer) end end addEventHandler ( "onClientClick", root, mouse2) and When I tested the script, a problem appeared to me ERROR: AnimationsPanel\smain.lua:9: table index is nil Knowing that the 9th line in server side is : animEnable[player] = true I didn't make any changes to the script As it is clear above, I just changed the command handler to event handler. I can't figure out what's wrong or fix it, could you help me? I hope my words are clear and I apologize if I took up too much of your time, thank you Other information: The benefit of this script is to make custom animations with server side , not just client side .. it's working when I use the command way, but it's not working with event handler
  5. @. - DmaR x سلام عليكم أخوي ، شكراً لانك نبهتني للموضوع .. الحمدلله قدرت اصلح هذه الاخطاء تقدر تجرب السكربت وتقولي رأيك ، شكراً. https://github.com/xMohab/mtasa-Animations-Panel
  6. @6rB. أولاً شكراً علي تعليقك الجميل يب صحيح ، انا ذكرت بأسفل الموضوع (Sas-Network/SASnet)بالنسبة للفكرة فـ هي مستوحاه من سيرفر قديم MrDante وقام بإنشائها SparrowMTA وقمت أنا بتطويرها بشكل كبير وإضافة الكثير من المميزات والإستعانة بأنيميشن بواسطة وطبعاً الحقوق محفوظة لكل من له علاقة بتطوير السكربت أو إنشاؤه ولو حابب تشوف السكربت القديم هذا هو : اضغط هنا وتقدر تقارن بين القديم والجديد
  7. اعذرني ، سويت السكربت علي حسب معرفتي البسيطة ف البرمجة في اقتراحات للتطوير من طريقة الكتابة ؟ ^-^ @. - DmaR x اعذرني ، سويت السكربت علي حسب معرفتي البسيطة ف البرمجة اللي مخلي السكربت طويل بسبب ان السكربت يحتوي علي الكثير من الحركات المختلفة في اقتراحات للتطوير من طريقة الكتابة ؟ ^-^
  8. سكربت لوحة الأنيميشن سكربت يُسهل عليك فعل الحركات كما انه يحتوي علي الكثير من الحركات التي يمكنك القيام بها. معاينة لمعلومات أكثر عن السكربت وحقوق المؤلفين https://bit.ly/AnimationsPanel تحميل السكربت مباشرة Github شكراً لـ @MrDante @SparrowMTA Developer#6617(discord) نسيت أقول شئ مهم : (Sas-Network/SASnet)بالنسبة للفكرة فـ هي مستوحاه من سيرفر قديم MrDante وقام بإنشائها SparrowMTA وقمت أنا بتطويرها بشكل كبير وإضافة الكثير من المميزات والإستعانة بأنيميشن بواسطة وطبعاً الحقوق محفوظة لكل من له علاقة بتطوير السكربت أو إنشاؤه شكرا
  9. فكرة جميلة ، بالتوفيق.
×
×
  • Create New...