-
Posts
37 -
Joined
-
Last visited
Recent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
Arantes's Achievements
Rat (9/54)
2
Reputation
-
OrionTH1 reacted to a post in a topic:
Como faço para quando o cara estiver baixando os mods ele não poder jogar
-
Utilize o botão <> (code) para que possam te ajudar.
-
Os dados retornaram certinho pelo outputChatBox : funcao checknick: leu elementdata: Arantes de Sem_Registro funcao haveothernick recebeu: Arantes de player: Sem_Registro for leu o checknick: Arantes de Sem_Registro Mas por motivo desconhecido , consigo registar o mesmo Nick/Nome em outras contas. Esse sistema de nick é para deixar o nick do jogador fixo quando o mesmo definir no painel , sendo assim quando o jogador entrar , verificar se o nick dele e igual o do elementData playername , se nao for ele seta oque esta no playername e se nao encontrar deixa como Sem_Registro.
-
Estou utilizando a seguinte maneira para salvar os dados : -- Salvar o checknick quando sair. local checkNick = getElementData ( source, "checknick" ) or "Error Save Login" setAccountData ( conta, "checknick", checkNick ) -- Carregar o checknick quando o jogador entrar e quando a resource iniciar. local check = getAccountData ( conta, "checknick" ) or "Error Load Login" setElementData ( source, "checknick", check )
-
Arantes reacted to a post in a topic:
[ AJUDA ] Verificar elementData
-
Muito obrigado pela ajuda e explicação , mas não consigo entender porque ainda consigo register o mesmo nome.
-
Gostaria de verificar se nome que o jogador escrever no painel , é igual a outro nome definido no elementData de outro jogador. No client-side esta assim : local Nick = guiGetText(NickBoxText) setElementData(localPlayer, "checknick", Nick) local check = getElementData(localPlayer, "checknick") if check then triggerServerEvent("checkNick", getLocalPlayer()) end function successNick() CloseDxPanelCreate () triggerServerEvent ("changename", getLocalPlayer()) end addEvent("successNick", true) addEventHandler("successNick", getRootElement(), successNick) E no server-side assim : function haveOtherNick (myName) for i, player in ipairs (getElementsByType("player")) do if (getElementData (player, "checknick") and getElementData (player, "checknick") == myName) then return true end end return false end function checkNick() local nome = getElementData (source, "checknick") if (nome) then if (haveOtherNick(nome)) then outputChatBox ("Já tem alguém com esse nome online.") else triggerClientEvent("successNick", getRootElement()) setElementData(source, "playername", nome) end end end addEvent("checkNick", true) addEventHandler("checkNick", getRootElement(), checkNick) O erro e que sempre retorna o outputChatBox, mesmo colocando outro nome diferente. Tive ajuda de alguns membros do forum , mas não consegui solucionar .
-
Arantes reacted to a post in a topic:
[ AJUDA ] onPickupHit
-
Muito obrigado , funcionou certinho ! So adicionei para o jogador perder o dinheiro quando morrer.?
-
Arantes reacted to a post in a topic:
[ AJUDA ] onPickupHit
-
Sim existe a possibilidade , você pode usar este código https://community.multitheftauto.com/index.php?p=resources&s=details&id=16502 como base.
-
Arantes reacted to a post in a topic:
[ AJUDA ] onPickupHit
-
Desculpe , não informei a linha kk . Esta dando erro na linha 17 , no onPickupHit ?.
-
Gostaria de fazer um pickup quando o jogador morrer, ao passar nele , outro jogador recebe o dinheiro do que morreu. function dropPickup() local playerMoney = getPlayerMoney(source) local x,y,z = getElementPosition(source) moneyPickup = createPickup(x,y,z,3,1212) setElementData(moneyPickup, "moneydrop", playerMoney) takePlayerMoney(source, playerMoney) end addEventHandler("onPlayerWasted", root, dropPickup) function onPickup(player) local moneyDrop = getElementData(source, "moneydrop") givePlayerMoney(player,moneyDrop) destroyElement(source) end addEventHandler("onPickupHit", moneyPickup, onPickup) Estou tendo o seguinte erro : Bad argument 'addEventHandler' Expected element at argument 2, got nil.
-
Arantes reacted to a post in a topic:
[ AJUDA ] Verificar Nick
-
Arantes reacted to a post in a topic:
[ AJUDA ] Verificar Nick
-
Sim sim é verdade, mas o código define o nick do jogador fixo, ai por isso estou salvando em elementData. Obrigado pela ajuda , mas a verificação esta passando direto , consigo salvar o mesmo nome que alguém tenha em seu playername.
-
Entendi muito obrigado ?, mas seria possivel fazer algo assim ? local nome = getElementData (localPlayer, "playername") if guiGetText(NickBoxText) == (haveOtherNick(nome)) then outputChatBox ("Já tem alguém com esse nome online.") return end -- Onde esta setando o nome. SetNickBoxText = guiGetText(NickBoxText) setElementData ( localPlayer, "playername", ""..SetNickBoxText.."" )
-
Gostaria de fazer uma verificação que, quando o jogador colocasse seu nome no painel , verificava se ja existe e retornava com um aviso . local nick = getElementData ( localPlayer , "playername" ) if (nick == false) then -- REGISTRAR else outputChatBox("Nome existente !") end
-
Muito obrigado ! ?
-
Arantes reacted to a post in a topic:
[ AJUDA ] source em setTimer
-
Gostaria de checar se há algum jogar no marker, sendo assim , avisando com um outputChatBox . local marker = createMarker (2493.1730957031, -910.67498779297, 125.1, "cylinder", 1.0, 255, 69, 0, 60 ) setTimer (function (theSource) if isElementWithinMarker(theSource, marker) then outputChatBox("Alguém esta no Marker!") end end, 500, 0, source) Mas estou tendo o seguinte erro : Bad argument 'isElementWithinMarker' [ Expected element at argument 1, got nill ] .
