Jump to content

SidneiJR

Members
  • Posts

    31
  • Joined

  • Last visited

Everything posted by SidneiJR

  1. @DNL291 Muito obrigado funcionou perfeitamente, confesso que não esperava algo tão complexo
  2. Tentei utilizar, porém não achei uma forma correta de inserir no código.
  3. Não expliquei totalmente para que seria a troca das funções. Com o getPedOccupiedVehicle ele verifica o player que está dentro ou tentando entrar no veículo, em alguns servidores que possuem esse tipo de teleporte o player costuma se aproveitar dessa função e acaba "movendo" veículos. Como seria esse "movendo"? Simples. Eles apertam f ou g e utilizam uma bind do teleporte rapidamente. Minha intenção é verificar se o player está dentro do veículo e não tentando entrar nele.
  4. Tentei diversas formas de aplicar nesse código, mas todas foram sem sucesso.
  5. local posicoes = { { 2457.5451660156, -1658.8039550781, 13.3046875 }, } function PosicaoPlayer ( thePlayer, command ) if (getElementDimension(thePlayer) ~= 0) then return end local azar = math.random ( #posicoes ) local veh = getPedOccupiedVehicle(thePlayer) if veh then setElementPosition(veh, unpack ( posicoes [ azar ] ) ) outputChatBox ( "#ffffff「 #00ccffTELE #ffffff」 #FFFFFF".. getPlayerName(thePlayer) .." #FFFFFFFoi para o CJ com seu veículo #ffffff( #00ccff/cjcar #ffffff)", root, 0, 255, 0, true ) end end addCommandHandler ( "cjcar", PosicaoPlayer ) Com o getPedOccupiedVehicle ele verifica o player que está dentro ou tentando entrar no veiculo. Existe outra função que possa verificar apenas quem está dentro do veículo?
  6. Estou tentando utilizar a gridlist para mostrar Players de um determinado grupo ACL Tentei seguir o padrão dessa função abaixo: grid = guiCreateGridList(x*310, y*300, x*200, y*140, false) column = guiGridListAddColumn(grid, "Policiais Online", 1) guiSetVisible(grid, false) clientsideResourceStart = function() if column then for id,playeritem in ipairs(getElementsByType("player")) do if isPlayerInTeam(playeritem, "PM") then local row = guiGridListAddRow(grid) guiGridListSetItemText(grid, row, column, getPlayerName(playeritem), false, false) end end end end addEventHandler ( "onClientResourceStart", resourceRoot, clientsideResourceStart ) function isPlayerInTeam(src, TeamName) if src and isElement ( src ) and getElementType ( src ) == "player" then local team = getPlayerTeam(src) if team then if getTeamName(team) == TeamName then return true else return false end end end end Substituindo "isPlayerInTeam" por "isPlayerInACL" ficando da seguinte forma: grid = guiCreateGridList(x*310, y*300, x*200, y*140, false) column = guiGridListAddColumn(grid, "Policiais Online", 1) guiSetVisible(grid, false) clientsideResourceStart = function() if column then for id,playeritem in ipairs(getElementsByType("player")) do if isPlayerInACL(playeritem, "Police") then local row = guiGridListAddRow(grid) guiGridListSetItemText(grid, row, column, getPlayerName(playeritem), false, false) end end end end addEventHandler ( "onClientResourceStart", resourceRoot, clientsideResourceStart ) function isPlayerInACL(player, acl) local accountName = getAccountName( getPlayerAccount(player) ) if accountName ~= "guest" and type( aclGetGroup(acl) ) == "userdata" then return isObjectInACLGroup( "user."..accountName, aclGetGroup(acl) ) end return false end Porém como é na parte Client ela não consegue ler "getPlayerAccount", como posso utilizar essa função corretamente?
×
×
  • Create New...