Jump to content

manawydan

Members
  • Posts

    980
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by manawydan

  1. manawydan

    killtimer

    try use global variables for the timer
  2. manawydan

    Add object

    yes, search in community for "ingame map editor" for example.
  3. manawydan

    Interiors

    you can try: create objects in other interior.
  4. algum valor vc tem que colocar negativo e eu acho q da certo. tente local sWidth,sHeight = guiGetScreenSize() local Width = sWidth-400 local health = getElementHealth(getLocalPlayer()) local armor = getPedArmor(getLocalPlayer()) local HealthBar = sWidth*( -health / Width ) local lineaarmor = sWidth*( armor / Width ) dxDrawRectangle(sWidth*0.79,sHeight*0.072,HealthBar,sHeight*0.03,tocolor(255,0,0,250) ,false) dxDrawRectangle(sWidth*0.79,sHeight*0.104,lineaarmor,sHeight*0.03,tocolor(0,223,220,250) ,false)
  5. tente isso local Marker = createMarker ( -2235.21, -1736.60, 479.80, "cylinder", 2.5, 0, 0, 255, 170 ) local Marker1=nil local blip1=nil function paraquedismo ( thePlayer, matchingDimension ) if isElementWithinMarker( thePlayer, Marker) then outputChatBox("Para pular de paraquedas digite /pular!", thePlayer, 255, 0, 0) end end addEventHandler ("onMarkerHit", Marker, paraquedismo) function pular ( playerSource, matchingDimension ) if isElementWithinMarker( playerSource, Marker) then setElementPosition( playerSource, -2235.21, -1736.60, 1300.80 ) giveWeapon ( playerSource, 46 ) setPedWeaponSlot(playerSource, getSlotFromWeapon(46)) outputChatBox("Caia no Alvo para ganhar 5000$!", thePlayer, 255, 0, 0) Marker1 = createMarker ( -2407.97, -596.58, 131.80, "cylinder", 7.0, 0, 0, 255, 170 ) blip1 = createBlip( -2407.97, -596.58, 132.64, 0, 0, 0, 255, 255 ) setBlipSize ( blip1, 5 ) else outputChatBox("Você não está na área de Paraquedismo!", thePlayer, 255, 0, 0) end end addCommandHandler ( "pular", pular ) function cairmarker ( playerSource, matchingDimension ) if isElementWithinMarker( playerSource, Marker1) then givePlayerMoney(playerSource, 5000) outputChatBox("Você ganhou 5000$ por cair no alvo!", playerSource, 255, 0, 0) else outputChatBox("Você não conseguiu cair no Alvo!", playerSource, 255, 0, 0) end end addEventHandler ("onMarkerHit", Marker1, cairmarker)
  6. Bom, eu tinha feito um inventario e tentei usa elementData para colocar e tirar coisas dele e não funcionou, tentei com tabelas e tambem não, queria saber qual o problema, porque quando uso o item ele ainda continua? obrigado!
  7. um exemplo: local currentObj = nil function createObject_(p,_,ID) local x,y,z = getElementPosition(p) currentObj = createObject (ID,x,y,z) end addCommandHandler("create",createObject_) function removeObject ( ) if (currentObj) and isElement(currentObj)then destroyElement(currentObj) currentObj=nil end end addCommandHandler("remove",removeObject)
  8. procure a comunidade mta sa por "spawn" criado por 50p tem o que você quer
  9. tente function gangskin (p, commandName, teamName) getPlayersInTeam (teamName) setElementModel ( p, 230) setPlayerTeam ( p, teamName ) end addCommandHandler("gangskin",gangskin)
  10. ok tente denovo --Client side-- local Ped1 = createPed(0, -56.77341, 2083.91870, 33.67812) setElementDimension(Ped1,10) setPedControlState(Ped1,"fire",true) triggerServerEvent ("ondararma", resourceRoot, Ped1 ) setPedAimTarget(Ped1, 238.79436, 1863.61792, 20.07644) function cancelPedDamage1() cancelEvent() end addEventHandler("onClientPedDamage", Ped1, cancelPedDamage1) --server function armaped(ped) giveWeapon(ped, 31, 900, true) end addEvent( "ondararma", true ) addEventHandler( "ondararma", resourceRoot, armaped)
  11. tente ai parsa --Client side-- Ped1 = createPed(0, -56.77341, 2083.91870, 33.67812) setElementDimension(Ped1,10) setPedControlState(Ped1,"fire",true) --setPedControlState(Ped1,"aim_weapon",true) triggerServerEvent ( "ondararma", resourceRoot, Ped1 ) setPedAimTarget(Ped1, 238.79436, 1863.61792, 20.07644) function cancelPedDamage1() cancelEvent() end addEventHandler("onClientPedDamage", Ped1, cancelPedDamage1) --server function armaped(ped) setTimer( giveWeapon, 100, 1, ped, 31, 900, true) end addEvent( "ondararma", true ) addEventHandler( "ondararma", resourceRoot, armaped)
  12. try change "Cylinder" to "cylinder"
  13. try function Blood(loss,attacker,weapon,bodypart) local x, y, z = getElementPosition(source) local slapvalue = 5 local timervalue = 10000 local healthamount = 30 if loss > healthamount then fxAddBlood ( x, y, z-2, 0.00000, 0.00000, 0.00000, 1, 1 ) --setElementHealth ( targetPlayer, getElementHealth(targetPlayer) - slapvalue ) end end addEventHandler ("onClientPlayerDamage",root,Blood)
  14. if is zombies by slothman, you can use the function createZombie to create zombie in one position example: local x,y,z = 0,0,3 exports.zombies:createZombie(x, y, z, 90)
  15. in quit you can do this function onQuit() if(players_zombies[source])then for k,v in ipairs(players_zombies[source])do if(isElement(v))then destroyElement(v) end end players_zombies[source]=nil print("Zombies : "..getPlayerName(source).." destroyed!") end end addEventHandler("onPlayerQuit",root,onQuit)
  16. o que você quer faze com o evento onSettingChange ? para pegar o valor usamos fromJSON para "converter" o valor para lua, igual no exemplo wiki: function makeSettingsChangesVisible ( setting, oldValue, newValue ) whatItWas = fromJSON ( oldValue ) whatItsNow = fromJSON ( newValue ) outputDebugString ( "The setting "..setting.." was "..whatItWas.." and has been changed to "..whatItsNow.."." ) --Making the setting change visible in debug (use /debugscript [number] to see it) end addEventHandler( "onSettingChange", getRootElement(), makeSettingsChangesVisible ) --adding the event O oldValue seria o valor antigo, o new valor é o valor de agora, e o setting é o nome do valor. Esse evento é parecido com onElementDataChange. Só que para ele ocorrer deve haver uma setting
  17. é porque RemoveEventHandler não existe removeEventHandler esse é o certo lua é case sensitive(letras maiusculas e minusculas são diferentes) apenes troque o RemoveEventHandler para removeEventHandler
  18. you can use colShapes and dx functions
  19. sorry now work(i tested) local players_zombies={} local zombiePerPlayer=3 function zombiesperplayer() local players = getElementsByType("player") for k,v in ipairs(players) do if not players_zombies[v]then players_zombies[v]={} end local number = #players_zombies[v] if(number>=3)then return end local interior = getElementInterior(v) local dimension = getElementDimension(v) local x,y,z = getElementPosition(v) local zp = zombiePerPlayer-number for i=1,zp do zombie = exports.zombies:createZombie(x+math.sin(math.rad(-math.random(360)))*(math.random(1,5)), y+math.cos(math.rad(-math.random(360)))*(math.random(1,5)), z, math.random(360), nil, interior, dimension ) setElementData(zombie,"zombiePlayer",v) table.insert(players_zombies[v],zombie) end end end zombiesperplayer() setTimer(zombiesperplayer,15000,0) addEventHandler ("onPedWasted",root, function() local playerData = getElementData(source,"zombiePlayer") if(playerData)then local number = #players_zombies[playerData] if(number~=0)then table.remove(players_zombies[playerData],players_zombies[playerData][source]) end end end)
×
×
  • Create New...