• Content count

  • Joined

  • Last visited

  • Days Won


Hale last won the day on June 21

Hale had the most liked content!

Community Reputation

26 Good


About Hale

  • Rank
  • Birthday 11/12/90


  • Location
  • Interests
  1. What are you talking about?
  2. Can you please send us the function that is triggering "addPlayerToGroup" event? We don't know what's being sent as arguments.
  3. dbExec isn't supposed to return anything. You aren't using dbExec properly, please open the function in wiki and carefully read it (Usage of '?' and '??'). dbPoll returns a second argument, which is the number of affected rows. Again, read more about it on wiki, there are good examples on how to use it as well.
  4. You should really inform yourself more of how Lua works in MTA before going onto something like this. The code I provided doesn't go in any of these, like I said it should go in a different file, where the onCharacterLogOut function is. If this doesn't work, try going client-side and use onClientPlayerDamage event, which will trigger a function that triggers a server event that then triggers the function that has setPedStat in it. I made it complicated for a reason, once you understand what I wrote you'll be ready to make this work.
  5. You can use: if TruckVehiclesTable[truckElement] and isElement(TruckVehiclesTable[truckElement]) and getElementType(TruckVehiclesTable[truckElement]) == "vehicle" then destroyElement(TruckVehiclesTable[truckElement]) end
  6. Never actually thought of such way, nicely done mate!
  7. Here's an example: local x, y, z = getElementPosition(TruckVehiclesTable[truckElement]) trailer = createVehicle(515, x, y, z) attachTrailerToVehicle(TruckVehiclesTable[truckElement], trailer) I suggest you also put created trailer into a table so you can easily delete it.
  8. Hello to whoever is reading this topic, today I've decided to take some time and explain in (personally) easiest possible way how to make a drawing or a GUI that will fit all resolutions, no matter if it's 1280x1024 or 640x480. Here are the following steps: Let's say you're using 1280x1024 resolution. You have the following function: dxDrawText("$10000000", 990, 200, 1100, 250, tocolor ( 0, 0, 0, 255 ), 1, "pricedown") Take out the positionings from the function: 990, 200, 1100, 250 Divide 1280 with X positions (990, 1100) separately. You'll get 1280/990=1.292929 and 1280/1100=1.16363 Do the same with Y positions, but use 1024 as that is maximum height (aka Y of the screen). You'll get 1024/200=5.12 and 1024/250=4.096 The numbers you got are the scales that will work in every resolution as they work in your resolution (1280x1024). To use those scales, simply divide the clients' resolution with the scale, for example: screenWidth, screenHeight = guiGetScreenSize() dxDrawText("$10000000", screenWidth/1.292929, screenHeight/5.12, screenWidth/1.16363, screenHeight/4.096, tocolor ( 0, 0, 0, 255 ), 1, "pricedown") That's it! There's an extra scaling you can do for text size, which is tricky to work with (due to text getting blurred, ugly and unreadable) but if you're up for it: screenWidth, screenHeight = guiGetScreenSize() scale = (screenWidth/1280)*(screenHeight/1024) -- this will give you a number that will vary around 1, depending on clients' resolution (if resolution is smaller, scale will be below 1, if higher then above 1) dxDrawText("$10000000", screenWidth/1.292929, screenHeight/5.12, screenWidth/1.16363, screenHeight/4.096, tocolor ( 0, 0, 0, 255 ), scale*1, "pricedown") -- as you can see I multiplied the text size (1) with the scale, which means the text will be bigger or smaller (again, depending on the clients' screen resolution) Hope I helped, please provide some feedback for future references!
  9. He understood you, you don't understand him. Please refer to this post:
  10. The reason you cannot destroy the blip that's attached to the destination marker is that that blip is defined as local in another function, simply remove local and you'll be able to delete it. Similar goes for the marker, if you want it spawned once the truck is spawned, simply make the marker spawn once that function is triggered, here's an example: startdelmark = createMarker( 211.39999389648, 1809.5, 16.60000038147, "cylinder", 3, 42, 214, 153, 100 ) --spawns truck from here. local myBlip = createBlipAttachedTo ( startdelmark, 51 ) --blip on the spawn marker. delivmark = nil local deliverBlip = nil TruckVehiclesTable = {} function spawntruck (truckElement) if ( isElement(truckElement) and getElementType(truckElement) == 'player' ) then local truckVeh = getPedOccupiedVehicle(truckElement) local x, y, z = getElementPosition (truckElement) local rotX, rotY, rotZ = getElementRotation (truckElement) TruckVehiclesTable[truckElement] = createVehicle (515, x-5, y, z+2) setElementRotation (TruckVehiclesTable[truckElement], rotX, rotY, 90) warpPedIntoVehicle (truckElement, TruckVehiclesTable[truckElement]) delivmark = createMarker(-1355.6999511719, -506.20001220703, 13.10000038147, "cylinder", 3, 42, 214, 153, 100) --this is the location. deliverBlip = createBlipAttachedTo ( delivmark, 52 ) --the blip I want on the destination marker. setBlipSize ( myBlip, 1 ) outputChatBox ("You have took on the role of goods courier, deliver the goods to the dollar blip to get your reward", truckElement, 0, 255, 0) outputChatBox ("Do NOT leave the vehicle or it will be destroyed and your mission will fail!", truckElement, 255, 0, 0) end end addEventHandler("onMarkerHit", startdelmark, spawntruck) You'll need to be more detailed about your last question, in what table are the trailers, how do you want them to spawn etc. Hope I helped.
  11. You didn't really define what do you want to do. The provided code looks fine so if I got it right you want to update player's (his character actually) weapon stat in an SQL table? If so, simply add (and adjust if needed) the following code into the function that handles player logging out of his character: function onCharacterLogOut(player) -- just an example --normal code goes first, that you already should have local uzi_stat = getPedStat(player, 75) local mp5_stat = getPedStat(player, 76) local query = mysql:query_free("UPDATE `character-system` SET `uzi_skill`=" .. mysql:escape_string(uzi_stat) .. ", `mp5_skill`=" .. mysql:escape_string(mp5_stat) .. " WHERE id=" .. mysql:escape_string(getElementData(player, "dbid"))) if not query then outputDebugString("Failed saving weapon stats for " .. getPlayerName(player), 2) end end
  12. A note for future topics: we will not help you with script files that are marked stolen/leaked.
  13. It is possible, first, you need to declare so in meta.xml: <file src="example.dff" download="false"/> Then, you can choose when and how will the client download that specific file with the following functions: fileExists (for a check) and downloadFile.
  14. What would be the best way to create custom nitro colors for everyone then? My first thought was to create marker but that'd look ugly as hell, there must be a better way.
  15. Explain "can't load the image".