-
Posts
1,143 -
Joined
-
Last visited
-
Days Won
43
Everything posted by Patrick
-
Ohh. I see. Do you use RADAR resource?
-
Ohh, so.. Some resource is created blips. (example: play resource create player's blip.) And if I type the /empb command, all blips hide only for me or if I type the /empb command all blips hide for everyone?
-
Maybe I can, but: "Where did you create the player's blip?"
-
Honestly, this script is sucks. Where did you create the player's blip?
-
You can't do that.
-
In line 43. the blip variable is not a blip element. getElementsByType is return a table with all blip element.
-
What dont you understand? Here you can get help. We will not do it for you.
-
setTimer -- looping a check function isElementInWater -- in this function you check player is in water createObject -- if player in the water, you create a shark object, under the player moveObject -- move the shark object up, to player killPed -- if shark reach the player you kill the player destroyElement -- destroy the shark object at end
-
Yes. More custom fonts use more video memory. But I've never been watching this. In negligible part. I'm paying attention to not creating multiple fonts in a Resource. Example: In the resource folder I create a fonts.lua (client) file. And I create the dxfont only here and I can use this custom font in every client file.
-
I think it's okay. Maybe if you define the 'latestRow' once in bindKey functions and not in the 'drawPanel' function. function drawPanel() dxDrawRectangle(panelX, panelY, mainW, mainH, tocolor(0, 0, 0, 180)) for i, v in ipairs(TextsInTable) do if i >= currentRow and i <= latestRow then i = i - currentRow + 1 local rowY = panelY + rowH + ((i - 1) * rowH) - 180 dxDrawCenterText(v[1].." "..v[2], panelX, rowY, mainW, mainH, Font) end end end addEventHandler("onClientRender", root, drawPanel) bindKey("mouse_wheel_down", "down", function() if currentRow < #TextsInTable - (maxRow - 1) then currentRow = currentRow + 1 latestRow = currentRow + maxRow - 1 end end) bindKey("mouse_wheel_up", "down", function() if currentRow > 1 then currentRow = currentRow - 1 latestRow = currentRow + maxRow - 1 end end) function dxDrawCenterText(text, startX, startY, width, height, color) dxDrawText(text, startX, startY, startX + width , startY + height, color, 1, "normal", "center", "center", false, false, false, true) end
-
Something like that. -- SERVER SIDE SCRIPT local counter = 0 local originalName = {} addEventHandler('onPlayerJoin', root, function() local name = getPlayerName(source) originalName[source] = name setPlayerName(source, "Guest_"..counter) counter = counter + 1 end) addEventHandler('onPlayerLogin', root, function() setPlayerName(source, originalName[source]) end) On player join you need to save the player's original name to a table and you get back this name from the table, when the player is logged in.
-
When you attach the Sound Element to the Vehicle Element save this into a own table. Example: local sounds = {} function attachSoundToVehicle(vehicleElement, soundElement) attachElements(vehicleElement, soundElement) sounds[vehicleElement] = soundElement end function getVehicleAttachedSound(vehicleElement) if isElement(sounds[vehicleElement]) then -- have attached sound return sounds[vehicleElement] -- This is the sound element: sounds[vehicleElement] end end
-
I didn't tested it. local vehicleIds = { 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611 } local markerX, markerY, markerY = 0, 0, 3 -- marker position local marker = createMarker(markerX, markerY, markerY, "cylinder", 2) addEventHandler("onMarkerHit", marker, function(element, mdim) if isElement(element) and getElementType(element) == "player" and not isPedInVehicle(element) then local playerX, playerY, playerZ = getElementPosition(element) local randomVehicleId = vehicleIds[math.random(1,#vehicleIds)] local vehicle = createVehicle(randomVehicleId, playerX, playerY, playerZ + 1) addEventHandler("onVehicleExplode", vehicle, function() setTimer(destroyElement, 30000, 1, vehicle) end) warpPedIntoVehicle(element, vehicle) end end)
-
Ne zárd le az IF-et, ha ELSEIF-et adsz meg. if sZ < 0.6 then setVehicleComponentPosition(theVeh, "movspoiler_24.0_5200", sX, sY-0.004, sZ+0.005) elseif sZ > 0.45 then setVehicleComponentPosition(theVeh, "movspoiler_24.0_5200", sX, sY+0.008, sZ-0.01) end
-
You are welcome!
-
-- SERVER SIDE function respawnOnWasted(player) spawnPlayer(player, 0, 0, 5, 0, math.random (0,288), 0, 0) unbindKey(player, "F", "both", respawnOnWasted) end addEventHandler("onPlayerWasted", getRootElement(), function() bindKey(source, "F", "both", respawnOnWasted) end)
-
Try with bigger marker size. (2 or bigger)
- 3 replies
-
- onmakerhit
- on
-
(and 2 more)
Tagged with:
-
function render() if getElementData(localPlayer, "auth:uid") then -- some DX draw end end addEventHandler("onClientRender", getRootElement(), render) local show = true addCommandHandler("showhud", function() if show then removeEventHandler("onClientRender", getRootElement(), render) else addEventHandler("onClientRender", getRootElement(), render) end show = not show end)
-
local show = true addEventHandler("onClientRender", getRootElement(), function() if show and getElementData(localPlayer, "auth:uid") then -- some DX draw end end) addCommandHandler("showhud", function() show = not show end)
-
Send me the full code.
