Jump to content

Bonus

Members
  • Posts

    297
  • Joined

  • Last visited

Everything posted by Bonus

  1. Searched for fadeCamera? It's definitely a script
  2. guitab = guiCreateTab ( ... ) addEventHandler ( "onClientGUIClick", guitab, function ( button, state ) if button == "left" and state == "up" then destroyElement ( guitab ) -- Hide GUI end end, false ) Didn't really change much My first answer was just an example, thought you will notice what I wanna say.
  3. guibutton = guiCreateButton ( ... ) addEventHandler ( "onClientGUIClick", guibutton, function ( button, state ) if button == "left" and state == "up" then destroyElement ( guibutton ) -- Hide GUI end end, false ) https://wiki.multitheftauto.com/wiki/OnClientGUIClick
  4. I'll show you an example local sW, sH = guiGetScreenSize() local sx, sy = sW/1920, sH/1080 addEventHandler ( "onClientRender", root, function ( ) dxCreateRectangle ( sW*0.5 - 50*sx, sH*0.5 - 50*sy, 100*sx, 100*sy, tocolor ( 255, 0, 0 ), true ) end ) This rectangle will have the same scale in every resolution. But in your code: sW*0.5-481/2 sW*0.5 is good, but 481/2 will be different in every resolution. local sW, sH = guiGetScreenSize() local sx, sy = sW/1920, sH/1080 GUIEditor.window[1] = guiCreateWindow(sW*0.5-481/2*sx, sH*0.5-412/2*sy, 481*sy, 412*sy, "", false) This will solve your problem
  5. mysql/connection.lua:92: bad argument #1 to 'mysql_connect' (string expected, got boolean) Show the code
  6. local peds = { [1] = {1067.0164794922, 2035.6273193359, 10.8203125, 90}, [2] = {1067.0299072266, 2041.1890869141, 10.8203125, 90}, [3] = {-2067.029296875, 2035.0201416016, 9.8203125,90}, [4] = {2067.0295410156, 1032.1505126953, 10.8203125,90}, [5] = {1067.0295410156, 2027.8729248047, 10.8203125,90} } local createdPeds = {} addEventHandler("onResourceStart", resourceRoot, function () for i=1, 3 do local rnd = math.random ( #peds ) while createdPeds[rnd] do rnd = math.random ( #peds ) end createdPeds[rnd] = createPed ( 0, peds[rnd][1], peds[rnd][2], peds[rnd][3], peds[rnd][4] ) end end)
  7. Bonus

    MySQL Problem

    return mysql_free_result(resultPool[resultid]) table.remove(resultPool, resultid) return nil You know what "return" does right?
  8. There is no connection -> dbConnect didn't work. "Returns a database connection element unless there are problems, in which case it return false." You sure dbname, host etc. is right?
  9. addEventHandler("onClientPlayerWeaponFire", root, function(weapon, _, _, _, _, _, _, x, y, z ) if weapon == 30 then local sound = playSound3D("GENRL/sound_005.mp3", x, y, z) setSoundMaxDistance(sound, 75) end end) Use it that way for better sound.
  10. Bonus

    Question

    responsibleElement: The element that is responsible for banning the IP/username/serial. This can be a player or the root (getRootElement()).
  11. Why do you create the function drawtheScene in the function? Don't do that ...
  12. ... Just don't use math.ceil ... You want to draw the time like that "5:31", so why would you want to use timeleft?
  13. math.ceil with a string doesnt work
  14. Bonus

    Question

    onClientResourceStart save the time with getTickCount() Then just use getTickCount()-savedtime to get the time in ms the player is playing.
  15. To create a table and fill it later ...
  16. Who said anything about create?! This way its correct, because the order is right.
  17. What is currentweapon? If it's the name, why are you returning the name? You use return v.name (1), v.id (2), v.slot (3), v.ammo (4), v.mag_size (5) ... But you use: local name (1), slot (3), mag_size (5), ammo (4) The order is totally wrong.
  18. cancel onClientPlayerDamage The weapon should be 63.
  19. local totalleft = endtime - getTickCount() local minutesleft = math.floor ( totalleft / 60000 ) local secondsleft = math.floor ( ( totalleft - minutsleft * 60000 ) / 1000 ) local time = minutesleft..":"..secondsleft >= 10 and secondsleft or "0"..secondsleft time is the converted time. Should work, test it.
  20. setWorldSpecialPropertyEnabled
  21. Create the robmarkers with ped as index: robMarkers = { [ped1] = { { 123, 312, 51 ... }, ... } } } for i=1, #robMarkers[robped] do ... end
  22. Bonus

    setElementData

    If textsToDraw[1] then Simply ask it in addText and removeText
  23. Bonus

    setElementData

    ... what? setElementData? Where? What do you want?
×
×
  • Create New...