Jump to content

Aibo

Retired Staff
  • Posts

    1,105
  • Joined

  • Last visited

Everything posted by Aibo

  1. well alignment is quite simple, you just need box size (meaning it'll require more than just starting x/y) and just calculate top/left offset using box size and textline size. now word wrapping support — that's sophisticated
  2. add alignment support, shouldn't be too hard ps: viewtopic.php?f=91&t=30227&p=347694#p347694
  3. so many messages and noone even started to explain the logic behind teleport request/confirmation
  4. Aibo

    Redundant GUI Code

    because you're setting ready=true at first iteration and then exiting the loop using break. you dont really need break/ready stuff, it will stop and event wont be triggered after "return false" elseif source == create_Btn then for i, element in pairs(getElementChildren(addTab)) do if getElementType(element) == "gui-edit" then if guiGetText(element) == "" or guiComboBoxGetSelected ( combobox_Class ) == -1 or guiComboBoxGetSelected ( combobox_Int ) == -1 or guiComboBoxGetSelected ( combobox_Dim ) == -1 then outputChatBox ( "ERROR, make sure all information is entered", 255, 0, 0 ) return false else int = guiComboBoxGetItemText ( combobox_Class, guiComboBoxGetSelected ( combobox_Class ) ) dim = guiComboBoxGetItemText ( combobox_Dim, guiComboBoxGetSelected ( combobox_Dim ) ) class = guiComboBoxGetItemText ( combobox_Int, guiComboBoxGetSelected ( combobox_Int ) ) table.insert(guiEditInputs, guiGetText(element)) end end end triggerServerEvent ( "addPropertyToDatabase", getLocalPlayer(), int, dim, class, guiEditInputs ) end
  5. Aibo

    Redundant GUI Code

    -- you can check gui elements' type, and editbox element type is "gui-edit": for i, element in ipairs(getElementChildren(someParentElement)) do if getElementType(element) == "gui-edit" then -- your check or whatever goes here end end ------------------------------------------------------------------------------------- -- you can also put all your edits in a table like: myEdits = {} myEdits[1] = guiCreateEdit(blablabla) myEdits[2] = guiCreateEdit(blablabla) -- etc. -- and then just loop through them and check: for i, edit in ipairs(myEdits) do -- your check or whatever goes here end
  6. just check the goddamn element TYPE before using element type-specific functions.
  7. Aibo

    Question

    something like that probably. but you better use SQL for things like that. function getPlayerWithTopKills() local player = false local kills = 0 for i, p in ipairs(getElementsByType("player")) do if kills < getElementData(p, "kills") then kills = getElementData(p, "kills") player = p end end return player, kills end PS: math.max has different purpose/usage.
  8. string1 = "foo" string2 = "bar" string3 = string1..string2 -- "foobar"
  9. you should remove thumbs.db from archive, they add about 300kB in filesize. also here's the goggles: and 2 cameras (not sure which view is better): PS: brass knuckles and chainsaw if you'll like em.
  10. guiLabelSetHorizontalAlign see wordwrap argument.
  11. Bssol: actually i've posted the same thing.
  12. Aibo

    Mybb Login

    what about salt?
  13. probably some account data is not set: local who_exp = getAccountData(playeraccount,"exp") or "0" local who_lvl = getAccountData(playeraccount,"level") or "0" local who_rank = getAccountData(playeraccount,"rank") or "None"
  14. function showGui(player) if isElementWithinColshape(player, yourSafeZoneColshape) then triggerClientEvent(player, "viewGUI", root) end end addCommandHandler("shop",showGui)
  15. to get width you just need health% / 100 * bar full width. and it shouldn't change position. either you're not showing the whole code (you lost 30 hp but you set bar size with some "n" variable?), or no idea.
  16. easier way would be using absolute positioning. and i dont really get your relative values. are you sure you got them right? relative means relative to the parent. and what the purpose of 0.05 to 0.19 and 1 to 0.032?
  17. why are you changing position then?
  18. you need the server to tell all the clients what to do. so the same code would be executed on all clients, not just one who typed the command. there is an event system for that.
  19. 1. dont double post 2. both your topics are in wrong forums 3. viewtopic.php?f=108&t=25351&p=374416#p374416
  20. search forums, it was discussed at least 2 times.
  21. maybe because it gets random skin only once, not every time "haveHookerJob" event is called. you should move "hookerids = hookeridlist[math.random(#hookeridlist)]" line into the handler function.
  22. why do you want to sync things in element data that are already synced by MTA? too much spare bandwidth?
  23. why you put arguments outside function call? this is going nowhere. function giveArmor() local pC= getAlivePlayers() if (#pC >= 1 and #pC <= 3) then for id, player in ipairs(pC) do setPedArmor(player, 50) outputChatBox(getPlayerName(player).." has won 50% Armor For Alive on Round", root, 0, 255, 0) outputChatBox("You Have won Free Armor for be Alive in Round", player, 255, 255, 0) end end setPedArmor(source, 0) end addEventHandler("onPlayerWasted", root, giveArmor)
×
×
  • Create New...