Jump to content

Citryon25

Members
  • Posts

    20
  • Joined

  • Last visited

Details

  • Gang
    Gang

Recent Profile Visitors

867 profile views

Citryon25's Achievements

Civilian

Civilian (7/54)

0

Reputation

  1. É ai que fica minha dúvida, de que maneira posso programar o bot para funcionar desse modo? Quais possíveis funções poderiam ser utilizadas para que o mod faça o veiculo andar em uma rota programada?
  2. Mas é possível fazer com que um bot dirija um veiculo usando o slothbot?
  3. Estou tentando criar um recurso de assalto ao carro forte, que funcionara da seguinte forma: Em determinado horário do jogo, o carro forte vai seguir uma rota, e o jogador deve matar os peds dentro do carro forte, em seguida explodir a parte onde ficam guardadas as sacolas de dinheiro, as quais vão ser possível roubar. A minha única dúvida até o momento sera na forma que posso fazer o veiculo(carro forte) seguir uma rota automaticamente, sendo controlado por um ped. Alguém sabe uma solução? Agradeço desde já.
  4. Valeu pela ajuda de todos! Consegui resolver meu problema.
  5. Grato pela sua rápida resposta e desculpe pela resposta demorada da minha parte. Consegui resolver meu problema, porém me surge outra dúvida: já vi outras pessoas duplicarem painéis sem sequer trocar eventos, apenas copiando, colando e mudando o nome do recurso. Seria possível eu fazer isso?
  6. Bom pessoal, fiz recentemente um painel de recrutamento, no qual o jogador pode criar um recrutamento em determinado local, dimensão, e teletransporte. O sistema funcionou corretamente, porém, preciso duplicar esse recurso para que duas gangs possam usa-lo, e quando dupliquei os dois mods eles bugaram, como se eu estivesse usando dois painéis, por exemplo: quando crio um recrutamento através do painel do resource painelrecrutar_w ele cria o recrutamento nesse recurso e no outro(painelrecrutar), como criando dois teletransportes. Já tive esse mesmo problema ao duplicar painéis, quando uso um parece que estou usando dois(o duplicado e original). Alguém sabe como resolver esse problema? Grato.
  7. Cara eu to com essa mesma ideia de criar um servidor RPG, parabéns pelo ótimo projeto.
  8. Thanks for your response. I need it to get the message from a memo (Visible in the function 'criarOcorrencia') and send it to a gridlist and not to a specific player only. So in case I would use the getElementsByType function getting all players from the server and a trigger to create the row?
  9. But then I would just use a trigger on the serverside? Could you give me an example of how it would work in the code, please?
  10. I am creating a system where the player can send a message that will be displayed in a gridlist in a panel, but the messages that have been sent are not displayed, only when it's me that I send. SCRIPT: [CLIENT-SIDE] GUIEditor = { label = {} } janela_oc = guiCreateWindow((screenW - 315) / 2, (screenH - 352) / 2, 315, 352, "Chamar Policia", false) guiWindowSetSizable(janela_oc, false) guiSetProperty(janela_oc, "CaptionColour", "FF0718F8") edit_oc = guiCreateEdit(101, 38, 149, 27, "", false, janela_oc) GUIEditor.label[3] = guiCreateLabel(29, 42, 76, 29, "Ocorrência:", false, janela_oc) guiSetFont(GUIEditor.label[3], "default-bold-small") GUIEditor.label[4] = guiCreateLabel(29, 87, 144, 15, "Conte o que aconteceu:", false, janela_oc) guiSetFont(GUIEditor.label[4], "default-bold-small") memo_oc = guiCreateMemo(29, 111, 252, 191, "", false, janela_oc) enviar_oc = guiCreateButton(35, 312, 105, 25, "Enviar", false, janela_oc) guiSetProperty(enviar_oc, "NormalTextColour", "FF43D00B") fechar_ocs = guiCreateButton(157, 312, 105, 25, "Fechar", false, janela_oc) guiSetProperty(fechar_ocs, "NormalTextColour", "FFEF0000") guiSetVisible(janela_oc, false) janela_ocs = guiCreateWindow((screenW - 411) / 2, (screenH - 439) / 2, 411, 439, "Ocorrências", false) guiWindowSetSizable(janela_ocs, false) guiSetProperty(janela_ocs, "CaptionColour", "FF2C1EE0") grid_ocs = guiCreateGridList(23, 32, 367, 284, false, janela_ocs) guiGridListAddColumn(grid_ocs, "Jogador", 0.5) guiGridListAddColumn(grid_ocs, "Ocorrência", 0.5) guiGridListAddColumn(grid_ocs, "Descrição", 0.5) ver_oc = guiCreateButton(51, 343, 114, 35, "Ver Ocorrência", false, janela_ocs) guiSetProperty(ver_oc, "NormalTextColour", "FF3BEB12") del_oc = guiCreateButton(234, 343, 132, 35, "Remover Ocorrência", false, janela_ocs) guiSetProperty(del_oc, "NormalTextColour", "FFDC0000") limpar_oc = guiCreateButton(142, 388, 124, 37, "Limpar Ocorrências", false, janela_ocs) guiSetProperty(limpar_oc, "NormalTextColour", "FFD75406") guiSetVisible(janela_ocs, false) veroc = guiCreateWindow((screenW - 377) / 2, (screenH - 362) / 2, 377, 362, "Ver Ocorrência", false) guiWindowSetSizable(veroc, false) guiSetProperty(veroc, "CaptionColour", "FF0A2FD0") ocd = guiCreateEdit(99, 74, 176, 33, "", false, veroc) guiEditSetReadOnly(ocd, true) GUIEditor.label[1] = guiCreateLabel(22, 84, 67, 18, "Ocorrência:", false, veroc) guiSetFont(GUIEditor.label[1], "default-bold-small") memo = guiCreateMemo(93, 133, 240, 148, "", false, veroc) guiMemoSetReadOnly(memo, true) GUIEditor.label[2] = guiCreateLabel(22, 139, 67, 18, "Descrição:", false, veroc) guiSetFont(GUIEditor.label[2], "default-bold-small") voltar_btn = guiCreateButton(131, 305, 124, 37, "Voltar", false, veroc) guiSetProperty(voltar_btn, "NormalTextColour", "FFD86B01") joglabel = guiCreateLabel(28, 32, 184, 32, "Jogador:", false, veroc) guiSetFont(joglabel, "default-bold-small") guiSetVisible(veroc, false) addCommandHandler("190", function() guiSetVisible(janela_oc, true) showCursor(true) end ) function fecharOc() guiSetVisible(janela_oc, false) showCursor(false) end addEventHandler("onClientGUIClick", fechar_ocs, fecharOc) function criarOcorrencia() -- SEND REPORT FOR 'janela_ocs' if getElementData (getLocalPlayer(), "chamou", true) then outputChatBox ('#c1c1c1Aguarde #ff00005 #c1c1c1minutos para chamar policia novamente.',255,255,255,true) return end if guiGetVisible(janela_oc) == true then if guiGetText(edit_oc) and guiGetText(memo_oc) then local playerName = getPlayerName(getLocalPlayerlayer()) local oc = guiGetText(edit_oc) local desc = guiGetText(memo_oc) local row_oc = guiGridListAddRow(grid_ocs, playerName:gsub('#%x%x%x%x%x%x', ''), oc, desc) guiSetVisible(janela_oc, false) showCursor(false) convertTextToSpeech("Você enviou uma ocorrência", "pt") setElementData(getLocalPlayer(), "chamou", true) setTimer (setElementData, 300000, 1, getLocalPlayer(), "chamou", false) end end end addEventHandler("onClientGUIClick", enviar_oc, criarOcorrencia) function verOcorrencia() if guiGetVisible(janela_ocs) == true then local playerName = guiGridListGetItemText ( grid_ocs, guiGridListGetSelectedItem (grid_ocs), 1 ) local oc = guiGridListGetItemText ( grid_ocs, guiGridListGetSelectedItem (grid_ocs), 2 ) local desc = guiGridListGetItemText ( grid_ocs, guiGridListGetSelectedItem (grid_ocs), 3 ) guiSetVisible(janela_ocs, false) guiSetVisible(veroc, true) guiSetText(joglabel, "Jogador: ".. playerName) guiSetText(ocd, oc) guiSetText(memo, desc) end end addEventHandler("onClientGUIClick", ver_oc, verOcorrencia)
  11. First of all, sorry for bad English. I am creating a script and I used the getElementData function to get data stored in the user account and then the setElementData function to get the information through the getElementData on the client but the script has the following error in debugging: Bad argument @ setElementData [Expect element at argument 1, got nil] SCRIPT: [SERVER-SIDE] function setarDados_Entrar(source) local acc = getPlayerAccount(source) local habl = getAccountData(acc, "hablt") local ficha = getAccountData(acc, "fichacriminal") setElementData(source, "hblt", habl)--In that error line setElementData(source, "fich", ficha) -- In that error line end function setarDados_Iniciar() local acc = getPlayerAccount(player) local habl = getAccountData(acc, "hablt") local ficha = getAccountData(acc, "fichacriminal") setElementData(player, "hblt", habl)--In that error line setElementData(player, "fich", ficha)--In that error line end function setarDados_Mudar(player) local acc = getPlayerAccount(player) local habl = getAccountData(acc, "hablt") local ficha = getAccountData(acc, "fichacriminal") setElementData(player, "hblt", habl)--In that error line setElementData(player, "fich", ficha)--In that error line end addEventHandler("onPlayerLogin", getRootElement(), setarDados_Entrar) addEventHandler("onResourceStart", root, setarDados_Iniciar) addEventHandler("onAccountDataChange", root, setarDados_Mudar)
  12. function displayVehicleLoss(loss) local thePlayer = getVehicleOccupant(source) if(thePlayer) then -- Check there is a player in the vehicle outputChatBox("Seu veículo acabou de ter " .. tonumber(loss) .. " De Danos.", thePlayer) -- Display the message local playerhealth = getElementHealth(thePlayer) setElementHealth(theplayer, playerhealth - 10) outputChatBox("Você perdeu 10% de sua vida por bater o seu veiculo.", thePlayer) elseif getElementData(thePlayer, "seguro") then return end end end addEventHandler("onVehicleDamage", getRootElement(), displayVehicleLoss) function cinto(thePlayer) if isPedInVehicle(thePlayer) then local veiculo = getPedOccupiedVehicle(thePlayer) if (getVehicleType(veiculo) == "Automobile") then setElementData ( thePlayer, "seguro", true ) else return outputChatBox("Você não pode colocar o cinto de segurança fora do carro, ou em veiculos que não seja um carro.") end end addCommandHandler("colocarcinto") Você pode completar esse código usando a função cinto como base na função para tirar cinto, o evento onVehicleExit para tirar o cinto do jogador no momento em que ele sair do veículo. Fiz esse código bem na pressa mesmo usando as funções que o Shinigami falou, então nem testei. Quando for executar veja se dá algum erro no debug e me diga.
  13. Agora deu erro ao digitar o comando /meucash: Attempt to concatenate global 'playercash' (a boolean value) function checkMyCash (player) local account = getPlayerAccount( player ) if ( account ) and not isGuestAccount ( account ) then -- Global playercash: playercash = getAccountData(account, "system.cash") if not(playercash) then outputChatBox("Você não possui cash em sua conta.", player, 100, 255, 100) -- LINHA DO ERRO: outputChatBox("Você tem ".. playercash .." cash restante(s) em sua conta.", player, 100, 255, 100) end end end addCommandHandler( "meucash", checkMyCash )
×
×
  • Create New...