-
Posts
1,102 -
Joined
Everything posted by Enargy,
-
Básicamente con getRootElement() esta especificando a todos los marcadores, pero lo que hizo él es que al entrar a cualquier marcador pues defina si el jugador esta en el marcador correcto, pero claro primero tienes que definir al marker lo que se conoce como el source.
-
you can get weapons name by string. then you could use getWeaponIDFromName to get weapon id. (I'm not sure that it works.) local weaponsBoom = { ["ak-47"] = true, -- example with ak-47 . } addEvent( "headboom", true ) function Zheadhit ( ped,attacker, weapon, bodypart) local weaponName = getWeaponIDFromName(weaponsBoom[weapon]) if weaponName then if (getElementData (ped, "zombie") == true) then killPed ( ped, attacker, weapon, bodypart ) setPedHeadless ( ped, true ) end end end addEventHandler( "headboom", getRootElement(), Zheadhit )
-
En ese caso, al momento de hacer el spawn usas setElementDimension
-
server.lua function maskk ( thePlayer ) local x, y, z = getElementPosition ( thePlayer ) --Get the players position local mask = createObject( 2054, x, y, z ) attachElements ( mask, thePlayer, 0, 0, 5 ) --Attach the tank to the player. end addCommandHandler( "hat", maskk ) PD: Español here viewforum.php?f=145
-
Verificas primero de que el jugador se encuentre en la dimensión usando getElementDimension. así: addEventHandler("onPlayerWasted", root, function() if ( getElementDimension( source ) == 1 ) then -- si el source esta en la dimension 1 local x,y,z = getElementPosition( source ); -- las coordenadas del jugador setTimer( spawnPlayer, 2000, 1, x, y, z, 0, math.random( 0, 288 ) ); -- el jugador es spawneado despues de 2 segundos else -- si el jugador no se encuentra en la dimension 1 la funcion regresará a end. return; end end)
-
-- client function mask ( ) local x, y, z = getElementPosition ( getLocalPlayer() ) local mask = createObject( 2054, x ,y, z + 5) attachElements ( mask, getLocalPlayer(), 0, 0, 5 ) end addCommandHandler ( "hat", mask ) -- server function mask ( thePlayer ) local x, y, z = getElementPosition ( thePlayer ) --Get the players position local mask = createObject( 2054, x ,y, z + 5) attachElements ( mask, thePlayer, 0, 0, 5 ) --Attach the tank to the player. end addCommandHandler( "hat", mask )
-
'Xtreme Deathmatch Derby ROFL.
-
as WhoAmI said try this addEventHandler("onMarkerHit", marker, function openGUI( hitElement, matchingDimension ) if matchingDimension and isElement(hitElement) and getElementType(hitElement) == "player" then if getElementData(hitElement, "Show_GUI") ~= nil then triggerClientEvent(hitElement,"ShowGui",hitElement) end end end ) you forgot remove function name. addEventHandler("onMarkerHit", marker, function( hitElement, matchingDimension ) if matchingDimension and isElement(hitElement) and getElementType(hitElement) == "player" then if getElementData(hitElement, "Show_GUI") ~= nil then triggerClientEvent(hitElement,"ShowGui",hitElement) end end end )
-
try local x, y = guiGetScreenSize(); dxDrawImage(x-x, y-y, x, y, ":zombie/images/blood_1.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
-
No es necesario destruir el blip, ya que no se puede ver desde otra dimension.
-
try this addEvent ("dararma",true) addEventHandler ("dararma", root, function () weapon, totalAmmo = weapons[ math.random( #weapons ) ] , ammo[math.random(#ammo)] weaponReceived = giveWeapon( source, weapon, totalAmmo, true); if weaponReceived then outputChatBox("you've received a '"..getPedWeapon ( source ).."' with '"..totalAmmo.."' ammo", source, 0, 255, 0); end end)
-
use createObject createWeapon setWeaponState triggerServerEvent/triggerClientEvent attachElements onClientPreRender setElementRotation
-
Hay algunos shaders que son los de el agua que afectan mucho a la forma del ped eso también incluye el de la reflexión de los autos.
-
like this? local playerInt = getAccountData (playeraccount, "s.int") local playerDim = getAccountData (playeraccount, "s.dim") local playerSkin = getAccountData (playeraccount, "s.skin") local playerX = getAccountData (playeraccount, "s.x") local playerY = getAccountData (playeraccount, "s.y") local playerZ = getAccountData (playeraccount, "s.z") local playerRot = getAccountData (playeraccount, "s.rot") if playerInt and playerDim and playerSkin and playerX and playerY and playerZ and playerRot then spawnPlayer(source, playerX, playerY, playerZ, playerRot, playerSkin, playerInt, playerDim) else spawnPlayer(source, 0, 0, 0, 0, 0, 0, 0) -- your cordenates custom end
-
function addPlayerZombieKills(killer) local account = getPlayerAccount(killer) if isGuestAccount(account) then return end local zombieKills = getAccountData(account,"Zombie Kills") if not zombieKills then setAccountData(account,"Zombie Kills",0) end setAccountData(account,"Zombie Kills",tonumber(zombieKills)+1) setElementData(killer, "Zombie Kills", tonumber(zombieKills)+1) end
-
No borres los post porque puede ser que alguna persona tiene el mismo problema que el tuyo, solo es cuestión de cerrar el topic. cierren el post por favor.
-
function aparecer() if not isElement(source) then return end spawnPlayer(source, -2474, 2226, 5, 268, math.random(0, 288)) fadeCamera(source, true) setCameraTarget(source, source) end addEventHandler("onPlayerJoin", getRootElement(), aparecer)
-
No funciona Entonces tendrías que hacer el script en clientside y luego triggear a serverside.
-
Cosas como los botones los puedes hacer con la useful isMouseInPosition. en cuanto a la gui, tendrias que hacer una library personalizada o simplemente hacer el rectangulo y luego los componentes.
-
Aqui tienes otra manera de como poder hacer esto . addEventHandler("onResourceStart", resourceRoot, function() autos = {}; for indice = 1,7 do indice = indice+1 - 1 autos[indice] = createVehicle(411, 200.88507+(indice*4), 1908.45862, 17.6406); -- localizado en Area 51 end setVehicleColor(autos[1], 255, 255, 255) setVehicleColor(autos[2], 255, 255, 255) setVehicleColor(autos[3], 255, 255, 255) setVehicleColor(autos[4], 0, 255, 0) -- Este es el auto que tiene el color diferente a los demas setVehicleColor(autos[5], 255, 255, 255) setVehicleColor(autos[6], 255, 255, 255) setVehicleColor(autos[7], 255, 255, 255) end) addCommandHandler("color",function(p) setVehicleColor(autos[4], 255, 0, 0) -- el color del auto con indice 4 cambiara a rojo end)
-
Intenta con esto. no lo he probado addCommandHandler("visible", function(thePlayer) if not objeto then local my_position = {getElementPosition( thePlayer )}; objeto = createObject(700, unpack(my_position)); setElementCollisionsEnabled(objeto,false); setElementAlpha(objeto,0); outputChatBox("El objeto no habia sido creado anteriormente. Ahora se creó exitosamente!", thePlayer); else for _, player in ipairs(getElementsByType("player")) do if ( player == thePlayer ) then setElementAlpha(objeto,255); else return false; end end end end)
-
you forgot alpha. Markeyr = createMarker(1486.7078857422, -1687.2141113281, 14, "cylinder", 1, 255, 255, 255, 255)
-
Exactamente que quieres hacer con esa tabla sin valores?
-
This does not work with all entities - vehicles, players and objects are exempt. ??