Jump to content

Castillo

Retired Staff
  • Posts

    21,935
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Castillo

  1. Looks like it's a position problem, since I've centered it using a function and the tab panel shown up. local sx, sy = guiGetScreenSize ( ) function centerGUI ( guiElement ) local width, height = guiGetSize ( guiElement, false ) local x, y = ( sx / 2 - width / 2 ), ( sy / 2 - height / 2 ) guiSetPosition ( guiElement, x, y, false ) end tab = guiCreateTabPanel(429, 151, 430, 404, true) guiSetVisible ( tab, false ) centerGUI ( tab ) tab_inventory = guiCreateTab("Weapon:", tab) inventory_gridlist = guiCreateGridList (0.03, 0.03, 0.46, 0.94, true, tab_inventory) weapSlots = guiGridListAddColumn(inventory_gridlist, "slots", 0.9) function weapItemInInventory ( ) if ( weapSlots ) then for slot = 1, 12 do local weapon = getPedWeapon ( localPlayer, slot ) if ( weapon > 0 ) then local row = guiGridListAddRow ( inventory_gridlist ) guiGridListSetItemText ( inventory_gridlist, row, weapSlots, getWeaponNameFromID ( weapon ), false, false ) end end end end addEventHandler ( "onClientResourceStart", getResourceRootElement(), weapItemInInventory ) setTimer ( function ( ) guiGridListClear ( inventory_gridlist ) weapItemInInventory ( ) end, 5000, 0 ) function enableInv ( ) local state = ( not guiGetVisible ( tab ) ) guiSetVisible(tab, state) showCursor ( state ) end bindKey ( "B", "down", enableInv )
  2. You should create the marker server side, because if you do it client side, it won't be easy to do what you want.
  3. And what is the problem exactly?
  4. Ami me sale eso cada tanto cuando intento entrar en mi servidor local, pero luego me deja entrar.
  5. You're using google translator to script? That's still wrong, since you're calling them "funcao" instead of "function".
  6. You have one big mistake there, you put part of the code outside the function, also ,is "local" lowercase.
  7. All you have to do is remove 'local' from infront of it.
  8. That's because you have set the variable as local, that means it won't exist outside the 'if' statement.
  9. Can you post or send me via PM the full script?
  10. To get a random skin use: local skin = skins [ math.random ( #skins ) ]
  11. You have a table with the skins or you want to give a random from all the valid skins?
  12. Castillo

    Need SQL help

    You can execute INSERT queries to add rows with values, and also UPDATE queries to update rows.
  13. Make sure your table was called "doorPositions" and not "DoorPositions".
  14. Anything you want is supported, these aren't pre-defined formats, the person that scripted it just had the idea of doing that.
  15. I think that it's pretty clear what he wants.
  16. No offense, but you're making no sense. The functions TAPL posted can obtain the player element from an account, if the player is not online, it'll simply return false.
  17. Eso es porque no pusiste el argumento getPropagated en false en la funcion addEventHandler. Aca: addEventHandler ( "onClientGUIClick", Infernus1, Infernus ) Ponele a todos un 'false' al final, asi: addEventHandler ( "onClientGUIClick", Infernus1, Infernus, false )
  18. Es porque usaste la letra "ñ", no se puede usar.
  19. function IsNearDoor ( player ) local x, y, z = getElementPosition ( localPlayer ) local nearestDoor local distance for index = 1, #doorPositions do local door = doorPositions [ index ] local doorX, doorY, doorZ = unpack ( door ) if ( distance ) and ( getDistanceBetweenPoints2D ( x, y, z, doorX, doorY, doorZ ) < distance ) then distance = getDistanceBetweenPoints2D ( x, y, z, doorX, doorY, doorZ ) nearestDoor = index elseif ( getDistanceBetweenPoints2D ( x, y, z, doorX, doorY, doorZ ) < 5 ) then distance = getDistanceBetweenPoints2D ( x, y, z, doorX, doorY, doorZ ) nearestDoor = index end end if ( nearestDoor ) then outputChatBox ( "There is a door near you!" ) setCameraMatrix ( "The coords of that door", unpack ( doorPositions [ nearestDoor ] ) ) end end Try it.
  20. Proba agregando mensajes antes y despues de los 'if', asi es mas facil encontrar el error.
  21. He's not trying to use the getPlayerMoney native function, that's obvious.
  22. No aparece la gridlist o cual es el problema?
×
×
  • Create New...