Jump to content

Bananovy

Members
  • Posts

    34
  • Joined

  • Last visited

Everything posted by Bananovy

  1. Small update. Password got removed, so discord is optional.
  2. Hello there. My name is Eryk and I am working on my server with own gamemode called PROJECT: Speed. Basically, the gamemode is based on racing. However, it is not a typical racing server as you might think. It is inspired by well-known racing games where you have to progress to unlock more things. Currently, there are only few races available placed in Las Venturas. Players have to drive to specific race, find or create a lobby and also racers. If you can't find any opponent, you can try Time Attacks. Other than that, there are Sprints, Circuits and Unordered Races. There are also car classes, but every car can be upgraded to higher class. Server includes car mods and some additional stuff (around 580MB to download). The rest is a little secret which you can discover by yourself . So I am looking for beta testers who want to help me test everything. I guess everyone know what is its purpose. In order to join and read something more about the server: Join to Discord server: https://discord.gg/6PuK8CZ
  3. yourSkin = 1 local model = getElementModel(player) if model == yourSkin then toggleControl(player, "sprint", false) end As I understood this should do
  4. Bananovy

    help

    What about this? local hillArea = createColRectangle ( -2171.0678710938, 678.17950439453, 15, 15 ) function hill_Enter ( thePlayer, matchingDimension ) if getElementType ( thePlayer ) == "player" then local interior = getElementInterior(thePlayer) if interior == 30 and matchingDimension == 30 then local nameOfThePlayer = getPlayerName ( thePlayer ) outputChatBox ( nameOfThePlayer.." entered the zone!", getRootElement(), 255, 255, 109 ) end end end addEventHandler("onColShapeHit", hillArea, hill_Enter)
  5. setSoundMaxDistance(sound, 75) isn't this decreasing the volume as you want?
  6. Bananovy

    Language menu

    I guess everytime when you have to use outputChatBox there should be an "if" to check player's chosen language. if language = "English" then outputChatBox("Something in English") elseif language == "Russian" then outputChatBox("Rush B") end You might also use some tables like this: Language = {} Language.quit = { "You left", -- English has value 1 "Wyszedłeś", -- Second language with value 2 "Any other language"} -- etc. function leaving () outputChatBox(Language.quit[getElementData(localPlayer, "Language")]) end But you have to keep the texts in correct order
  7. Actually the higher vehicle's mass is the slower will decelerate. You can try to set high value for mass in handling when player isn't accelerating.
  8. Okay, I get it now. Well then looks like the best now you can do is to make a small "check" if player has his color already. I did it by using setElementData/getElementData: function setRandomColor() for _,player in ipairs(getElementsByType("player")) do for _,blip in ipairs(getElementsByType("blip")) do local team = getPlayerTeam(player) local r,g,b = math.random(255),math.random(255),math.random(255) if not (team) then local gotHisColor = getElementData(player, "gotRandomColor") or false if gotHisColor == false then setPlayerNametagColor(player,r,g,b) setBlipColor(blip,r,g,b,255) setElementData(player, "gotRandomColor", true) end end end end end setTimer(setRandomColor,50,0)
  9. Okay, so how do you set team for a player?
  10. How does player leave the team? Is he using any command or you do it manually? Another edit: If you just set the team once then use onPlayerLogin. You won't have to check every 50 ms if player is in the team or not.
  11. If you've got your own team script then just set the color when you're using setPlayerTeam. Otherwise you have to make your own kind of detection, because there is no event such as onPlayerJoinTeam. Quick Edit: If your script is setting the team when player login, you can set his color at the same time.
  12. Your setTimer executes every 50 ms, so when player isn't in any team his color is changing every 50 ms. Also you've put those timers outside of the function. It would be better to set the random color exactly when player is leaving the team.
  13. What about getTeamColor and setBlipColor? Normally when player is in the team his nickname is using it's color. If you want to color player's name completly into team's color, you have to remove hex codes from their nicknames
  14. Small tip: You can use ">= 1000" instead of "> 1001". It will mean if player has equal or more than 1000$
  15. First of all you have to open the garage's of Pay'n'Spray. You need setGarageOpen for that. The easiest way to recognize if vehicle is there you can simply create markers (createMarker) inside Pay'n'Spray. setTimer
  16. Place onClientRender under onClientPlayerChangeNick event
  17. function try(plr) local chance = math.random(0,1) if chance == 1 then local playerName = getPlayerName local actiontext = string.sub (text,3) outputChatBox ( getPlayerName .. "tried" .. actionText .. "and it worked!", root, 0, 255, 0, true ) else local playerName = getPlayerName local actiontext = string.sub (text,3) outputChatBox ( getPlayerName .. "tried" .. actionText .. "and it didnt work!", root, 255, 0, 0, true ) end end Btw. you will have to fix your playerName/getPlayerName.
  18. Bananovy

    timer

    What about this? local timer = false function carDestroy () if timer == false then if not (isGuestAccount (getPlayerAccount (source))) then if (isPedInVehicle (source)) then if (getElementID(getPedOccupiedVehicle(source)) == getAccountName (getPlayerAccount(source))) then setElementHealth (getElementData (source, "hisCar"), 0) destroyElement (getPedOccupiedVehicle (source)) removeElementData (source, "hisCar") outputChatBox ("Car Destroyed.", source, 255, 0, 0) timer = true setTimer(function () timer = false --outputChatBox ("Event available again", source, 255, 0, 0) end, 600000, 1) else outputChatBox ("This not your car!", source, 255, 0, 0) end elseif (not (isPedInVehicle (source))) and (getElementData (source, "hisCar")) and (getElementData (source, "hisCar") ~= nil) then car=getElementData(source, "hisCar") destroyElement(car) outputChatBox ("Car Destroyed.", source, 255, 0, 0) removeElementData (source, "hisCar") timer = true setTimer(function () timer = false --outputChatBox ("Event available again", source, 255, 0, 0) end, 600000, 1) end end else -- outputChatBox ("10 minutes", source, 255, 0, 0) end end addEventHandler ("carDestroy", getRootElement(), carDestroy)
  19. https://community.multitheftauto.com/index.php?p=profile&id=414347 Resources from this profile have not related descriptions and pictures. Screenshots' name are polish and they mean nothing. He also advertises his youtube channel and server. Examples: https://community.multitheftauto.com/index.php?p=resources&s=details&id=14140 https://community.multitheftauto.com/index.php?p=resources&s=details&id=13220 https://community.multitheftauto.com/index.php?p=resources&s=details&id=13763 etc.
  20. You can make own simple function which will count players when they will enter the area.
  21. I guess you can use this code: for player, money in ipairs(tableToSort) do table.insert( sortedTable,{ p = player, v = money } ) end and table.sort(sortedTable, function(a, b) return a.v > b.v end ) I guess should be fine.
  22. table.sort(table, function(a, b) return a > b end ) Example: function forbes () local players = getElementsByType("players") local myTable = {} for index, value in ipairs(players) do local player = getPlayerName(value) local money = getPlayerMoney(value) table.insert( myTable,{ name = player, value = money } ) end table.sort(myTable, function(a, b) return a.value > b.value end ) end
  23. Works as I wanted Thank you very much
  24. Is there any way to remove event handler made this way?: addEventHandler("onClientRender", getRootElement(), function () dflash = dflash - 0.1 guiSetAlpha(d[1], dflash) if dflash <= 0 then --removeEventHandler(...)??? --... end end) I know that I can separare function, name it and then add the handler, but I have to do that like it is now. Any ideas?
×
×
  • Create New...