Jump to content

Bananovy

Members
  • Posts

    34
  • Joined

  • Last visited

Everything posted by Bananovy

  1. Hello. Is there any way to make a function which will find nearest vehicle only from the player's dimension? I found this function on forum: function getNearestVehicle( player ) local x, y, z = getElementPosition( player ) local prevDistance local nearestVehicle for i, v in ipairs( getElementsByType( "vehicle" ) ) do local distance = getDistanceBetweenPoints3D( x, y, z, getElementPosition( v ) ) if distance <= ( prevDistance or distance + 1 ) then prevDistance = distance nearestVehicle = v end end return nearestVehicle or false end but it finds vehicles from every dimension. How can I make it searching nearest vehicles only from player's dimension?
  2. Attempt to get length of global 'getAlivePlayers' (a function value) Edit: Used like that: local aPlayer = getAlivePlayers ( ) if (#aPlayer == 1) then outputChatBox(getPlayerName(source).." 2nd") end and works Thank you
  3. Hello there, I was looking for functions for create second place counting. With first place was easier, but I can't figure out how can I make 2nd places in DD. Any ideas what should I use?
  4. Try this one: https://community.multitheftauto.com/ind ... ls&id=4705
  5. I made little changes. Serverside function is gone and in GUI: local playerKills = getElementData(getLocalPlayer(), "Kills") guiSetText ( killslabel, "Kills: "..playerKills.."") So easy Thanks for answer @Necktrox. Regards
  6. Hello there, I made GUI for userpanel and I wanted to make a function where players can see their stats when they open it. As first I'm trying to make kills, but there's an error. This is how it looks now: Clientside: function callServerFunction(funcname, ...) local arg = { ... } if (arg[1]) then for key, value in next, arg do if (type(value) == "number") then arg[key] = tostring(value) end end end triggerServerEvent("kills123", resourceRoot , funcname, unpack(arg)) end guiSetText ( killslabel, "Kills: "..callServerFunction("kills").."") Serverside: function kills(v) for i, v in pairs ( getElementsByType ( "player" ) ) do local theAcc = getPlayerAccount(v) if theAcc and not isGuestAccount(theAcc) then return tostring(getAccountData ( theAcc, "Info.Kills" )) else return "0" end end end addEvent("kills123", true) addEventHandler("kills123", resourceRoot, kills) And error: Attempt to concatenate a nil value (line with guiSetText)
  7. I just found a solution. I changed gamemode from race to editor and from editor to race and it's gone now. To be sure I restarted the server. Looks like problem solved. That was weird :v
  8. Hello, I've got a problem on my server with some weird objects which are only in few maps. I'm trying to find the solution and delete them all, but I have no idea what to do. All these objects have enabled collisions. Any ideas?
×
×
  • Create New...