Jump to content

Addlibs

Members
  • Content Count

    975
  • Joined

  • Last visited

  • Days Won

    4

Addlibs last won the day on February 10 2020

Addlibs had the most liked content!

Community Reputation

147 Excellent

6 Followers

About Addlibs

  • Rank
    Hard-@ss

Details

  • Location
    United Kingdom
  • Occupation
    Scripting Guru

Recent Profile Visitors

3,609 profile views
  1. rt = dxCreateRenderTarget(200, 400, true) --draw dxSetRenderTarget(renderImage,true) Did you mean rt instead of renderImage in dxSetRenderTarget? Edit: Nevermind, I see dxSetRenderTarget(rt,true) in a different place.
  2. Are these port forwarding rules enabled or just listed? Some routers allow you to add rules without having them enabled, so you can toggle them without having to delete and (re)create them every time.
  3. What do you mean by "line chart compatible to [with] mysql"? Charts have nothing in common with database servers (except perhaps ERDs). I'm going to assume you mean you have a database with a records of historical prices and you want to display them in a line chart, right? If so, what you want to do is query that database, retrieve the historical data -- it's date (X axis value) and the price (Y axis value) and plot these into a chart, then connect those plot points with dxDrawLine.
  4. Does this happen to all clients or just you? If just you, have you tried rebooting your device? "CRC could not open file: No such file or directory" suggests to me your OS is having trouble locating and/or opening the file. Perhaps it's a non-persistent issue that can be fixed with a reboot. Try rebooting the device the server's running on too if possible. Have you tired to see if the file downloads correctly into your client's downloads folder? (.../resources/factions/myriadproregular.ttf). Is it corrupted? Is it fine on the server too?
  5. Addlibs

    [Help-me]

    You haven't asked a question, and you've just pased your code without code tags. It's barely readable.
  6. If you search for the error string and go backwards, you'll find it's triggering condition is id being false, and id is defined as the return of SmallestElevatorID(). This means that function failed to return a correct value. So let's look at the function function SmallestElevatorID( ) -- finds the smallest ID in the SQL instead of auto increment local result = mysql:query_fetch_assoc("SELECT MIN(e1.id+1) AS nextID FROM elevators AS e1 LEFT JOIN elevators AS e2 ON e1.id +1 = e2.id WHERE e2.id IS NULL") if result then return tonumber(result["nextID"]) end return false end My bet is
  7. https://wiki.multitheftauto.com/wiki/AddPedClothes -> "Note: This function only works with peds using CJ skin (ID 0). " You can't use addPedClothes on non-CJ skins.
  8. bot isn't defined in attack or stopattack contexts. You need to declare the variable bot globally with bot = nil or declare it a local variable for the file by writing local bot at the top.
  9. Have you tried rudimentaly debugging steps? Have you checked /debugscript 3? Have you checked whether hoursplayed has a value and if it's numeric? You can check that with runcode (that is, make sure the runcode resource is running when attempting the following command) using /crun getElementData(localPlayer, "hoursplayed") If you're not getting debug errors in debugscript, I'd bet that hoursplayed element data is nil, and gets coalesced to 0 on this line elseif (getElementData(localPlayer, "hoursplayed") or 0) < 50 then and compared against 50, 0 is less than 50, so entire condi
  10. The reason is that your script only has storage for one flames element, while there can be multiple people. What you need to do is use tables, with the vehicle element as the key, and its flames element as the value. That way, you index the table to get the element, check if it exists, delete it if so, create new one if necessary, etc. Here, I've fixed one of the functions for you as an example, and you should be able to -- beginning of serverside code firethrusters = { --structure: [vehicle] = {[1] = firethrustl, [2] = firethrustr} } -- ... the rest of the code here ... function
  11. Addlibs

    help

    for i,v in pairs(WhellTable) do WhellTable is not defined and hence a 'nil' value where a table was expected. It appears it's structure should be something like WhellTable = { ["key"] = {"text1", "text2"}, [1] = {"sampletext1", "sampletext2"}, } yielding a gridlist rows "(key) text1 | text2" where | denotes a new column for the first item, and "(1) sampletext1 | sampletext2" for the second item.
  12. I'd avoid using files, they're more of a hassle to work with, you have to save manually, etc. They're useful for configurations and whatnot. Databases are better, and you can index, sort and filter the logs much easier with SQL. dbQuery, and db* functions in general, don't cause server lag, only dbPoll if you use -1 for timeout as it awaits results of the query, but for adding entries into the logs you don't need to poll at all; poll is only needed to retrieve the logs, and async callback can let you know when the result is ready without freezing the server.
  13. If you're looking for someone to script it for you, you'd be better off trying here ☞ https://forum.mtasa.com/forum/149-looking-for-staff/ If you want to attempt it yourself: addEventHandler onMarkerHit takeAllWeapons
  14. If every pickup does a different message, it would be best to do something like messages = { [pickupSource1] = "message for hitting pickupSource1", [pickupSource2] = "message for hitting pickupSource2", ... } addEventHandler("onPickupHit", resourceRoot, function(player) if messages[source] then -- if a message is defined for this pickup element outputChatBox(messages[source], player) -- output that message to the player that hit it cancelEvent() end end )
  15. If you want the bus to not interfere with other players at all and not be seen by them, your best bet is to just spawn the bus client-side, and a ped-clone of the player. Have this ped play the animation of entering the bus, preferably have the ped attached to the bus at the right offset to ensure that the animation will play in the right place all the time. Then, at the right time, have the ped warpPedIntoVehicle, or just destroy/place them away from the screen. The client-side bus can have another ped to be it's driver, and you can use setPedControlState to have the bus accelerate as the cam
×
×
  • Create New...