Jump to content

crdn

Members
  • Posts

    5
  • Joined

  • Last visited

Recent Profile Visitors

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

crdn's Achievements

Vic

Vic (3/54)

3

Reputation

  1. Colocando um iprint na função startAnim você iria perceber que a função não estava recebendo os valores corretos e necessários para a execução da mesma: function startAnim ( id1, id2) iprint(id1, id2) setPedAnimation(source, id1, id2 ,-1, true, false, false, true) end addEvent( "startAnim", true ) addEventHandler ("startAnim", root, startAnim) (mostraria false no /debugscript 3) Isso se deve ao fato de você estar usando o método getItemDetails incorretamente, a sintaxe dele é a seguinte: string, mixed Gridlist:GetItemDetails ( int columnIndex, int itemIndex ) Você precisa chama-lo duas vezes, uma para a coluna 2 e outra para a coluna 3: addEventHandler("onClientDoubleClick", root, function() if (gridAnim:IsVisible()) then local selectedItem = gridAnim:GetSelectedItem(); if (selectedItem ~= -1) then triggerServerEvent("startAnim", localPlayer, gridAnim:GetItemDetails(2, selectedItem), gridAnim:GetItemDetails(3, selectedItem)); end end end );
  2. O método GetSelectedItem retorna o índice selecionado: Para obter o texto do índice selecionado você deve usar o metodo GetItemDetails: string, mixed Gridlist:GetItemDetails ( int columnIndex, int itemIndex ) -- retornara o texto do indice itemIndex na coluna columnIndex ou, como você sempre vai ter a tabela com os ids, simplesmente usar seguinte codigo: skinID = tonumber(idskins[Selected]) Dessa forma o código final ficaria da seguinte maneira: function SelecionarSkinF1 (button, press) if press and button == "mouse1" then local Selected = gridlist:GetSelectedItem (TextId) if Selected ~= -1 then local skin = tonumber(idskins[Selected]); triggerServerEvent ("Skinf1", getLocalPlayer(), skin) end end end addEventHandler ( "onClientKey", root, SelecionarSkinF1) Comente caso tenha qualquer duvida.
  3. AdminbaseAllowedNames={["Lorenzo"]=true} GoInAdminbaseMarker=createMarker(-2039.7,216.6,34.8,"cylinder",2,255,125,0,140) function TeleportInAdminbase_Func(element) if (getElementType(element) == "player" or getElementType(element) == "vehicle") then local player = getElementType(element) == "player" and element or getVehicleController(element); if (player and AdminbaseAllowedNames[getPlayerName(player)]) then if isElementWithinMarker(player,GoInAdminbaseMarker)then if getPedOccupiedVehicle(player)==true then setElementFrozen(player,true) setTimer(setElementFrozen,200,1,player,false) setElementPosition(player,-2023.3,295.7,895) else setElementPosition(player,-2023.3,295.7,894.6) end end else outputChatBox("You dont have permissions!",player,255,0,0) end end end addEventHandler("onMarkerHit",GoInAdminbaseMarker,TeleportInAdminbase_Func)
  4. NumeroInicial = 1 function changeSelectedIndex (btn) Textoselecioado[NumeroInicial] = tocolor(255,255,255,255); if (btn == "arrow_u") then NumeroInicial = math.max(1, NumeroInicial - 1); elseif (btn == "arrow_d") then NumeroInicial = math.min(11, NumeroInicial + 1); end Textoselecioado[NumeroInicial] = tocolor(0,255,255,255); end bindKey("arrow_u", "down", changeSelectedIndex) bindKey("arrow_d", "down", changeSelectedIndex)
×
×
  • Create New...