Jump to content

HassoN

Members
  • Posts

    636
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by HassoN

  1. ماعندي اي فكرة ... ممكن حاط مقاسات شاشتك غلط...؟
  2. انا عن نفسي استعمل الطريقة الاتية local x, y = guiGetScreenSize ( ) local sx, sy = 1600, 900 -- مقاسات شاشتك -- مثال dxDrawText("TEST", 100, 200, 300, 400) -- الكود ذا على شاشتي فقط dxDrawText("TEST", x * (100/sx), y * (200/sy), x * (300/sx), y * (400/sy)) -- لجميع الشاشات وصلت الفكرة؟
  3. بالمتغيرات .. حط متغير بعد مايسجل الدخول وتحقق لو موجود المتغير ذا مايسوي الصورة مثال visible = true -- حطها بعد مايسجل دخوله if (visible) then -- حطها داخل كود الصورة return false end
  4. You may use: addCommandHandler -- to make the command like you've said 'lmute'. getPlayerFromName -- get the player's name from what you've typed in the command. setElementData / setAccountData -- use either of them to give data to the player you want to mute. Then you should modify your local chat script and add a check, it should be something like: if getElementData(...) then return false end since MTA doesn't have a local chat system he's talking obviously about a custom chat system. You may use: addCommandHandler -- to make the command like you've said 'lmute'. getPlayerFromName -- get the player's name from what you've typed in the command. setElementData / setAccountData -- use either of them to give data to the player you want to mute. Then you should modify your local chat script and add a check, it should be something like: if getElementData(...) then return false end since MTA doesn't have a local chat system he's talking obviously about a custom chat system.
  5. You're welcome! Yes. You may use getPedAnimation
  6. Ugh yea that's true. I've tried it with onPlayerChat and it worked so I thought it could work with onPlayerJoin as well. Thanks for the correction tho
  7. Taking your example of addEvenHandler("onPlayerJoin", root, function() It will trigger whenever a player connects because you used 'root'. But if you for example replace root with a specific player it only trigger when THAT player connects. An example: addEventHandler("onPlayerJoin", getPlayerFromName("HassoN"), function() outputChatBox("HASSON IS HERE", root) end) The outputChatBox will only be triggered if a player called HassoN joins. Got it?
  8. Player's position isn't going to change if the player dies, unless you spawn him somewhere else. So nope. My code should work.
  9. ألا فهمتك كويس ، المفروض تسوي شي زي كذا local red = guiRadioButtonGetSelected(redButton) local green = guiRadioButtonGetSelected(greenButton) local blue = guiRadioButtonGetSelected(blueButton) if (red) then r, g, b = 255, 0, 0 elseif (green) then r, g, b = 0, 255, 0 elseif (blue) then r, g, b = 0, 0, 255 end -- وكذا يكون عندك اللون بال r, g, b
  10. hosp_loc = { {-2655, 635, 14, 180}, -- San Fierro {2038, -1411, 17, 130}, --Jefferson {1173, -1323, 15, 270}, -- All Saints {1242, 327, 19, 340}, -- Red County {1609, 1816, 12, 360}, -- Las Venturas {-2200, -2311, 30, 320}, -- Angel Pine {-320, 1049, 20, 0}, --Fort Carson - Bone County {-1514.5, 2524, 56, 0} --Tierra Robada } function getDistance(thePlayer) local dist = 9999999 local data = nil for _, v in ipairs ( hosp_loc ) do local x, y, z = getElementPosition (thePlayer) local c = getDistanceBetweenPoints3D ( x, y, z, v[1], v[2], v[3] ) if ( c <= dist ) then dist = c data = { v[1], v[2], v[3], v[4]} end end if (data) then skin = getElementData(thePlayer, "respawn-skin") spawnPlayer(thePlayer, data[1], data[2], data[3], data[4], skin) setElementModel(thePlayer, skin) fadeCamera(thePlayer, true, 2.5) end end function Respawn() local skinid = getElementModel(source) setElementData(source, "respawn-skin", skinid) setTimer(getDistance, 7500, 1, source) end addEventHandler("onPlayerWasted", root, Respawn)
  11. guiGetText -- جيب الكلام الي بالادت بوكس guiRadioButtonGetSelected -- تحقق انه مختار الراديو بوتون outputChatBox -- طلع الكلام
  12. الكود يسويلك دوائر بالعبة ، تقريباً عشان شكل الماركرات؟ ما ادري ايش كان استعمالها
  13. What do you mean by saving it for each team? like an xml for each team? then create separated xml files for each one and apply the same functions.
  14. Probably because of the forum, sometimes it adds an invisible character at the end. Try to delete the last character after the ')' to fix it. PS: I tried to take the code into my notepad++ and I could delete something invisible lol.
  15. Try function weaponSwitch(weapon) if source == localPlayer then local ammoName,_ = getWeaponAmmoType2(weapon,getElementData(localPlayer,"currentweapon_1"),getElementData(localPlayer,"currentweapon_2"),getElementData(localPlayer,"currentweapon_3"),getElementData(localPlayer,"selectedWeapon")) if getElementData(localPlayer, ammoName) > 0 then setElementData(localPlayer, getElementData(localPlayer,ammoName)-1) outputChatBox(tostring(getElementData(localPlayer, ammoName)-1)) end end end addEventHandler("onClientPlayerWeaponFire", getLocalPlayer(), weaponSwitch) You forgot the first argument in 'setElementData'.
  16. How could a simple 'outputChatBox' stop your inventory from running? Post your /debugscript 3 info. You've said that your ammo gets reset when you switch guns so you need to look for something like onClientPlayerWeaponSwitch in your code.
  17. guiGetText triggerServerEvent xmlLoadFile xmlCreateChild xmlNodeSetAttribute xmlSaveFile xmlUnloadFile
  18. addDebugHook بتسوي مشاكل انا عن نفسي استخدم داتا بالفلوس عشان اقدر استعمل onElementDataChange onClientElementDataChange بكل اريحية
  19. عفواً ? المرة الجاية نزل موضوعك بالقسم العربي https://forum.multitheftauto.com/forum/134-البرمجة/
  20. تأكد انك حاطه جهة سيرفر
×
×
  • Create New...