Jump to content

HassoN

Members
  • Posts

    636
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by HassoN

  1. I am not really an expert with vehicle's handling but something like: "dragCoeff", "mass" or "turnMass" could do the work I guess?
  2. Try to play with the properties of the car using: setVehicleHandling
  3. That's true but you are calling it once the resource starts so it won't make any difference... for example you could do something like: function createLoginWindow() local X = 0.375 local Y = 0.375 local Width = 0.25 local Height = 0.25 wdwLogin = guiCreateWindow(X, Y, Width, Height, "Please Log In", true) X = 0.0825 Y = 0.2 Width = 0.25 Height = 0.25 guiCreateLabel(X, Y, Width, Height, "Username", true, wdwLogin) Y = 0.5 guiCreateLabel(X, Y, Width, Height, "Password", true, wdwlogin) X = 0.415 Y = 0.2 Width = 0.5 Height = 0.15 edtUser = guiCreateEdit(X, Y, Width, Height, "", true, wdwlogin) Y = 0.5 edtPass = guiCreateEdit(X, Y, Width, Height, "", true, wdwLogin) guiEditSetMaxLength(edtUser, 50) guiEditSetMaxLength(edtPass, 50) X = 0.415 Y = 0.7 Width = 0.25 Height = 0.2 btnLogin = guiCreateButton(X, Y, Width, Height, "Log In", true, wdwLogin) guiSetVisible(wdwLogin, true) showCursor(true) guiSetInputEnabled(true) outputChatBox("Welcome to My MTA:SA Server, please log in.") end addEventHandler("onClientResourceStart", resourceRoot, createLoginWindow) Instead of your 2 functions code: function createLoginWindow() local X = 0.375 local Y = 0.375 local Width = 0.25 local Height = 0.25 wdwLogin = guiCreateWindow(X, Y, Width, Height, "Please Log In", true) X = 0.0825 Y = 0.2 Width = 0.25 Height = 0.25 guiCreateLabel(X, Y, Width, Height, "Username", true, wdwLogin) Y = 0.5 guiCreateLabel(X, Y, Width, Height, "Password", true, wdwlogin) X = 0.415 Y = 0.2 Width = 0.5 Height = 0.15 edtUser = guiCreateEdit(X, Y, Width, Height, "", true, wdwlogin) Y = 0.5 edtPass = guiCreateEdit(X, Y, Width, Height, "", true, wdwLogin) guiEditSetMaxLength(edtUser, 50) guiEditSetMaxLength(edtPass, 50) X = 0.415 Y = 0.7 Width = 0.25 Height = 0.2 btnLogin = guiCreateButton(X, Y, Width, Height, "Log In", true, wdwLogin) guiSetVisible(wdwLogin, false) end addEventHandler("onClientResourceStart",getResourceRootElement(), function () createLoginWindow() outputChatBox("Welcome to My MTA:SA Server, please log in.") if (wdwLogin ~= nil) then guiSetVisible(wdwlogin, true) else outputChatBox("An unexpected error has occurred.") end showCursor(true) guiSetInputEnabled(true) end ) Filling your script with duplicated functions is not always a good idea.
  4. set guiSetVisible to true at line 29 and remove that useless check at line 37-41
  5. Don't forget to add type="server" as well!
  6. This warning means your font was failed to load so it is returning 'false' value. Make sure that you've added the font to your meta and/or make sure of the spelling of the file's name.
  7. function loginHandler(username,password) if username =="user" and password =="apple" then if (client) then spawnPlayer(client, 1959.55, -1714.46 , 16) fadeCamera(client, true) setCameraTarget(client, client) outputChatBox("Welcome to My Server.", client) end else outputChatBox("invalid username and password. Please re-connect and try again.",client) end end addEvent("submitLogin",true) addEventHandler("submitLogin",root,loginHandler) That code should be in server side.
  8. HassoN

    سوال

    isPlayersHaveSameElementData (v,"DataName") مثالك غير منطقي ، تبي تتحقق ان اللاعب عنده نفس الالمنت داتا .. طيب مقارنتاً مع من؟ ناقصك ارقمنت اللاعب الثاني الي قاعد تقارن معاه .. ولا انا غلطان؟ المفروض شي زي doPlayersHaveSameElementData(player1, player2, "dataName") على كل حال لو تريد تجيب اللاعبين الي معهم نفس الالمنت داتا جرب تسوي لوب داخل لوب عشان تجيب كل اللاعبين وتقارنهم بكل اللاعبين واذا تطابق الداتا تسوي الي تريده شي مثل for i, player1 in ipairs(getElementsByType("player")) do for i, player2 in ipairs(getElementsByType("player")) do if (player1 ~= player2 and getElementData(player1, "data") == getElementData(player2, "data") and getElementDimension(player1) == getElementDimension(player2)) then -- your code end end end بس الطريقة ابداً غير جيدة وما انصح فيها
  9. HassoN

    سوال

    "لو سمحتم محتاج طريقة اني اتحقق ان كل اللاعبين في العالم الوهمي معاهم نفس الالمنت داتا" ^ ذي طريقة التحقق ولو قصده شي ثاني خليه يوضح عشان مافهمت
  10. HassoN

    سوال

    for i, v in ipairs(getElementsByType("player")) do if (getElementDimension(v) == 6969 and getElementData(v, "DATA") == "DATA") then -- your code end end
  11. الله يسلمك ?
  12. هل الداتا بيس قاعدة تتحدث؟ هل باقي الاشياء غير الاسلحة بتنحفظ؟ المشكلة انه ماتاخذ الاسلحة لما تموت بس؟
  13. لا ، لكن بتروح اول مايصير للاعب سباون
  14. وعليكم السلام 1- انصحك تسوي الحفظ لما اللاعب يموت / يخرج من السيرفر بدل ماتحفظ كل 5 ثواني 2- بدل حدث onPlayerLogin + onPlayerWasted استعمل onPlayerSpawn عشان لو بتعطي حد سلاح لازم يكون مرسبن ، طيب ولو سجل دخوله ومارسبن؟ (يعتمد على القيم مود حقك) فـ ماراح يشتغل وموضوع انك تعطيه سلاح بعد ما يموت برضو خطاء عشان ممكن ياخذ اكثر من 5 ثواني ويرسبن
  15. Use setControlState -- forward, sprint, walk setPedRotation -- to obviously change player's rotation when the police officer changes his. With some calculations you may achieve your goal
  16. removeElementData -- تشيل الالمنت داتا ، يشترط تكون موجودة قبل ما انك تشيلها setElementData(..., nil) -- تحط قيمة الالمنت داتا nil setElementData(..., false) -- تحط قيمة الالمنت داتا false بالحالة ذي بيكونون removeElementData + setElementData(..., nil) نفس الشي لانهم يحذفون الداتا لكن الاخيرة بتحط قيمتها false مع العلم انه اي المنت داتا غير معرقة راح ترجع لك false بكل الاحوال
  17. المفروض الاكاوانت داتا تنحفظ ، الزبدة مدري لو فيه مود يحولك كل الاكاونت داتا لقواعد بيانات
  18. بالنسبة للطلب الثاني https://community.multitheftauto.com/index.php?p=resources&s=details&id=9573 اعتقد ذا بيسوي المطلوب
  19. if you mean by 'USE_MAXSP_LIMIT' speed limit then you may use 'maxVelocity' instead.
  20. ممكن تشتري دومين وتسوي موقع خاص فيك مثل Mosfata.com او تدور دومين وخادم مجاني وبيكون شي غريب زي mostafa.blabla.com بس بالحالتين تقدر
  21. logs باختصار زي موضوع ال file اسهل طريقة ممكن تسويها ، تحفظ الشات الي يجي بملف وتربط سيرفرك بموقع وتسحب الفايل ذا ع الموقع وبيكون يتحدث دائماً مع شات السيرفر
  22. "USE_MAXSP_LIMIT" is not a valid property. Check the full table of valid properties here: https://wiki.multitheftauto.com/wiki/SetVehicleHandling
  23. local timers = {} function onNickChange() local acc = getPlayerAccount(source) if (not acc) then cancelEvent() return false end local data = getAccountData(acc, "spam") or 0 if (data >= 4) then cancelEvent() kickPlayer(source, "spam") return true end setAccountData(acc, "spam", data + 1) if (not isTimer(timers[source])) then timers[source] = setTimer(function(acc, plr) setAccountData(acc, "spam", 0) timers[plr] = nil end, 24*60*1000, 1, acc, source) end end addEventHandler("onPlayerChangeNick", root, onNickChange)
  24. executeSQLQuery('INSERT INTO moneySystem2 (theMoney,playerSerial) VALUES(?, ?)',getPlayerMoney(v),getPlayerSerial(v)) مع العلم الي قاعد تسويه غلط كبير جداً ، تحدث الداتا بيس كل 50 ملي ثانية !!! وفوقها داخلها لوب !! كارثة من اللاق
×
×
  • Create New...