-
Posts
115 -
Joined
-
Last visited
-
Days Won
1
Everything posted by PashaBiceps
-
Sim está salvando como ID, porém ainda não funcionou. addEventHandler('onClientGUIClick', root, function () if (source == buttonFechar) then guiSetVisible ( wantedJanela, false ) guiSetVisible ( JanelaSec, false ) showCursor ( false ) elseif (source == buttonAlterar) then guiSetVisible ( JanelaSec, true ) guiBringToFront ( JanelaSec ) elseif (source == ButtonSec2) then guiSetVisible ( JanelaSec, false ) elseif (source == ButtonSec1) then guiSetVisible ( JanelaSec, false ) gethename = getPlayerFromID( tostring( guiGetText( editWanted1 ) ) ) getlevel = guiGetText(editWanted2) triggerServerEvent("onStupidStar", localPlayer, getlevel, gethename) end end) function getPlayerFromID (id) for i, player in ipairs (getElementsByType ("player")) do if getElementData (player, "ID") == id then -- Supondo que o ID esteja salvo com a data de nome "ID". return player end end return false end
-
Bom esta função está a buscar o nome do jogador, mas no entanto queria que fosse buscar pelo ID como posso fazê-lo? Obrigado desde já a ajuda! function getPlayerFromNamePart( string ) if( string and type( string ) == 'string' ) then local matches = { } for k,v in ipairs( getElementsByType'player' ) do if( string.find( getPlayerName( v ), tostring( string ), 0 ) ) then table.insert ( matches, v ); end end if( #matches == 1 ) then return matches[1]; end end return false; end
-
Olá gente ! Bom o meu problema é o seguinte, esta parte do meu resource envés de "ativar" para quem dá dano está "ativando" para quem recebe dano. O que posso fazer para que ative para quem dá o dano? Obrigado desde já addEventHandler( "onPlayerDamage", root, function (targetElem) if (bodypart == 3 or 4 or 5 or 6 or 7 or 8 or 9 ) then if (targetElem and targetElem:getType("player") and source:getWeapon() == 23) then if (source:getData("Venda:Police.Job")) then if (targetElem:getWantedLevel() == 0) then return addNotification(source, "Essa pessoa não está com nível de procurado!", "error"); elseif (not Boxs["Markers"]["Create"]["Vehicle"][source]) then return addNotification(source, "Nenhuma viatura encontrada para levar o sujeito!", "error"); end if (targetElem:getHealth() >= 31) then setElementVisibleTo(Boxs["Markers"]["Create"]["Jail"], source, true); targetElem:setAnimation("ped","CAR_dead_LHS"); targetElem:attach(Boxs["Markers"]["Create"]["Vehicle"][source], 0.2, -1.5, 0, 0, 0, 90); addNotification(targetElem, "Tu acabas-te de ser algemado e preso, espera ser encaminhado para a cadeia.", "info"); addNotification(source, "Tu prendes-te uma pessoa! Leva-a até ao departamento (Sirenes Azuis)", "info"); end end end end end )
-
The checkpoint is already visible only to the player. The point is that if anyone goes through the invisible checkpoint, he takes it. And the outputChatBox is being displayed for everyone.
-
Hi guys, why this function is going to everyone? Thanks in advance. function goBeach ( thePlayer, seat, jacked ) markergobeach = createMarker ( 2945.4387207031, -2053.7338867188, 2.8984375, "cylinder", 2, 255, 0, 0, 50, thePlayer ) BlipDiver = createBlipAttachedTo ( markergobeach , 41, 2, 255, 0, 0, 255, 0, 99999.0, thePlayer ) if ( isElement ( objectmission ) ) then destroyElement ( objectmission ) end if ( isElement ( markertable ) ) then destroyElement ( markertable ) end givePlayerMoney ( thePlayer, 3000 ) --setElementModel(thePlayer, getElementData(thePlayer, "ownskin_Diverskin")) -- load back --removeElementData(thePlayer, "ownskin_Diverskin") outputChatBox("Tu encontras-te o saco com o dinheiro e conseguis-te 3000€, volta para a praia", thePlayer, 255, 255, 0) addEventHandler ( "onMarkerHit", markergobeach , donegobeach ) end
-
Muito obrigado!! Daria 1000 Thanks mas não dá. Funcionou perfeitamente, muito muito obrigado
-
----------- ACL function aclpm (thePlayer) if (thePlayer.type == "player") then local acc = thePlayer.account; if acc and not acc.guest then if ACLGroup.get("PM"):doesContainObject("user."..acc.name) then thePlayer:setData("Venda:Police.Job", true); acc:setData("Venda:Police.Job", true); thePlayer:getAccount():setData("Venda:Police.Job", thePlayer:getData("Venda:Police.Job")); end end end end --addEventHandler("onClientResourceStart", resourceRoot, aclpm) addEventHandler("onClientResourceStart", resourceRoot, function (source) aclpm(source); end ) Estou chamando quando o recurso inicia e também já tentei quando o player faz o login. Mas sem sucesso. Obrigado pela ajuda até agora
-
Obrigado pela ajuda, mas a data ainda não é setada ao jogador infelizmente.
-
function aclpm (theElem) if (theElem:getType("player")) then if aclgroup:doesContainObject ("user."..theElem:getName (theElem:getAccount ()), ACLGroup.get ("PM")) then theElem:setData("Venda:Police.Job", true) theElem:getAccount():setData("Venda:Police.Job", theElem:getData("Venda:Police.Job", true)) end end end Coloquei a função da ACL em programação OOF, mas não funcionou. Ainda não seta a data Obrigado pela ajuda até agora
-
Obrigado a ambos, porém não resultou. Este Script está totalmente em OOP não sei se isso pode interferir com essa função. O que quero que funcione é isto addEventHandler("onElementDataChange", root, function (dataName, oldValue) if (source:getType("player") and dataName == "Venda:Police.Job" and source:getData(dataName)) then setElementVisibleTo(Boxs["Markers"]["Create"]["Skins"], source, true); outputChat(source, "Parabens! Você agora é um Policial, para saber tudo sobre a profissão(como prender, viaturas, muito mais), pressione o botão 'k'", "warning") giveWeapon(source, 31, 5000); giveWeapon(source, 24, 5000); giveWeapon(source, 3); triggerClientEvent(source, getThisResource():getName()..": 3DText", root, "Seleção de Skins", Boxs["Markers"]["Create"]["Skins"]); elseif (source:getType("player") and dataName == "Venda:Police.Job" and not source:getData(dataName)) then takeWeapon(source, 31); takeWeapon(source, 24); takeWeapon(source, 3); setElementVisibleTo(Boxs["Markers"]["Create"]["Skins"], source, false); end end ) Ou seja, isso vai buscar a dataname = Venda.Police.Job para que funcione e também queria fazê-lo por ACL mas não está a setar essa data.
-
Eu estou a tentar atribuir alguma data a jogadores que sejam colocados em um determinando grupo de ACL. Mas sem sucesso, tem alguma coisa errada com este código? function aclpm (thePlayer) accName = getAccountName (getPlayerAccount (thePlayer)) if isObjectInACLGroup("user."..accName, aclGetGroup ("PM")) and getElementType(thePlayer) == "player" then thePlayer:setData("Venda:Police.Job", true); thePlayer:getAccount():setData("Venda:Police.Job", thePlayer:getData("Venda:Police.Job")); end end
-
Hi guys, i'm trying add some data for the players that went in determinate acl group but without success. function aclpm (thePlayer) accName = getAccountName (getPlayerAccount (thePlayer)) if isObjectInACLGroup("user."..accName, aclGetGroup ("PM")) and getElementType(thePlayer) == "player" then thePlayer:setData("Venda:Police.Job", true); thePlayer:getAccount():setData("Venda:Police.Job", thePlayer:getData("Venda:Police.Job")); end end What is wrong? Thanks in advance for any help
-
Hi guys, i was testing my works and i depared with an error. When i finish my job i receive 3 messages of payment. I dont know why, i stopped all resources, the bug disappeared and everything worked fine, i activated all again and everything keep right. I restarted the server and the bug appear again. What can be? What i can do? When i restarted all resources the bug was gone. When i restarted the server the bug come back. Thanks in advance for any help
-
Funcionou perfeitamente, obrigado! Peço desculpa pelo inconveniente. Obrigado novamente
-
Oi gente, estou tentando restringir um dos meus trabalhos para apenas o nível 20 ou superior. O problema é que a mensagem avisando que o jogador precisa de ter nível 20 aparece para todo mundo, mesmo que tenha nível suficiente e também mesmo aparecendo a mensagem de erro qualquer um consegue entrar com o comando, ou seja, não está funcionando a minha restrição. O que eu devo ou posso fazer para que fique funcional? Obrigado desde já ! addEventHandler("onMarkerHit", getAstronautJob, function(player) local lvls = tonumber(getElementData(player, "Level")) if (getElementData(player, lvls) == 20) then if not (playerAstronaut[player]) then if (getElementDimension(player) == 0) then outputChatBox("#483D8B[BSS] #FFFFFFOlá! Para trabalhar digita #483D8B/bss", player, 255, 255, 255, true); outputChatBox("#483D8B[BSS] #FFFFFFCaso queiras desistir do trabalho, usa #483D8B/sairbss", player, 255, 255, 255, true); end else outputChatBox("#483D8B[BSS] #FF3232Falha. #FFFFFFTu já estás a trabalhar como um bss.", player, 255, 255, 255, true); end else outputChatBox("#483D8B[BSS] #FF3232Falha. #FFFFFFPrecisas de nível 20 para trabalhar como bss.", player, 255, 255, 255, true); end end )
-
You are totally right, was my mistake and i need to say sorry. Script awesome! I had a script interfering ! Thanks guys <3
-
Like i said, everything works perfectly, but the engine off the car don't turn off, unfortunately. I don't understand. Thanks to all for helping until now
-
This error is already solved yesterday, now is another problem '-
-
Thanks for ur anwser! Yes, im working on server side and i tried copy and save the script 10 times. Lights works fine but the engine just give me a message, listening the sound of the car seems like the engine turn on, but dont turn off.
-
[Ajuda] dxDrawRectangle e dxDrawText
PashaBiceps replied to PashaBiceps's topic in Programação em Lua
Felizmente o erro foi resolvido do script, mas agora não está renderizando os dxDrawRectangle e os dxDrawText, ou seja, não aparecem mas não dá qualquer erro. Muito obrigado pela ajuda de vocês até agora EDIT: RESOLVIDO !! Obrigado a todos os participantes. Muito muito obrigado -
[Ajuda] dxDrawRectangle e dxDrawText
PashaBiceps replied to PashaBiceps's topic in Programação em Lua
Infelizmente o erro persiste. -
Thanks a lot bro.
-
[Ajuda] dxDrawRectangle e dxDrawText
PashaBiceps replied to PashaBiceps's topic in Programação em Lua
Foi eficaz para resolver os erros, já não aparece mas não está funcionando agora. -
Hi guys, im doing a job and is almost done, just need one more thing. When some player starts the job, The skin of the job is set to him with this code. setElementData(player, "astronaut:Skin", setPedSkin (player, 264)); Until now, everything works. My problem is when the player leaves the job and the skin is not set to skin that the player was before, continues with the skin of the job. Even with this code. removeElementData(player,"astronaut:Skin"); Thanks in advance for any help. So far, everthing works. My problem is when the player leaves the job the skin is not set to what the player was before but rather continues with the skin of the jobSo far, everything works. My problem is when the player leaves the job the skin is not set to what the player was before but rather continues with the skin of the job.