Jump to content

Doongogar

Members
  • Posts

    342
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by Doongogar

  1. não entendi muito bem, eu tentei desta forma aqui e mesmo assim o erro permanece: function FabricarAK(source) if isElementWithinMarker (source, markerAk47) then if getPlayerMoney(source) >= 3000 then setElementPosition(source, 1050.2840039062, -305.37005615234, 72.99308013916) setElementRotation(source, 0, 0, 270) setPedAnimation(source, "INT_HOUSE", "wash_up", -1, true, false, false) setElementFrozen(source, true) setTimer(function(thePlayer) setPedAnimation(thePlayer, nil) setElementFrozen(thePlayer, false) local retirou = takePlayerMoney(thePlayer, 3000) if retirou then giveWeapon(thePlayer, 30, 300) end, 3000, 1) end end end end addCommandHandler("ak47", FabricarAK)
  2. esse codigo aqui faz com que o player não expulse o outro do carro, mais tambem faz com que o player não consigo entrar de piloto mesmo com o veiculo vazio, gostaria de saber como resolvo: addEventHandler("onVehicleStartEnter", root, function(player, seat) if seat == 0 and getVehicleOccupant(source) then cancelEvent() end end)
  3. olá eu estava a criar um codigo que cria um marker e é possivel "fabricar" uma arma neste marker quando a pessoa fabricasse uma arma seria setada uma animação e ela seria congelada e depois de um tempo seria descongelada e a animação seria setada em "nil" mais esta dando erro no setTimer codigo e erro abaixo: function FabricarAK(source) if isElementWithinMarker (source, markerAk47) then if getPlayerMoney(source) >= 3000 then setElementPosition(source, 1050.2840039062, -305.37005615234, 72.99308013916) setElementRotation(source, 0, 0, 270) setPedAnimation(source, "INT_HOUSE", "wash_up", -1, true, false, false) setElementFrozen(source, true) setTimer(function(thePlayer) setPedAnimation(source, nil) setElementFrozen(source, false) local retirou = takePlayerMoney(source, 3000) if retirou then giveWeapon(thePlayer, 30, 300) end, 3000, 1, thePlayer) end end end end addCommandHandler("ak47", FabricarAK) ERROR: loading script failed fabrica/script.lua:24 unexpected symbol near ' , '
  4. Olá Oque eu quero e bem Simples eu gostaria de saber como faço para o jogo iniciar mesmo com o play desligado, queria saber se e alguma função que utiliza pra isso.
  5. olá tentei criar um codigo onde um player não pode expulsar o outro do carro mais tem algumas coisas que eu gostaria de melhorar 1- queria saber como faço para que o player não consigo nem executar a ação de expulsar o player do carro ja que esse codigo so expulsa o player ao entrar no carro 2- o player também e expulso se ele entrar de passageiro, gostaria de saber como faço para que o codigo verifique se o player entrou de passageiro ou tentou entrar de motorista codigo abaixo: function shutvehicle(playerSource) local veh = getPedOccupiedVehicle(source) local motorista = getVehicleOccupant(veh, 0) if (motorista) then removePlayerFromVehicle(source) end end addEventHandler("onPlayerVehicleEnter", getRootElement(), shutvehicle)
  6. a indentação costumo aplicar quando o codigo ta pronto ja que não afeta no que ele faz e como assim nome de funções nativas? poderia explicar?
  7. olá estou tentando criar um codigo para staff's menores onde eles conseguem se auto setar uma arma nesse codigo eu gostaria de restrigir umas armas espeficicas, mais esta dando um erro que não consigo corrigir "stack overflow", esta dando na linha onde giva arma gostaria de ajuda porfavor codigo abaixo: function giveWeapon(thePlayer, cmd, weaponId, ammo) local weap = giveWeapon(thePlayer, weaponId, 5000, true) local wea = getElementModel(weap) if wea ~= 362 then takeAllWeapons(thePlayer) end end addCommandHandler("givew", giveWeapon)
  8. olá eu gostaria de saber como eu poderia fazer para que o killmessages viesse com o id dos players depois dos nomes deles ex: (Nome de quem matou(id) Nome de quem morreu(id) o codigo que imagino que deve ser editado e esse aqui abaixo: local config = { ["lines"] = 5, ["startY"] = 0.35, ["textHeight"] = 16, ["iconHeight"] = 20, ["iconSpacing"] = 4, ["defaultWeapon"] = 255, ["fadeTime"] = 5000, ["startFade"] = 15000, ["align"] = "right", ["startX"] = -10 } local default = { ["lines"] = 5, ["startY"] = 0.25, ["textHeight"] = 16, ["iconHeight"] = 20, ["iconSpacing"] = 4, ["defaultWeapon"] = 255, ["fadeTime"] = 5000, ["startFade"] = 15000, ["align"] = "right", ["startX"] = -10 } function KillMessages_onPlayerWasted(totalammo, killer, killerweapon, bodypart) local usedVehicle = nil local killerType = nil local killerweapon = killerweapon or 255 -- In very rare cases killer isn't nil or false but isn't an element. if (killer and not isElement(killer)) then killer = nil end if (killer) then killerType = getElementType(killer) end -- Sometimes the killer is returned as the driver instead of vehicle, like when driving a Rhino but we need the vehicle ID if (killerType == "player") then local vehicle = getPedOccupiedVehicle(killer) if (vehicle and getPedWeapon(killer) == 0) then usedVehicle = getElementModel(vehicle) end end -- Change the killer into the vehicle controller if (killer and killerType == "vehicle") then usedVehicle = getElementModel(killer) killer = getVehicleController(killer) or killer killerType = getElementType(killer) end -- If killed by rocket and was on foot player turn it into their current weapon if (killerweapon == 19 and killerType == "player" and not isPedInVehicle(killer)) then killerweapon = getPedWeapon(killer) or 51 end -- Got a killer? Print the normal "* X died" if not if (killer and killerType == "player") then local kr, kg, kb = getPlayerNametagColor(killer) if (getPlayerTeam(killer)) then kr, kg, kb = getTeamColor(getPlayerTeam(killer)) end -- Suicide? if (source == killer) then local triggered = triggerEvent("onPlayerKillMessage", source, false, killerweapon, bodypart) --outputDebugString("Cancelled: "..tostring(triggered)) if (triggered) then eventTriggered(source, false, killerweapon, bodypart, true, usedVehicle) return end end local triggered = triggerEvent("onPlayerKillMessage", source, killer, killerweapon, bodypart) --outputDebugString("Cancelled: "..tostring(triggered)) if (triggered) then eventTriggered(source, killer, killerweapon, bodypart, false, usedVehicle) end else local triggered = triggerEvent("onPlayerKillMessage", source, false, killerweapon, bodypart) --outputDebugString("Cancelled: "..tostring(triggered)) if (triggered) then eventTriggered(source, false, killerweapon, bodypart, false, usedVehicle) end end end addEventHandler("onPlayerWasted", root, KillMessages_onPlayerWasted) addEvent ( "onPlayerKillMessage" ) function eventTriggered ( source,killer,weapon,bodypart,suicide,usedVehicle ) local wr,wg,wb = getPlayerNametagColor ( source ) if getPlayerTeam ( source ) then wr,wg,wb = getTeamColor ( getPlayerTeam ( source ) ) end local kr,kg,kb = false,false,false if ( killer ) then kr,kg,kb = getPlayerNametagColor ( killer ) if getPlayerTeam ( killer ) then kr,kg,kb = getTeamColor ( getPlayerTeam ( killer ) ) end end if ( usedVehicle ) then weapon = usedVehicle end outputKillMessage ( source, wr,wg,wb,killer,kr,kg,kb,weapon ) -- local extra = "" if ( usedVehicle ) then extra = " (Vehicle)" end if ( killer ) then if suicide then local weaponName = getWeaponNameFromID ( weapon ) if weaponName then outputConsoleKillMessage ( "* "..getPlayerName(source).." killed himself. ("..weaponName..")" ) else outputConsoleKillMessage ( "* "..getPlayerName(source).." killed himself."..extra ) end else local weaponName = getWeaponNameFromID ( weapon ) if weaponName then outputConsoleKillMessage ( "* "..getPlayerName(killer).." killed "..getPlayerName(source)..". ("..weaponName..")" ) else outputConsoleKillMessage ( "* "..getPlayerName(killer).." killed "..getPlayerName(source).."."..extra ) end end else outputConsoleKillMessage ( "* "..getPlayerName(source).." died."..extra ) end -- end function outputConsoleKillMessage ( text ) outputConsole ( text ) end function outputKillMessage ( killed, wr,wg,wb,killer,kr,kg,kb,weapon,width,resource ) if ( resource ) then resource = getResourceName(resource) end if not isElement(killed) then outputDebugString ( "outputKillMessage - Invalid 'wasted' player specified",0,0,0,100) return false end if not getElementType(killed) == "player" then outputDebugString ( "outputKillMessage - Invalid 'wasted' player specified",0,0,0,100) return false end return triggerClientEvent(getRootElement(),"onClientPlayerKillMessage",killed,killer,weapon,wr,wg,wb,kr,kg,kb,width,resource ) end function outputMessage ( message, visibleTo, r, g, b, font ) if type(message) ~= "string" and type(message) ~= "table" then outputDebugString ( "outputMessage - Bad 'message' argument", 0, 112, 112, 112 ) return false end if not isElement(visibleTo) then outputDebugString ( "outputMessage - Bad argument", 0, 112, 112, 112 ) return false end --Turn any resources into resource names if type(message) == "table" then for i,part in ipairs(message) do if type(part) == "table" and part[1] == "image" then if part.resource then message[i].resourceName = getResourceName(part.resource) else part.resourceName = getResourceName(sourceResource) end end end end return triggerClientEvent ( visibleTo, "doOutputMessage", visibleTo, message, r, g, b, font ) end function setKillMessageStyle ( startX,startY,align,lines,fadeStart,fadeAnimTime ) if ( not startX ) then startX = default.startX end if ( not startY ) then startY = default.startY end if ( not align ) then startY = align.startY end if ( not lines ) then lines = default.lines end if ( not fadeStart ) then fadeStart = default.startFade end if ( not fadeAnimTime ) then fadeAnimTime = default.fadeTime end config.startX = startX config.startY = startY config.align = align config.lines = lines config.startFade = fadeStart config.fadeTime = fadeAnimTime for k,v in ipairs(getElementsByType"player") do triggerClientEvent(v,"doSetKillMessageStyle",v,config.startX,config.startY,config.alignX,config.lines,config.startFade,config.fadeTime) end return true end addEvent ("onClientKillmessagesLoaded",true) addEventHandler ( "onClientKillmessagesLoaded", getRootElement(), function() triggerClientEvent(client,"doSetKillMessageStyle",client,config.startX,config.startY,config.alignX,config.lines,config.startFade,config.fadeTime) end )
  9. aqui está, bloqueei alguns veiculos como tanque aviões e helicopteros, mais e possivel retirar a syntax é: /carro (id do veiculo) codigo abaixo: function createVeh(thePlayer, cmd, idModel) local acc = getAccountName (getPlayerAccount(thePlayer)) if isObjectInACLGroup ("user."..acc, aclGetGroup("acl")) then if not isPedInVehicle(thePlayer) then local x,y,z = getElementPosition(thePlayer) local _, _, rz = getElementRotation(thePlayer) local vehicle = createVehicle(idModel, x, y, z, 0, 0, rz) warpPedIntoVehicle(thePlayer, vehicle) local id = getElementModel(vehicle) if id ~= 432 and id ~= 425 and id ~= 592 and id ~= 577 and id ~= 511 and id ~= 520 and id ~= 553 and id ~= 493 and id ~= 449 and id ~= 537 and id ~= 569 and id ~= 570 and id ~= 538 and id ~= 590 then else destroyElement(vehicle) outputChatBox("Veiculo Não Permitido!", thePlayer, 255, 0, 0, true) end end end end addCommandHandler("carro", createVeh) da proxima vez que for colocar um codigo aqui use a função do site de agregar codigos em seu post e selecione a lingaguem .lua Caso Seja em formato .lua clicke nas setinhas apontando para lados opostos, e insira o codigo.
  10. então eu gostaria de saber como faço para getar todas as armas do player não só as que ele esta segurando na mão function getWeapon(thePlayer) local armas = getPlayerWeapon(thePlayer) outputChatBox("Armas Do Jogador: #FF0000"..armas.."", thePlayer, 255, 255, 255, true) end addCommandHandler("verArmas", getWeapon) também quando uso a função getWeapon ela se refere a arma com o id dela gostaria de saber como substituir os id's das armas por nomes
  11. não estou entendendo como utiliza essa função, poderia me explicar?
  12. fica dando este erro repetidas vezes, oque seria?
  13. Olá Criei um Codigo que faz com que crie um saco de dinheiro nas costas do player ao dar um comando mais ao agachar o objeto fica suspenso no ar, tentei criar uma condição caso o player esteja em modo "duck" que acredito ser o estado em que o player está agachado(caso esteja errado me avise), mais não funcionou não entendo muito dessas coisas porfavor ajudem se puderem codigo e imagens do player agachado e em pé abaixo: function attach(thePlayer, commandName) local x, y, z = getElementPosition(thePlayer) local din = createObject(1550, x, y - 0.35, z + 0.40) attachElements(din, thePlayer, 0, - 0.35, 0.40) setElementCollisionsEnabled(din, false) if isPedDucked(thePlayer) then setElementPosition(din, x, y - 0.35, z) end end addCommandHandler("din", attach)
  14. então recentement tentei fazer um codigo com que o player consigo digitar um comando ai a hud dele seria escondida, e eu gostaria que esse nesse script fosse possivel detectar se a hud esta escondida ou não, e se estiver escondida executa a ação de mostar a hud novamente mais não está funcionando, gostaria de saber o porquê que não esta funcionando e como corrigir, codigo que fiz abaixo: function hud(thePlayer) local ativo = setPlayerHudComponentVisible(thePlayer, "all", false) if ativo then setPlayerHudComponentVisible(thePlayer, "all", true) end end addCommandHandler("hud", hud)
  15. Como Posso Fazer Com Que o Player Fiquei Imortal Com Um Comando e Que Possa Ativar e Desativar Com o Mesmo Comando
  16. não sei se compreendeu oque eu disse pois como lord henry disse tenho um QI de baixo nível, e não é preciso ser muito inteligente para perceber isso, mais este codigo faz com que o player só pegue fogo na água, e eu gostaria de um que fizesse com que o player não parasse de pegar fogo.
  17. olá recentement achei esse codigo que faz com que o player que executou o comando fique mais rapido, mais essa função faz com que o horario fique avançado também e na visão de quem se setou uma velocidade os outros ficam meios bugados ficam rapidos mais não saem rapidamente do lugar na visão dos outros fica tudo normal mais esta extremamente bugado poderiam me ajudar porfavor codigo abaixo: function speed(command, value) setGameSpeed(tonumber(value)) outputChatBox("Velocidade Setada Com Sucesso", 0, 255, 0, true) end addCommandHandler("rlkspeed", speed)
  18. então eu queria saber como eu posso fazer com quer a função setPedOnFire faça com afetado pelo fogo não pare de pegar fogo
  19. olá, não sei explicar muito bem isso mais eu gostaria que um comando tivesse variações exemplo: /infos empregos - mostra uma mensagem no chat ou /infos cnh - mostra outra mensagem no chat
  20. não sei se é so pra mim que ta dando o erro, mais ta dando isso diversas vezes no debug mesmo a reprodução do video o erro continua spamando no debug WARNING: video/script.lua:13: Bad argument @ 'dxDrawImage' [Expected material at argument 5] [DUP x215]
  21. do textDestroyDisplay eu ja estava ciente, e o setTimer a principio ja estava sendo usado no codigo o que eu quero e retirar o anuncio com o mesmo comando, e não que o anuncio suma depois de certo tempo.
×
×
  • Create New...