-
Posts
163 -
Joined
-
Last visited
-
Days Won
3
alex17"'s Achievements
Busta (15/54)
45
Reputation
-
function ggPlayer () if getPlayerSerial (source) == "34A2E2ECE41E349CCA34FF84EE1" then setPlayerMuted(source, true) end end addEventHandler ( "onPlayerJoin", root, ggPlayer )
-
if teamDM == DeathMatch then you have an if, if the condition is not met it will not spawn
-
my bad addEventHandler("onPlayerWasted", root, function() local spawn23 = math.random(1, 3) local teamDM = getPlayerTeam(source) local player23 = source if teamDM == DeathMatch then if spawn23 == 1 then setTimer(function() spawnPlayer(player23, 206.875, 168.638671875, 1003.0234375, 150, 104, 3, 0, team23) giveWeapon(player23, 31, 500) end, 3000, 1) elseif spawn23 == 2 then setTimer(function() spawnPlayer(player23, 252.208984375, 185.451171875, 1008.171875, math.random(0, 360), 107, 3, 0, team23) giveWeapon(player23, 31, 500) end, 3000, 1) elseif spawn23 == 3 then setTimer(function() spawnPlayer(player23, 288.3740234375, 168.3642578125, 1007.171875, math.random(0, 360), 101, 3, 0, team23) giveWeapon(player23, 31, 500) end, 3000, 1) end end end )
-
addEventHandler("onPlayerWasted", root, function() local spawn23 = math.random(1, 3) local teamDM = getPlayerTeam(source) local player23 = source if teamDM == DeathMatch then if spawn23 == 1 then setTimer(function() spawnPlayer(player23, 206.875, 168.638671875, 1003.0234375, 150, 104, 3, 0, team23) giveWeapon(Player23, 31, 500) end, 3000, 1) elseif spawn23 == 2 then setTimer(function() spawnPlayer(player23, 252.208984375, 185.451171875, 1008.171875, math.random(0, 360), 107, 3, 0, team23) giveWeapon(Player23, 31, 500) end, 3000, 1) elseif spawn23 == 3 then setTimer(function() spawnPlayer(player23, 288.3740234375, 168.3642578125, 1007.171875, math.random(0, 360), 101, 3, 0, team23) giveWeapon(Player23, 31, 500) end, 3000, 1) end end end )
-
The arguments u: the absolute X coordinate of the top left corner of the section which should be drawn from image v: the absolute Y coordinate of the top left corner of the section which should be drawn from image usize: the absolute width of the image section vsize: the absolute height of the image section must be worked based on the original size in pixels of the image and not based on the size it will have on the screen local imgW, imgH = 200, 150 dxDrawImageSection(screenX - ScaleY(289), screenY - ScaleY(19), ScaleY(47), ScaleY(-(123*(fuel/100))), 0, 0, imgW, imgW * (fuel/100),"fuel.png", 0, 0, 0, tocolor(2,153,0,255), false) To get the image size, right click on the image / properties / details / see dimensions
-
We still don't know how your missions are working, it would be easier if you provide us with the code. Likewise, I leave you a small example of how you could work it, although in my opinion it would be much easier if you worked everything on the server and not on the client. -- Server local day = getRealTime().monthday --- Set the server day addEventHandler("onPlayerLogin", root, function() if getRealTime().monthday ~= day then --- When a player connects, check if the day has changed day = getRealTime().monthday --- If it is another day, save it in the variable setAccountData(getPlayerAccount(source), "isMissionCompleted", false) -- resets the player's mission data triggerClientEvent(source, "createMissionMarker", source) --- send a trigger to the client to create the marker else -- If the day still does not change, check if the player has already completed the mission local isMissionCompleted = getAccountData(getPlayerAccount(source), "isMissionCompleted") if not isMissionCompleted then --- If the mission has not yet been completed, send a trigger to create the marker triggerClientEvent(source, "createMissionMarker", source) end end end ) --- When you complete the mission, send a trigger to the server to save the data addEvent("onMissionCompleted", true) addEventHandler("onMissionCompleted", root, function() setAccountData(getPlayerAccount(client), "isMissionCompleted", true) end) -- Client addEvent("createMissionMarker", true) addEventHandler("createMissionMarker", root, function() marker = createMarker(...) end)
- 5 replies
-
- save destroyelement
- save
-
(and 2 more)
Tagged with:
-
If they don't show us your code it is difficult to help you, first of all, how are you working on your missions on the server or on the client?
- 5 replies
-
- save destroyelement
- save
-
(and 2 more)
Tagged with:
-
You can use a variable and set it to true when someone starts the mission and false when it ends, when someone wants to start that mission they can only do so if the variable is false local isMissionStarted = false addEvent("requestStartMission", true) addEventHandler("requestStartMission", root, function() if not isMissionStarted then startMision() else outputChatBox("Mission not available right now", client, 255, 0, 0) end end ) function startMision() isMissionStarted = true end function stopMision() isMissionStarted = false end
-
function checkisPlayerRunning(_, state) if state == "down" then addEventHandler("onClientKey", root, cancelControls) else removeEventHandler("onClientKey", root, cancelControls) end end bindKey("sprint", "up", checkisPlayerRunning) bindKey("sprint", "down", checkisPlayerRunning) function cancelControls(key, pressState) if key == "lctrl" or key == "mouse1" then -- block the use of either key cancelEvent(true) end end try this, maybe it will help I'm not too sure
-
local scroll = 0 local maxItemsOnScreen = 8 local items = {} bindKey("mouse_wheel_down", "down", function() if scroll < (items - maxItemsOnScreen) then scroll = scroll + 1 end end ) bindKey("mouse_wheel_up", "down", function() if scroll > 0 then scroll = scroll - 1 end end ) function dxDrawInventory() for i = 1 + scroll, maxItemsOnScreen + scroll do if items[scroll] then dxDrawRectangle(...) ... ... end end end I leave you a fairly simple example of how you can do it.
-
When you press a key, it can be control or mouse 1, but it can never be both at the same time.
-
addEventHandler("onClientKey", root, function(key) if key == "lctrl" or key == "mouse1" then cancelEvent() end end )
-
use the variable globally, this does not mean that you place it outside the function, just delete "local"
-
trigging in the for is not the most appropriate, the best would be outside the for for i, k in ipairs(Bomb2) do if (isElementAttached(Bomb2[i])) then detachElements(Bomb2[i], helic[1]) plantedBombs = plantedBombs + 1 outputChatBox("Bomb has been successfully installed, Do the same with the rest!", root, 34, 139, 34) outputChatBox(plantedBombs) ---- This returns what it should return end end triggerClientEvent(player, "updatePlantedBombs", root, plantedBombs)
-
addEventHandler("onPlayerWasted", root, function() local spawn = math.random(1, 3) local team = getPlayerTeam(source) local skin = getElementModel(source) local player = source if spawn == 1 then setTimer(spawnPlayer, 3000, 1, player, x, y, z, math.random(0, 360), skin, 0, 0, team) elseif spawn == 2 then setTimer(spawnPlayer, 3000, 1, player, x, y, z, math.random(0, 360), skin, 0, 0, team) elseif spawn == 3 then setTimer(spawnPlayer, 3000, 1, player, x, y, z, math.random(0, 360), skin, 0, 0, team) end end )