Jump to content

NeXuS™

Retired Staff
  • Posts

    1,134
  • Joined

  • Last visited

  • Days Won

    37

Everything posted by NeXuS™

  1. I think you should post this in your language section, it's impossible for me to understand anything from your sentences. Go to the Other languages section, and select the one sub-section which is desired for your language.
  2. Use a custom made admin system. kickPlayer banPlayer addCommandHandler
  3. We, or atleast I, don't understand anything from this post. Maybe try to explain it better.
  4. I think you'll have to use setElementRotation and a ton of math.
  5. You ain't using the convertedMoney2 variable anywhere. local lastMoney = 0 local drawMoney = nil setTimer(function() local playerMoney2 = getPlayerMoney(localPlayer) if playerMoney2 ~= lastMoney then drawMoney = playerMoney2 - lastMoney if isTimer(resetingTimer) then killTimer(resetingTimer) end resetingTimer = setTimer(function() drawMoney = nil end, 3000, 1) end lastMoney = playerMoney2 end, 50, 0) addEventHandler("onClientRender", getRootElement(), function() if drawMoney then removeEventHandler("onClientRender", root, alappenz) dxDrawText((drawMoney > 0 and ("+" .. comma_value(drawMoney)) or comma_value(drawMoney)), screenW * 0.8674, screenH * 0.0389, screenW * 0.9889, screenH * 0.0644, drawMoney > 0 and tocolor(0, 255, 0) or tocolor(255, 0, 0), 1, "default-bold", "center", "center") else addEventHandler("onClientRender", root, alappenz) end end) function comma_value(n) -- credit http://richard.warburton.it local left,num,right = string.match(n,'^([^%d]*%d)(%d*)(.-)$') return left..(num:reverse():gsub('(%d%d%d)','%1,'):reverse())..right end
  6. function comma_value(n) -- credit http://richard.warburton.it local left,num,right = string.match(n,'^([^%d]*%d)(%d*)(.-)$') return left..(num:reverse():gsub('(%d%d%d)','%1,'):reverse())..right end Try to use this one instead, this is a better format.
  7. What should the convertNumber function do?
  8. dxDrawText((drawMoney > 0 and ("+" .. drawMoney) or drawMoney), 0, 0, 100, 100, drawMoney > 0 and tocolor(0, 255, 0) or tocolor(255, 0, 0), 1, "default-bold")
  9. local lastMoney = 0 local drawMoney = nil setTimer(function() local playerMoney = getPlayerMoney(localPlayer) if playerMoney ~= lastMoney then drawMoney = playerMoney - lastMoney if isTimer(resetingTimer) then killTimer(resetingTimer) end resetingTimer = setTimer(function() drawMoney = nil end, 500, 1) end lastMoney = playerMoney end, 100, 0) addEventHandler("onClientRender", getRootElement(), function() if drawMoney then dxDrawText(drawMoney, 0, 0, 100, 100, drawMoney > 0 and tocolor(0, 255, 0) or tocolor(255, 0, 0), 1, "default-bold") end end) Try this one.
  10. local avaibleSkins = { 0, 1, 2 } local spawnPoints = { {0, 0, 0, 0}, {10, 10, 10, 90} } function spawnSurvivor() local random1 = math.random(1, #avaibleSkins) local random2 = math.random(1, #spawnPoints) survivorPed = createPed(avaibleSkins[random1], spawnPoints[random2][1], spawnPoints[random2][2], spawnPoints[random2][3], spawns[random2][4]) survivorMarker = createMarkerAttachedTo ( survivorPed, "cylinder", 4.0, 0, 0, 255, 255 ) survivorBlip = createBlipAttachedTo( survivorPed, 47 ) addEventHandler("onPedWasted", survivorPed, killedPed) outputChatBox("The Survivor Was Saved! New one spawning soon.") end function killedPed() outputChatBox("The Survivor Was Saved! New one spawning soon.") destroyElement(survivorMarker) destroyElement(survivorBlip) destroyElement(survivorPed) setTimer(spawnSurvivor, 15000, 1) end You gotta learn have to fix easy errors like these.
  11. function spawnSurvivor() survivorPed = createPed(livingPeds[rnd2][1], spawns[rnd][1], spawns[rnd][2], spawns[rnd][3], spawns[rnd][4]) survivorMarker = createMarkerAttachedTo ( survivorPed, "cylinder", 4.0, 0, 0, 255, 255 ) survivorBlip = createBlipAttachedTo( survivorPed, 47 ) addEventHandler("onPedWasted", survivorPed, killedPed) outputChatBox("The Survivor Was Saved! New one spawning soon.") end function killedPed() outputChatBox("The Survivor Was Saved! New one spawning soon.") destroyElement(survivorMarker) destroyElement(survivorBlip) destroyElement(survivorPed) setTimer(spawnSurvivor, 15000, 1) end I suppose you want this.
  12. If you use setPlayerMoney, you can just do this on client side. local lastMoney = 0 setTimer(function() local playerMoney = getPlayerMoney(localPlayer) if playerMoney ~= lastMoney then outputChatBox("Your money got " .. (playerMoney < lastMoney and "decreased" or "increased") .. " by " .. math.abs(playerMoney-lastMoney)) end lastMoney = playerMoney end, 100, 0) I think this one should work.
  13. You'll have to use the onClientRender event, and cycle through the players, get their position via getElementPosition, and get that position on your screen by getScreenFromWorldPosition, and you can use that x and y to draw anything on the screen.
  14. Try to use getPedWeapon on the attacker to get his weapon on his current slot, and check with that ID if it's a melee.
  15. @Turbo777, you just had to relogin once, and it would have outputted your last login, thats how it works. If you haven't logged in once before this script started running, it could output "First login" (or in my case, it outputs 1970.)
  16. addEventHandler("onPlayerLogin", getRootElement(), function(_, theAccount) local lastLogin = getAccountData(theAccount, "acc:lastLogin") or 0 local lastTime = getRealTime(lastLogin) local timeText = lastTime.year + 1900 .. ". " .. string.format("%02d", lastTime.month+1) .. ". " .. string.format("%02d", lastTime.monthday) .. " " .. string.format("%02d", lastTime.hour) .. ":" .. string.format("%02d", lastTime.minute) .. ":" .. string.format("%02d", lastTime.second) outputChatBox("Last login date: " .. timeText, source, 255, 255, 255, true) local timeAtm = getRealTime().timestamp setAccountData(theAccount, "acc:lastLogin", timeAtm) end) I had this done already. If you need explanations, feel free to ask.
  17. NeXuS™

    problem

    function autoJail () if getElementData( source,"bag") and getElementData( source,"bag") == true then cancelEvent() elseif getElementType(source) == "player" then theWL = getPlayerWantedLevel ( source ) if (theWL == 6 ) then if isPedInVehicle ( source ) then removePedFromVehicle ( source ) end setTimer ( toggleControl, (1000*11), 1, source, 'fire', false) setElementPosition ( source, -2174,1861,0.6, true) theName = getPlayerName ( source ) outputChatBox ( ""..theName.. " #FF0000Was Jailed For #00FF001 Min. #FF0000by the #00FF00Server#FF0000[Reason]~>#00FF006******", root,255,255,255,true ) setTimer ( setElementPosition, (1000*60*2), 1, source, 1544.4332275391, -1674.7698974609, 13.688399200439) setTimer ( outputChatBox, (1000*60*2), 1, ""..theName.. " #00FF00Finished his Jail Sentence; Is Released !", root,255,255,255,true ) setTimer ( setElementInterior, (1000*60*2), 1, source, 0) setTimer ( setElementDimension, (1000*60*2), 1, source, 0) setTimer ( fadeCamera, (1000*59*2), 1, source, false) setTimer ( fadeCamera, (1000*60*2), 1, source, true) setTimer ( toggleControl, (1000*60*2), 1, source, 'fire', true) setPedAnimation ( source, false) setPlayerWantedLevel (source, 0) end end end end addEventHandler ("onElementDataChange", getRootElement(), autoJail)
  18. NeXuS™

    camera

    You can just use setCameraMatrix when the player connects, and whenever he logins, setCameraTarget.
  19. Try using executeSQLQuery instead of getAccounts.
  20. @Pirulax, there is not so many ways to use a dbQuery, because it returns a query handle, and by dbPolling the query, it automatically gets freed.
  21. local foundRestricted = false for k,v in ipairs(restrictedusernamewords) do if string.match(usernameregister, v) then outputChatBox ( "Please don't include vulgar words in your username!", client ) foundRestricted = true break end end if not foundRestricted then -- Do register end
  22. You can change the GUI size by just changing the mainW and mainH value in the first lines.
  23. local playerBlips = {} local playerNames = {} local sX, sY = guiGetScreenSize() local mainW, mainH = 700, 600 local mainX, mainY = (sX-mainW)/2, (sY-mainH)/2 local multX, multY = 1366/sX, 768/sY function removeHex (name) return type (name) == "string" and string.gsub (name, "#%x%x%x%x%x%x", "") or name end addEventHandler("onClientResourceStart", root, function() mainWindow = guiCreateWindow(mainX, mainY, mainW, mainH, "Teleport", false) guiWindowSetSizable(mainWindow, false) mapImg = guiCreateStaticImage(5, 20, mainW, mainH-60, ":freeroam/map.png", false, mainWindow) teleportButton = guiCreateButton(5, mainH-35, mainW-10, 30, "Teleport me", false, mainWindow) playerBlip = guiCreateStaticImage(0, 0, 10, 10, ":freeroam/localplayerblip.png", false, mapImg) end) bindKey("m", "down", function() showCursor(not isCursorShowing()) end) addEventHandler("onClientRender", getRootElement(), function() for i, k in ipairs(getElementsByType("player")) do local pX, pY = getElementPosition(k) local xPerc, yPerc = (pX+3000)/6000, (3000-pY)/6000 --outputChatBox(xPerc .. " " .. yPerc) guiSetPosition(playerBlip, xPerc-10/mainW/2, yPerc-10/mainH/2, true) end end) addEventHandler("onClientGUIDoubleClick", getRootElement(), function() if source == mapImg then local tW, tH = guiGetSize(mapImg, false) local tX, tY = guiGetPosition(mapImg, false) local mainX, mainY = guiGetPosition(mainWindow, false) outputChatBox("Map size", 255, 0, 0) outputChatBox(tW .. " " .. tH) local cX, cY = getCursorPosition() local cX, cY = cX*sX, cY*sY outputChatBox("Click position", 255, 0, 0) outputChatBox(cX .. " " .. cY) outputChatBox("Image position", 255, 0, 0) outputChatBox(mainX+tX .. " " .. mainY+tY) local cX, cY = cX-(mainX+tX), cY-(mainY+tY) outputChatBox("Click position on image", 255, 0, 0) outputChatBox(cX .. " " .. cY) local aX, aY = cX/tW, cY/tH outputChatBox("Relative values", 255, 0, 0) outputChatBox(aX .. " " .. aY) local mapX, mapY = math.floor(aX*6000-3000), math.floor(3000-aY*6000) outputChatBox("Map position", 255, 0, 0) outputChatBox(mapX .. " " .. mapY) setElementFrozen(localPlayer, true) setElementPosition(localPlayer, mapX, mapY, 0) setTimer(function() local _, _, _, foundZ = processLineOfSight(mapX, mapY, 3000, mapX, mapY, -3000) setElementPosition(localPlayer, mapX, mapY, foundZ) setElementFrozen(localPlayer, false) end, 100, 1) end end) addEventHandler("onClientGUIClick", getRootElement(), function() if source == mapImg then local tW, tH = guiGetSize(mapImg, false) local tX, tY = guiGetPosition(mapImg, false) local mainX, mainY = guiGetPosition(mainWindow, false) outputChatBox("Map size", 255, 0, 0) outputChatBox(tW .. " " .. tH) local cX, cY = getCursorPosition() local cX, cY = cX*sX, cY*sY outputChatBox("Click position", 255, 0, 0) outputChatBox(cX .. " " .. cY) outputChatBox("Image position", 255, 0, 0) outputChatBox(mainX+tX .. " " .. mainY+tY) local cX, cY = cX-(mainX+tX), cY-(mainY+tY) outputChatBox("Click position on image", 255, 0, 0) outputChatBox(cX .. " " .. cY) local aX, aY = cX/tW, cY/tH outputChatBox("Relative values", 255, 0, 0) outputChatBox(aX .. " " .. aY) mapX, mapY = math.floor(aX*6000-3000), math.floor(3000-aY*6000) outputChatBox("Map position", 255, 0, 0) outputChatBox(mapX .. " " .. mapY) elseif source == teleportButton and mapX then setElementFrozen(localPlayer, true) setElementPosition(localPlayer, mapX, mapY, 0) setTimer(function() local _, _, _, foundZ = processLineOfSight(mapX, mapY, 3000, mapX, mapY, -3000) setElementPosition(localPlayer, mapX, mapY, foundZ) setElementFrozen(localPlayer, false) mapX, mapY = nil, nil, nil end, 100, 1) end end) Fixed. Next time try not to use 9999 font size, if he is not using a function, it's because he doesn't want to use it.
  24. And on what event should it happen? Marker hit? Timer?
  25. Do you mean give it a little boost on a specific button press?
×
×
  • Create New...