Jump to content

iiv03

Members
  • Posts

    476
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by iiv03

  1. thx guys i can save player name? on getaccountdata/setaccountdata? functions: setPlayerName getPlayerName i don't know if work. setAccountData(playerAccount, "playerName", newName) -- when player press button and get event (newName) from triggerclientevent to save it in setaccountdata function lobby.load(_ theCurrentAccount) local newName = getAccountData(theCurrentAccount, "playerName") -- get account data if player login if newName then setPlayerName(source, newName) end -- setplayername print(newName) -- this for test but doesn't work in debug write me false end
  2. thx. u mean like this addEventHandler("onPlayerLogin", root, function(_, theCurrentAccount) local acc = getAccountData(theCurrentAccount,"AccountPlayer") if acc then setAccountData(theCurrentAccount,"AccountPlayer",true) end end)
  3. hey, i won't to use SQL to save data. account player but but is this the way to save data account player and if entry he gets data account? my code: function lobby.save(newName, newAge, newCountry, player) if not isElement(player) then return end local thisAccount = getPlayerAccount( player ) if thisAccount then setAccountData(thisAccount,"AccountPlayer",newName) setAccountData(thisAccount,"AccountPlayer",newAge) setAccountData(thisAccount,"AccountPlayer",newCountry) print("done save in data") else print("failed to save in data") end end addEventHandler("onPlayerLogin", root, function(_, theCurrentAccount) local acc = getAccountName(getPlayerAccount( source )) if acc then getAccountData(theCurrentAccount,"AccountPlayer") end end) EDIT: how check if is new account ?
  4. thePlayer مفروض تكون ب سرفر سايد وذا الكود حق الكلينت سايد عشان تجيب حدث التيم الاعب استخدم setElementData getElementData
  5. i am trying to use theSkin event in the table and it did not work I did this function test () local theSkin = getElementModel (localPlayer) end however problem is that there was no event in theSkin when i inserted it into the function I did it like this local function test () local theSkin = getElementModel (localPlayer) end same thing I just want to enter getElementModel inside the function and make it read in the table how? btw table under function test
  6. hey, i have a question why getElementModel can't find a skinid when he changes it?, i used some setElementModel. and could not find the skin number (getElementModel) from createPed Functions.skinID = {280,281,282,265,266,267,283,284,285,286,288} skin = createPed ( Functions.skinID[1], 2749.7502441406,-2232.7170410156,61.727611541748,60 ) function skins() setElementModel(skin,Functions.skinID[math.random(#Functions.skinID)]) end addCommandHandler("changeskin",skins) local theSkin = getElementModel( skin ) function test() print(theSkin) end addCommandHandler("skin",test)
  7. سمعت انه يمديك تتحكم من المود داخل سيرفر عن طريق اللوحه اللي صممتها ب سي شارب مأدري اذا هاذي ...
  8. this topic is too old I think it closes better
  9. مبتدئ ب سي شارب ايش برنامج استخدمه عشان اسوي كذا أعتقد visual studio او شيئ كذا سوي شرح كيف ربط لأهنت C# -> Lua او عكس
  10. EDIT: it's work with table.sort thanks guys
  11. do you mean like this? local theplayers = {} for i,player in pairs(players) do local thetables = {name = getPlayerName(player), alive = getElementData(player,"state") == "alive", points = getElementData(player,"ThePoints") or "0"} table.insert(theplayers, thetables) table.sort(theplayers, function(a, b) return a.points > b.points end ) end
  12. i just want to know in your code how set that in dxDrawText like what say in above if he got top value number move in place first
  13. how make the number if the highest moves the player in the first place like toptime). what do I use? Loop and executeSQLQuery?
  14. addCommandHandler استخدم فاكشن ذا يضيف أمر
  15. الولد شكله يقصد سكور بورد طفيه من لوحه ادمن
  16. اول مأشفت الشرح علي الأول فهمته مشكور والله يعني نفس طريق حق جلب لاعبين الأسامي? تصير كذا local t = {name = getPlayerName(player),alive = getElementData(player,"state",) == "alive", points = getElementsData(player,"ThePoints") or "0"} -- text dxDrawText(player.points.....etc سويت علي جوال صح؟
  17. ؟؟؟ مشكور علي ردك لايف بكرا بشيك عليك عليه حاليا عندي جوال مقدر افتح جهاز ضروف ?
  18. من سرفر للكلينت addCommandHandler("give", function(player, cmd, ...) local args = {...} -- example: bot 7777 robot 8888 unknown 9999 -- we know: every 2th arg is the amount local args_count = #args if args_count < 2 or args_count % 2 ~= 0 then return outputChatBox("USE: /"..cmd.." [name amount / number amount]", player) end -- minimum need 2 argument -- loop datas for i = 0, args_count/2-1 do local name = args[i*2+1] local amount = tonumber(args[i*2+2]) if amount and amount < 101 then local target_player = getPlayerFromPartialName(name) if isElement(target_player) then local theplayer = getPlayerName(player) outputChatBox("Player "..theplayer.."#ffffff has give points "..amount.. " to " .. getPlayerName(target_player), root, 255, 255, 255, true) setElementData(target_player,"ThePoints",amount) else outputChatBox("Player " .. name .. " not found.", player) end else outputChatBox("Invalid amount '"..(args[i*2+2]).."' for "..name.." please use a number between 0 - 100", player) end end end) مسويه الأرجيمنت الأول يخزن عند الاعب ثاني و ارجيمنت ثالث اختيار رقم
  19. سهل بعطيك طريق بسيطه عشان تربط سرفر سايد ب كلينت للفاكشن function greetingHandler ( ) -- فاكشن outputChatBox ( "Hello There" ) -- النص الي بيضهر ب شات end -- نهاية فاكشن addEvent( "onGreeting", true ) -- ضفنا حدث addEventHandler( "onGreeting", localPlayer, greetingHandler ) -- نضيف معالج الحدث -- سرفر سايد function greetingCommand ( playerSource, commandName ) triggerClientEvent ( playerSource, "onGreeting", playerSource ) -- ارجيمنت الأول يرسل الي ... مثلن الاعب بس و الأرجيمنت ثاني يعني اسم حدث الي سويناه ب كلينت سايد ارجيمنت ثالث يعني عنصر الحدث بيكون نفس الأول end addCommandHandler ( "greet", greetingCommand ) -- أمر عشان يطبق في سيرفر سايد شرحي ب جوال
  20. سويت بيانات ب سيرفر ورسلته للكلنت الي هي ThePoints مافيه اخطأ بس مشكله عشان يضهر التيكست صبر بعطيك جدول الي فوق عشان حين انا ب جوال ذي اكواد function get_team_alive_players(enemy) local team_name = homeName if enemy then team_name = enemyName end local team = getTeamFromName(team_name) if team then local players = getPlayersInTeam(team) if type(players) == "table" and #players > 0 then local output = {} for i,player in pairs(players) do local alive = getElementData(player,"state") if alive ~= "alive" then alive = false end local t = {name = getPlayerName(player), alive = alive} do table.insert(output,t) end end return output end end return false end local players = get_team_alive_players()
  21. يا حبيبي انت شايف حاله on بعده تحط اكوادك الي تبغاه وال off نفس شيئ بس العكس يكون والأسم فاكشن function أسم هنا سويه تبغاه بس ب حوف انجلش مافي عربي ومسافه انت الي عليك بس تسوي فحص للأمر تبغاه في حاله ولاتنسى تضيف حاله ايضا في فاكشن عشان يتعرف مثل كذا function (state) حين اكتب لك من جوال اذا فيه اخطأ ب كتابه سوري.
  22. اسم وظيفة فانكشن سميه الي تباه انت
  23. سيرفر سايد جرب ذا سأنتكس يكون /this [on/off] فاكشن سويت ب دقيقه لو فيه اي خطأ ديبوق function anyname(thePlayer, commandName, state) if state == "on" then -- اذا يفحص الحااله الأمر هاذا -- سوي تبغاه هنا. end if state == "off" then -- يفحص نفس شيئ الحاله اذا انت كتبت هذا بعد الأمر الأول! --سوي تبغاه end end -- نغلق فاكشن addCommandHandler("هنا أمر تبغاه الاول", anyname)
  24. ألسلاع عليكم ورحمة الله وبركاته معي مشكله باللوب والعنصر بيانات for i,player in pairs(players) do local points = getElementData(player, "ThePoints") or "0" dxDrawText(points,posX+sizeX+sizeX+10-row_size-row_size-row_size,posY,posX,posY+row_size,tocolor(255,255,255,generalAlpha),clanwar.fontScale,clanwar.font,"center","center",true,false,false,true) end end شيكت ب ديبوق يجيب got table ال players مسوي له فوق تيبل يا ريت حد يساعدني
  25. منور بتوفيق يالغالي عجبني التصميم موقع حقك وش استخدمت؟ html,css,js,Lua بس؟
×
×
  • Create New...