Jump to content

joao2235

Members
  • Posts

    140
  • Joined

  • Last visited

Everything posted by joao2235

  1. Substituí, porém sem sucesso... function updateGridList() local rw, cl = guiGridListGetSelectedItem(defaultGrid) guiGridListClear(defaultGrid) for slot=0, 12 do if (getPedWeapon (localPlayer, slot) ~= 0) then -- Se o jogador tem uma arma nesse slot, então: guiGridListAddRow (defaultGrid, getWeaponNameFromID (getPedWeapon (localPlayer, slot)), getPedTotalAmmo (localPlayer, slot)) end guiGridListSetSelectedItem(defaultGrid, rw, cl) end end Print: https://imgur.com/a/Yj89Dko
  2. Tentei algo assim: (Sem sucesso) function updateGridList() local rw, cl = guiGridListGetSelectedItem(defaultGrid) guiGridListClear(defaultGrid) for slot=0, 12 do if ( getPedWeapon(localPlayer, slot) ) then guiGridListAddRow(defaultGrid) end guiGridListSetSelectedItem(defaultGrid, rw, cl) end end
  3. Primeiramente muito obrigado pelo apoio. Tenham certeza de que vocês são decisivos e responsáveis pelo crescimento gigantesco desse game incrível. Dessa forma no script do Jonas^ todos os Markers abrem o painel. Mas corrigi da seguinte forma: CLIENT: local sX, sY = guiGetScreenSize () addEventHandler ("onClientResourceStart", resourceRoot, function () defaultWindow = guiCreateWindow (sX/2 - 185, sY/2 - 220, 370, 440, "Guardar Armas", false) guiWindowSetSizable (defaultWindow, false) guiSetVisible (defaultWindow, false) btnGuardar = guiCreateButton (10, 396, 112, 34, "Guardar", false, defaultWindow) btnFechar = guiCreateButton (247, 396, 112, 34, "Fechar", false, defaultWindow) defaultGrid = guiCreateGridList (9, 26, 350, 360, false, defaultWindow) guiGridListAddColumn (defaultGrid, "Arma", 0.7) guiGridListAddColumn (defaultGrid, "Munição", 0.20) end) addEventHandler ("onClientGUIClick", root, function (btn) if btn ~= "left" then return end if source == btnGuardar then outputChatBox ("Btn: "..btn, 0, 255, 0) elseif source == btnFechar then Abrir () end end) --[[addEventHandler ("onClientMarkerHit", getRootElement(), function (hitPlayer, matchingDimension) if hitPlayer and getElementType (hitPlayer) == "player" and matchingDimension then Abrir () end end)]]-- function Abrir () if guiGetVisible (defaultWindow) == true then guiSetVisible (defaultWindow, false) showCursor (false) -- guiGridListClear (defaultGrid) elseif guiGetVisible (defaultWindow) == false then guiSetVisible (defaultWindow,true) showCursor (true) -- guiGridListClear (defaultGrid) end end addEvent("painelguiopen", true) addEventHandler("painelguiopen", root , Abrir) SERVER: MarkerGuardar = createMarker (359.159, 207.26, 1007.383, "cylinder", 1.5, 255,255,255,50) setElementInterior(MarkerGuardar, 3) setElementDimension(MarkerGuardar, 1) function AbrirPainelGuardar (source) triggerClientEvent (source, "painelguiopen", root) end addEventHandler("onMarkerHit", MarkerGuardar, AbrirPainelGuardar) Estou iniciando como scripter, mas estou cada dia mais buscando me desenvolver. Agradeço novamente o apoio de vocês! Como faria para conseguir colocar nessa gridlist as armas e o número de munições que o player carrega junto à cada arma ?
  4. SERVER: MarkerGuardar = createMarker (359.159, 207.26, 1007.383, "cylinder", 1.5, 255,255,255,50) setElementInterior(MarkerGuardar, 3) setElementDimension(MarkerGuardar, 1) function AbrirPainelGUI(player) triggerClientEvent(player,"showHide", root) end addEventHandler("onMarkerHit", MarkerGuardar, AbrirPainelGUI) CLIENT: GUIEditor = { gridlist = {}, window = {}, button = {} } addEventHandler("onClientResourceStart", resourceRoot, function() GUIEditor.window[1] = guiCreateWindow(773, 341, 369, 442, "Guardar Armas", false) guiWindowSetSizable(GUIEditor.window[1], false) guiSetVisible(GUIEditor.window[1], false) centerGUI(GUIEditor.window[1]) GUIEditor.button[1] = guiCreateButton(785, 740, 134, 33, "Guardar", false, GUIEditor.window[1]) GUIEditor.button[2] = guiCreateButton(998, 740, 134, 33, "Fechar", false, GUIEditor.window[1]) GUIEditor.gridlist[1] = guiCreateGridList(781, 370, 351, 362, false, GUIEditor.window[1]) guiGridListAddColumn(GUIEditor.gridlist[1], "Armas", 0.5) guiGridListAddColumn(GUIEditor.gridlist[1], "Munição", 0.5) end ) function Abrir() if guiGetVisible(GUIEditor.window[1]) == true then guiSetVisible(GUIEditor.window[1],false) showCursor(false) guiGridListClear(GUIEditor.gridlist[1]) elseif guiGetVisible(GUIEditor.window[1]) == false then guiSetVisible(GUIEditor.window[1],true) showCursor(true) guiGridListClear(GUIEditor.gridlist[1]) triggerServerEvent("getDataFromServer",getLocalPlayer(),getLocalPlayer()) end end addEvent("showHide", true) addEventHandler("showHide", root , Abrir)
  5. I need to create a Ped (NPC) who shoots forward and continues firing, non-stop. Does anyone have any idea how I create this?
  6. Já tentei de várias formas, mas não consegui. Preciso criar um PED (NPC) que fica atirando reto, sem parar com uma M4. Apenas isso! Alguém tem ideia de como faço ? Grato se conseguirem me ajudar.
  7. Sim, sei que está por ACL. O que quero dizer é que quero remover o Player ter acesso por ACL e fazê-lo ter acesso por Permissão em uma função que no caso é essa aqui abaixo: if ( getElementType ( player ) == "player" ) then if hasObjectPermissionTo(player, "function.Prender") then Substituir a ACL por uma função. Entende ? Se puder me ajudar agradeço demais!
  8. function Verificar_Emprego_Atual ( ) for i, player in ipairs(getElementsByType("player")) do local acc = getPlayerAccount(player) if acc and not isGuestAccount(acc) then local job = getElementData(player,'ocupacao') local accName = getAccountName (acc) if isObjectInACLGroup ("user."..accName, aclGetGroup ( ComandosPolicia ) ) then setElementData ( player, "ocupacao", "Policial" ) setElementData ( player, "AirNewSCR_Entrada_PortaoDP", "Sim" ) setElementData ( player, "AirNew_Perm_Prender", "Sim" ) else setElementData ( player, "ocupacao", "Criminoso" ) setElementData ( player, "AirNewSCR_Entrada_PortaoDP", "Não" ) setElementData ( player, "AirNew_Perm_Prender", "Não" ) end end end end setTimer ( Verificar_Emprego_Atual, 1500, 0 ) Quero restringir para essa função abaixo, ao invés da ACL (como está no script acima). if ( getElementType ( player ) == "player" ) then if hasObjectPermissionTo(player, "function.Prender") then Porém quando insiro isso nesse primeiro código ele emite erros. Se alguém puder me ajudar ficaria grato demais!
  9. Como faria isso exatamente ? Você poderia me ajudar ? Estou iniciando na programação e ainda não tenho muito conhecimento. Desde já te agradeço!
  10. Dei uma olhada, mas parece que eles não conseguiram restringir...
  11. local armas = {22,23,24,25,26,27,28,29,30,31,32,33,34,38} local skills = {"pro","std","poor"} function setNoRecoil(tipo) for _,id in ipairs(armas) do for _,skill in ipairs(skills) do if (tipo == "ativar") then setWeaponProperty ( id, skill, "accuracy", 10000 ) elseif (tipo == "desativar") then local original = getOriginalWeaponProperty ( id, skill, "accuracy" ) setWeaponProperty ( id, skill, "accuracy", original ) end end end end addEventHandler( "onResourceStart", resourceRoot, function() setNoRecoil("ativar") end ) addEventHandler( "onResourceStop", resourceRoot, function() setNoRecoil("desativar") end ) É um script de precisão de tiros, gostaria de restringir apenas para uma ACL. Alguém pode me ajudar, por favor ?
  12. Working! I did another thing. Thanks!
  13. Sorry, I am a beginner. Can u make a better explain ?
  14. local ifp = engineLoadIFP( "anim.ifp", "newAnimBlock" ) addEvent( "anim", true ) addEventHandler( "anim", root, function(enable) if (enable) then setPedAnimation(source, "newAnimBlock", "continencia", -1, true, false) else setPedAnimation(source) end end ) addEventHandler("onClientResourceStart", resourceRoot, function() triggerServerEvent("onClientSync", resourceRoot) end ) addEventHandler("onClientResourceStop", resourceRoot, function() if ifp then for _,player in ipairs(getElementsByType("player")) do local _, anim = getPedAnimation(player) if (anim == "continencia") then setPedAnimation(player) end end destroyElement(ifp) end end ) I did it. But not work.
  15. local animEnable = {} local syncPlayers = {} addCommandHandler("continencia", function(player) if ( getElementType ( player ) == "anim" ) then if ( not isObjectInACLGroup ( "user." .. getAccountName ( getPlayerAccount ( player ) ), aclGetGroup ( "VIP" ) ) ) then if (not animEnable[player]) then animEnable[player] = true triggerClientEvent(syncPlayers, "anim", player, true) outputChatBox("*Continência #00FF00ativada", player, 255, 255, 255, true) else animEnable[player] = false triggerClientEvent(syncPlayers, "anim", player, false) outputChatBox("*Continência #FF0000desativada", player, 255, 255, 255, true) end end ) addEvent("onClientSync", true ) addEventHandler("onClientSync", resourceRoot, function() table.insert(syncPlayers, client) for player, enable in ipairs(animEnable) do if (enable) then triggerClientEvent(client, "anim", player, true) end end end ) addEventHandler("onPlayerQuit", root, function() for i, player in ipairs(syncPlayers) do if source == player then table.remove(syncPlayers, i) break end end if (animEnable[source] == true or animEnable[source] == false) then animEnable[source] = nil end end ) I need to restrict this at "VIP" ACL. But it does not work. Someone can help me, pls. Thanks. Submit error: Client (Username Player) triggered serverside event onClientSync, but event is not added serverside.
×
×
  • Create New...