-
Posts
297 -
Joined
-
Last visited
Everything posted by Bonus
-
Searched for fadeCamera? It's definitely a script
-
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.
-
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
-
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
-
mysql/connection.lua:92: bad argument #1 to 'mysql_connect' (string expected, got boolean) Show the code
-
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)
-
return mysql_free_result(resultPool[resultid]) table.remove(resultPool, resultid) return nil You know what "return" does right?
-
with addCommandHandler ...
-
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?
-
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.
-
responsibleElement: The element that is responsible for banning the IP/username/serial. This can be a player or the root (getRootElement()).
-
Why do you create the function drawtheScene in the function? Don't do that ...
-
... Just don't use math.ceil ... You want to draw the time like that "5:31", so why would you want to use timeleft?
-
math.ceil with a string doesnt work
-
onClientResourceStart save the time with getTickCount() Then just use getTickCount()-savedtime to get the time in ms the player is playing.
-
To create a table and fill it later ...
-
Who said anything about create?! This way its correct, because the order is right.
-
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.
-
cancel onClientPlayerDamage The weapon should be 63.
-
math.ceil with a string?
-
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.
-
setWorldSpecialPropertyEnabled
-
Create the robmarkers with ped as index: robMarkers = { [ped1] = { { 123, 312, 51 ... }, ... } } } for i=1, #robMarkers[robped] do ... end
-
If textsToDraw[1] then Simply ask it in addText and removeText
-
... what? setElementData? Where? What do you want?
