Jump to content

iTz.Kawl

Members
  • Posts

    3
  • Joined

  • Last visited

Everything posted by iTz.Kawl

  1. Olá, alguém pode me ajudar? Eu estou tentando fazer um script de mutar / desmutar players, porém o mesmo não funciona. Script: addEventHandler("onPlayerChat", getRootElement(), function(msg, msgType) if msgType == 0 then for k, v in ipairs (BadWords) do if string.find( string.lower ( msg ), v) then for i, m in ipairs( GoodWords ) do if string.find( string.lower ( msg ), m) then if string.find( string.lower ( msg ), v) == "puta" then return elseif string.find( string.lower ( msg ), v) == "cu" then return else cancelEvent(true) mtp(source) break end else cancelEvent(true) mtp(source) break end end end end end end) function mtp (source) if not isPlayerMuted(source) then local Nome = getPlayerName(source) setPlayerMuted(source, true) outputChatBox("#ff0000[INSULTO] #000000- #ffffff ".. Nome .." #fffffffoi mutado por falar palavrão! #000000[#ffff0060s#000000] #ff0000[CONSOLE]", getRootElement(), 255, 0, 0, true) setTimer( dmtp, 60000, 1 ) end end function dmtp (source) if isPlayerMuted(source) then local Nome = getPlayerName(source) setPlayerMuted(source, false) outputChatBox("#ff0000[INSULTO] - #ffffff ".. Nome .." #fffffffoi desmutado. #ff0000[CONSOLE]", getRootElement(), 255, 0, 0, true) end end Erro: WARNING: [all]\insulto\insulto.lua:94 Bad argument @ 'isPlayerMuted'' [Expected player at argument 1, got nil]
  2. Preciso de ajuda, estava fazendo um script de serviço porém ao colocar ele para fazer essa função: function sair (source) if (veh[source]) and isElement(veh[source]) then outputChatBox ('#000000[ #FFB700Aviador#000000 ] #868686Você saiu do veículo e perdeu o trabalho!',source,255,255,255,true) destroyElement (veh[source]) Trabalho = false setElementVisibleTo ( entregar, source, false ) setElementVisibleTo ( blip, source, false ) setElementData(source, "Trab", false) end end addEventHandler ("onVehicleExit", getRootElement(), sair) addEventHandler ("onVehicleExplode", getRootElement(), sair) O último EventHandler não funciona, poderiam me ajudar a resolver? Não tem erro no console. Script: marker = createMarker ( -79.430679321289, 90.90128326416, 2.6, "cylinder", 1.5, 255,140,0, 255) entregar = createMarker ( -570.20233154297, 2567.4458007813, 53.910755157471 , "cylinder", 3, 255,140,0, 255) setElementVisibleTo ( entregar, root, false ) blip = createBlipAttachedTo(entregar, 41, 3, 255, 0, 0, 255, 0, 65535, source) setElementVisibleTo ( blip, root, false ) bliptrab = createBlipAttachedTo(marker, 5, 3, 255, 0, 0, 255, 0, 65535) function msg (source) outputChatBox ('#000000[ #FFB700Aviador#000000 ] #868686Para iniciar o trabalho digite: #000000-[ #FFB700/aviador #000000]',source,255,255,255,true) end addEventHandler( "onMarkerHit", marker, msg ) veh = {} function pegartrab (source) if isElementWithinMarker (source, marker) then if veh[source] and isElement(veh[source]) then destroyElement(veh[source]) veh[source] = nil end local x,y,z = getElementPosition(source) veh[source] = createVehicle(593 ,-82.958648681641,104.13409423828,3.4968612194061,0,9,160) warpPedIntoVehicle (source,veh[source]) setElementVisibleTo ( blip, source, true ) setElementVisibleTo ( entregar, source, true ) outputChatBox ('#000000[ #FFB700Aviador#000000 ] #868686Vá para a marcação indicada no mapa!',source,255,255,255,true) else outputChatBox ('#000000[ #FFB700Aviador#000000 ] #FF0000Erro! #868686Você não esta no circulo para pegar o trabalho.',source,255,255,255,true) end end addCommandHandler ( "aviador", pegartrab ) function acabar (source) if veh[source] and isElement(veh[source]) then destroyElement (veh[source]) setElementVisibleTo ( entregar, source, false ) setElementVisibleTo ( blip, source, false ) givePlayerMoney (source, 20000) outputChatBox ('#000000[ #FFB700Aviador#000000 ] #868686Trabalho finalizado com #00ff00Sucesso #FF0000Você ganhou 20k +50exp',source,255,255,255,true) local experience = tonumber(getElementData(source,"experience")) if (experience) then setElementData(source,"experience",experience+50) else setElementData(source,"experience",50) end else end end addEventHandler( "onMarkerHit", entregar, acabar ) function sair (source) if (veh[source]) and isElement(veh[source]) then outputChatBox ('#000000[ #FFB700Aviador#000000 ] #868686Você saiu do veículo e perdeu o trabalho!',source,255,255,255,true) destroyElement (veh[source]) Trabalho = false setElementVisibleTo ( entregar, source, false ) setElementVisibleTo ( blip, source, false ) setElementData(source, "Trab", false) end end addEventHandler ("onVehicleExit", getRootElement(), sair) addEventHandler ("onVehicleExplode", getRootElement(), sair) function deslogar (source) if (veh[source]) and isElement(veh[source]) then destroyElement (veh[source]) Trabalho = false setElementVisibleTo ( entregar, source, false ) setElementVisibleTo ( blip, source, false ) setElementData(source, "Trab", false) end end addEventHandler ("onPlayerQuit", getRootElement(), deslogar)
×
×
  • Create New...