Jump to content

lucasds

Members
  • Posts

    6
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

lucasds's Achievements

Vic

Vic (3/54)

1

Reputation

  1. function adminchat4 ( thePlayer, _, ...) local message = table.concat({...}, "") local NomeDoJogador = tostring(getPlayerName(thePlayer)) local IdDoJogador = tostring(getElementData(thePlayer, "ID_Para_Alterar") or "ID Desconhecido") --altere o "ID_Para_Alterar" para o getElementData de id do seu servidor if getElementData(thePlayer, "ChatGlobal: Delay1", true) then return outputChatBox(MensagemFalandoRapidoDemaisGlobal, thePlayer, 255, 255, 255, true) end for _, player in ipairs(getElementsByType("player")) do if (isPlayerOnGroup(player)) then conta = getAccountName( getPlayerAccount (player)) if isObjectInACLGroup("user."..conta, aclGetGroup("Console")) then return outputChatBox(NomeDoJogador.."("..IdDoJogador..")".." # 838b83 @ Anónimo: #ffffff"..message, player, 255, 255, 255, true) elseif isObjectInACLGroup("user."..conta, aclGetGroup("Admin")) then return outputChatBox(NomeDoJogador.."("..IdDoJogador..")".." # 838b83 @ Anónimo: #ffffff:"..message, player, 255, 255, 255, true) elseif isObjectInACLGroup("user."..conta, aclGetGroup("SuperModerator")) then return outputChatBox(NomeDoJogador.."("..IdDoJogador..")".." # 838b83 @ Anónimo: #ffffff"..message, player, 255, 255, 255, true) elseif isObjectInACLGroup("user."..conta, aclGetGroup("Moderador")) then return outputChatBox(NomeDoJogador.."("..IdDoJogador..")".." # 838b83 @ Anónimo: #ffffff"..message, player, 255, 255, 255, true) elseif isObjectInACLGroup("user."..conta, aclGetGroup("Everyone")) then outputChatBox("# 838b83 @ Anónimo: #ffffff"..message, player, 255, 255, 255, true) end end end setElementData(thePlayer, "ChatGlobal: Delay2", true) setTimer(setElementData, 100, 1, thePlayer, "ChatGlobal: Delay2", false) end addCommandHandler(ComandoDoChatGlobal4, adminchat4) Testa o código acima e me retorna se funcionou eu alterei algumas coisas no seu código inclusive coloquei um return antes de cada outputChatBox para quando o player estiver em mais de uma acl ali não mostrar duas mensagens repetidas e coloquei o Nome e o ID do player antes da mensagem, o elementData do ID você modificar como eu citei no código. Dica * Você precisa melhorar a estrutura do seu código, pesquisa sobre indentação na internet que você conseguirá resultados.
  2. for i, markers in pairs(Entregas_Gases) do Markers_M = createMarker( markers[1], markers[2], markers[3]-1, "cylinder", 3, 255, 255, 255, 20) end for i, blipsMarkers in pairs(Entregas_Gases) do blipsM = createBlip(blipsMarkers[1], blipsMarkers[2], blipsMarkers[3], 41) end function teste1(source) msg.default("vc pisou no marker", source) end addEventHandler("onMarkerHit", Markers_M, teste1) Seguinte, quando eu coloco essas linhas de código n da erro nem nada, mas tbm n acontece nada, eu quero que quando a pessoa pise em cada marker da tabela, aconteça a função teste1, entende? mas sem que seja uma criação de markers fora da tabela, pq assim aumenta muitas linhas de código! Desde já, obrigado!
  3. function enableAccount ( accountJ ) if not isGuestAccount ( accountJ ) then if accountJ then local source = getAccountPlayer ( accountJ ) local XP = getAccountData ( accountJ, "XP" ) or 0 setElementData ( source, "XP", XP ) local Level = getAccountData ( accountJ, "Level" ) or 0 setElementData ( source, "Level", Level ) end end end function saveAccount ( accountJ ) if accountJ then local source = getAccountPlayer ( accountJ ) local XP = getElementData(source, "XP" ) or 0 setAccountData ( accountJ, "XP", XP ) local Level = getElementData(source, "Level" ) or 0 setAccountData ( accountJ, "Level", Level ) end end ---- function restartScript ( res ) if res == getThisResource ( ) then for i, player in ipairs ( getElementsByType ( "player" ) ) do local acc = getPlayerAccount ( player ) if not isGuestAccount ( acc ) then enableAccount ( acc ) end end end end addEventHandler ( "onResourceStart", getRootElement ( ), restartScript ) addEventHandler("onPlayerLogin", root, function( _, acc ) enableAccount ( acc ) end ) function stopScript (res) if res == getThisResource ( ) then for i, player in ipairs ( getElementsByType ( "player" ) ) do local acc = getPlayerAccount ( player ) if not isGuestAccount ( acc ) then saveAccount ( acc ) end end end end addEventHandler ( "onResourceStop", getRootElement ( ), stopScript ) function playerQuit ( quitType ) local acc = getPlayerAccount ( source ) if not isGuestAccount ( acc ) then if acc then saveAccount ( acc ) end end end addEventHandler ( "onPlayerQuit", getRootElement ( ), playerQuit ) function uparLevel(source) local exp = getElementData(source, "XP") local exps = tonumber(getElementData(source, "XP")) local lvls = tonumber(getElementData(source, "Level")) if lvls and exps then local needexp = 1000 if not exp then setElementData(source, "Level", 0) setElementData(source, "XP", 0) else if exps >= needexp then setElementData(source, "Level", lvls + 1) setElementData(source, "XP", 0) end end end end setTimer(uparLevel, 60, 1) Esse é meu código de level, mas está com três erros, esse level será exibido em uma hud, já estou ciente que não é possível usar source em um setTimer(), ja coloquei um for i, v in pair(getElementByType), mas quando eu coloco ele generaliza e seta o elementdata para todos os players.
  4. function Assaltar(source) weapon = getPedWeaponSlot(source) mira = getPlayerTarget ( source ) if isElementWithinMarker(source, mAssaltar) then if (weapon == 0) then return Assaltar end if not (getControlState(source, "aim_weapon")) then return Assaltar end if not getElementData(source, "LojaSendoAssaltada") then if ( mira ) then if ( mira ) == pedLojista then setElementData(source, "LojaSendoAssaltada", true) triggerClientEvent(source, "Som", source) triggerClientEvent(root, "notifiAssal", root) setPedAnimation(pedLojista, "shop", "SHP_Rob_HandsUp", 30000, true, true, true ) setElementFrozen(source, true) toggleAllControls(source, false) setPedAnimation(source, "shop", "shp_gun_aim", 30000, true, true, true ) setElementVisibleTo(assalto1PG, root, true) setTimer( function(source) setElementFrozen(source, false) toggleAllControls(source, true) givePlayerMoney(source, 4000) setPedAnimation(source, 0) outputChatBox("#727272Você terminou o assalto e ganhou #ffff00R$4000", source, 255, 255, 255, true) end, 30000, 1) setTimer( function(source) setElementData(source, "LojaSendoAssaltada", false) setElementVisibleTo(assalto1PG, root, false) end, 60000, 1) end end end end end setTimer ( Assaltar, 1, 0 ) Me ajudem a resolver estes erros [20:05:49] WARNING: AssaltoLoja\assaltoS.Lua:62: Bad argument @ 'getPedWeaponSlot' [Expected ped at argument 1, got nil] [20:05:49] WARNING: AssaltoLoja\assaltoS.Lua:63: Bad argument @ 'getPlayerTarget' [Expected ped at argument 1, got nil] [20:05:49] WARNING: AssaltoLoja\assaltoS.Lua:64: Bad argument @ 'isElementWithinMarker' [Expected element at argument 1, got nil]
  5. function collectLeite(thePlayer) if getElementType(thePlayer) == "player" then if getElementData(thePlayer,"MilkBuckets") <= 10 then setElementData(thePlayer,"MilkBuckets", (getElementData(thePlayer,"MilkBuckets")) + 1) outputChatBox("#727272You have collected #ffff00 " ..(getElementData(thePlayer,"MilkBuckets")).. "/10 Milk Buckets", thePlayer, 255, 255, 255, true) else outputChatBox("#727272You already have 10/10 Buckets of Milk", thePlayer, 255, 255, 255, true) end end end addCommandHandler( "collect", collectLeite ) Error script.lua:3 attempt to compare boolean with number
×
×
  • Create New...