-
Posts
194 -
Joined
-
Last visited
Everything posted by Gothem
-
A.No be good with him Q. should call people for come to B.L.A.S.T?
-
hey guys the program of change water level DONT hack memory address of game it change the water.dat file (or other.... dont remember )
-
hey guys the program of change water level DONT hack memory address of game it change the water.dat file (or other.... dont remember )
-
A: Yeah Q: Should we stop talking english?
-
blackdragon have reason if you put a gif in slower computers will be MORE slowers than they are damn KWKSND you are a very good map maker sry by the bad english
-
A. Yeah! :B Q. should we buy some pizzas?
-
No offence but why don't you just use my code above ? It does what you want and works. In your code you've way more errors than you think: + Yeah, that i++ should be i=i+1 (as has been pointed out) + You have the same problem with maxdis on the following line + You return "j" but j was set locally in an "if block" so it won't have a value to return. reason down + You don't need recursion to do this - what you're going to end up with if you get it working is a check through all players at one distance. If that fails, you're going to keep calling it with every-decreasing values for "maxdis". Think about how much processing you're going to require just to find the closest. You only need to loop through the elements once to find the closest. If you did use my code then to find the closest player to "player" you'd just use: local playerClosest,distance = tuFindNearestElement(player,"player",100) This would set playerClosest to the player element that is closest to the first parameter player - our target (or nil if no other player is found). i like it return THE CLOSEST player the reason of i dont use your code is: i like return only 1 player
-
thanks guys i will test what us saying ____ EDIT \_________________________________________________________ it send me an error in this line i++ full code: function getNearestPlayer(player, maxdis) local i = 0 local players = getElementsByType ( "player" ) local x,y,z = getElementPosition( player ) for theKey,thePlayer in ipairs(players) do local px,py,pz = getElementPosition( thePlayer ) local dis = getDistanceBetweenPoints3D ( x, y, z, px, py, pz ) if dis <= maxdis then i++ local j = thePlayer end end if(i > 1) then i = 0 maxdis - 1 getNearestPlayer(player,maxdis) else return j end end
-
wait a time guys! the GMs dont are created one day to other it take time to look a list full of variety of GMs lets wait a time
-
and how get the distance? im have that code but dont think it is good function getNearestPlayer(player, maxdis) local pos[6] local players = getElementsByType ( "player" ) local pos[0],pos[1],pos[2] = getElementPosition( player ) for theKey,thePlayer in ipairs(players) do local pos[3],pos[4],pos[5] = getElementPosition( thePlayer ) if (pos[0] >= (pos[3] - maxdis) && pos[0] <= (pos[3] + maxdis) && pos[1] >= (pos[4] - maxdis) && pos[1] <= (pos[4] + maxdis) && pos[2] >= (pos[5] - maxdis) && pos[2] <= (pos[5] + maxdis)) then local i ++ local j = thePlayer end end if(i > 1) then i = 0 maxdis - 1 getNearestPlayer(player,maxdis) else return j end end dont know where to apply the tabble.sort
-
but it will return more than 1 player i like only one player
-
How can create that function? if someone can say me how or make it thx
-
dont it was "naval war" before?
-
A. Yeah Q. You have fun making questions?
-
that is soo stupid.. but can be true well im still waiting DP3
-
the camera is already fixed now need to fix the skins selection
-
scriptable i think it isnt to hard make it scripting
-
thx 50p it works but im dont make it by command.. well now to fix the selection of skins
-
hmmm... but im like they appear when a player connect
-
function Inicio( res ) players = getElementsByType ( "player") for k,v in ipairs(players) do --Game start spawn outputChatBox("Bienvenido a Nuestro Servidor",v) spawnPlayer(v, -2026.5035, 156.7506, 29.0391, 269.1424, 0) setTimer(seleccion,3000,2,v) fadeCamera ( v, true ) end end function Muerte( ammo, attacker, weapon, bodypart ) setTimer ( seleccion, 3000, 1, source ) end function Conexion() outputChatBox("Bienvenido a Nuestro Servidor ",source) spawnPlayer(source, -2026.5035, 156.7506, 29.0391, 269.1424, 0) setTimer ( seleccion, 1000, 2, source ) fadeCamera ( source, true ) end function seleccion(player) spawnPlayer(player, -2026.5035, 156.7506, 29.0391, 269.1424, 0) setCameraMode ( player,"fixed") setTimer(setCameraPosition, 500, 2, player, -2010.5035, 156.7506, 29.0391) setTimer( setCameraLookAt, 550, 10, player, -2026.5035, 156.7506, 29.0391) bindKey(player,"enter","down",Aparecer) bindKey(player,"arrow_l","down",Cambiar) bindKey(player,"arrow_r","down",Cambiar) end function Cambiar( player, key ) local skin skin = getPlayerSkin(player) if(key == "arrow_l" and skin ~= 0) then setPlayerSkin(player,skin - 1) else setPlayerSkin(player,skin + 1) end setCameraLookAt( player, -2026.5035, 156.7506, 29.0391) end function Aparecer( player ) unbindKey ( player, "enter", "down", Aparecer ) unbindKey ( player, "arrow_l", "down", Cambiar ) unbindKey ( player, "arrow_r", "down", Cambiar ) setCameraMode ( player, "player" ) end addEventHandler("onPlayerWasted", getRootElement(),Muerte) addEventHandler("onResourceStart", getRootElement(),Inicio) addEventHandler("onPlayerJoin", getRootElement(),Conexion) here is the entire code it dont work now
-
A. no Q.WTF i am doing here?
-
yeah that is true but i have see it work when the resource start when the player is already connected no for connecting players