Jump to content

Addlibs

Members
  • Posts

    1,060
  • Joined

  • Last visited

  • Days Won

    9

Everything posted by Addlibs

  1. processLineOfSight returns some the normal of a surface, this might help.
  2. Please be considerate and don't remove code after you solve it - others might be looking for a solution to the exact same problem. If you really want to remove your code, you could just describe what was your issue and how you fixed it, so others don't have to start new topics.
  3. Addlibs

    Little problem

    Any other errors? It might be possible that your client code isn't even loaded due to an error.
  4. If you do it to only occur if 1 is picked out of 10 possibilities, it is basically 1/10 chance, which is also known as 10%. if math.random(1,10) == 1 then --give bonus end
  5. Decide what you want, random chance, or percentage of some value to be a bonus.
  6. if math.random(1,10) == 1 then --give bonus end
  7. When the function is called, is anything passed as the 1st parameter? If not, it explains why you don't get teleported - setElementPosition expects a ped/player as the first argument, not a nil.
  8. This function, is thePlayer a non-nil variable?
  9. Is thePlayer defined within that function?
  10. Yeah, it just complicates things - store it as {vX, vY, vZ} and retrieve with vX, vY, vZ = unpack(gridlistItemData)
  11. How is the position stored? A string of comma separated numbers, or a table of numbers?
  12. guiGridListGetSelectedItem --also, check the example there
  13. TAPL is right. Your IF criteria is made in such a way that if ANY of the aforementioned is filled out, it proceeds with the code. Changing all 'or' into 'and' would make it proceed if ALL of the aforementioned is filled out.
  14. You don't attach it to a button - you create a button and attach a function to it, one that will check with item from the gridlist is selected, chiefly, the name of the item, and it's data (along with the position stored within), and just setElementPosition to that position.
  15. --New Syntax element dxCreateFont ( string filepath[, int size=9, bool bold=false, string quality="default" ] ) quality can be "default", "draft", "proof", "nonantialiased", "antialiased", "cleartype" and "cleartype_natural", as far as I understand from the source code. There are some requirements for "nonantialiased", "antialiased", "cleartype" and "cleartype_natural", per WINVER (Windows Version, I guess?) or something, but I don't really understand them. Have a look yourself if you want to https://github.com/Kernell/mtasa-blue/b ... .h#L42-L50
  16. Give the jetpack to client, it is the variable representing the game client that called the request/event. However, using some cheats, people might be able to fraudulently call this event despite the fact they're not actually VIP, so you should further check if the request originated from a VIP player.
  17. Why would you want to save the money formatted? It should be a number value. You need to alter your SQL table if you want to store a string instead of a number. Its a lot more efficient to store the number 99,999,999 as 99999999 (4 bytes) than as 99,999,999 (10 bytes) (it's not because of the commas), furthermore, all Lua functions take money as a number, not a formatted string, so you'll waste CPU to un-format the number.
  18. 1) You haven't even created a browser in your code, add guiCreateBrowser anywhere between line 7 and line 1, making the window its parent. This is the reason why you have a Bad argument error at addEventHandler, the source you've specified is false, not the GUI browser. 2) Secondly, you haven't specified what function the event handler should call, i.e. you failed to specify the 3rd argument at addEventHandler
  19. function getPlayerNameWithoutTags(player) local name = getPlayerName(player) return string.gsub(name, "\[.*\]", "") end Edit: I failed with escaping. Sorry. The slashes (\) should be percent symbols (%).
  20. Addlibs

    [HELP] Please

    You seem to combine both a clientside function getLocalPlayer and the server side syntax of outputChatBox. Is the code clientside or serverside?
  21. You could make the box a render-target, then everything outside the render-target region won't be displayed. If you prefer, you can do some math with dxDrawImageSection and use that.
  22. Theoretically speaking, you could use CEF to open up the Youtube video but make the browser invisible, leaving just the sound — however, I am unsure if that is possible since I haven't used CEF yet myself.
  23. script.lua:5: attempt to concatenate local 'sourcePlayer' (a userdata value) means that you tried to join a string with a userdata (more specifically, userdata:element:player) value. You tried to embed the memory address for a player instead of his nickname (getPlayerName) outputChatBox("L'Admin: " .. sourcePlayer " vous à mis votre HP à " .. value .. ".", targetPlayer) should be outputChatBox("L'Admin: " .. getPlayerName(sourcePlayer) .." vous à mis votre HP à " .. value .. ".", targetPlayer)
  24. table.remove() But you should loop the table backwards in this case Be careful when looping a table where you intend to delete multiple rows, if 2 of them are in a row the 2nd one will get skipped! You must loop the table backwards (reverse ipairs). For example: for i = #table, 1, -1 do(Read more at Scripting Tips)
  25. Use isPedInVehicle() in conjunction with getPedSimplestTask() == "TASK_COMPLEX_CAR_DRIVE" (not sure, but this should work for passengers as well), or try testing for an array (table) of specific tasks, including tasks like TASK_COMPLEX_DO_DRIVEBY. Find all tasks here: List of player tasks
×
×
  • Create New...