Jump to content

Castillo

Retired Staff
  • Posts

    21,935
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Castillo

  1. That's because you are creating the file every time, you should have put the fileCreate function outside the loop. function printAllData ( thePlayer ) local playerAccount = getPlayerAccount ( thePlayer ) if ( playerAccount ) then local data = getAllAccountData ( playerAccount ) local count = 0 if ( data ) then local accountLog = fileCreate ( "accounts/".. getAccountName ( playerAccount ) ..".log" ) for k, v in pairs ( data ) do count = ( count + 1 ) outputChatBox ( "\n".. k .." :".. v ) fileWrite ( accountLog, "\n".. k ..": ".. v ) end outputChatBox ( "table holds ".. count .." entries" ) fileClose ( accountLog ) end end end addCommandHandler ( "loopx", printAllData )
  2. function lol ( ) local thefile = fileCreate ( "lol.txt" ) for index, player in ipairs ( getElementsByType ( "player" ) ) do local theirdata = getElementData ( player, "data" ) fileWrite ( thefile, "\n\n".. getPlayerName ( player ) .." - ".. theirdata ) end fileClose ( thefile ) end addCommandHandler ( "loop", lol ) That?
  3. I don't get what do you want to do.
  4. Castillo

    Image button

    With guieditor is easy, you can just right click on the progress bar and create the image.
  5. Castillo

    Image button

    Set the parent of the image to the progress bar.
  6. No, pero podes hacerlo comparando la posicion con una guardada previamente.
  7. Castillo

    Help

    Oh, I forgot, I'm doing many things at once. Added it.
  8. Castillo

    Help

    local gate1 = createObject ( 980, -2085.8994140625, -213, 37.099998474121, 0, 0, 0 ) local status = false addCommandHandler ( "move", function ( ) if ( status ) then status = false moveObject ( gate1, 4000, -2085.8999023438, -213, 29.10000038147 ) else status = true moveObject ( gate1, 4000, -2085.8999023438, -213, 37.099998474121 ) end end ) Try that.
  9. Castillo

    Image button

    The event: onClientGUIClick is used for ANY GUI element, not just buttons.
  10. Castillo

    Weapons

    I don't understand what do you mean, the script I posted should reset all saved weapons when get killed, no need to edit it.
  11. col = createColTube ( -871.99, 1638.93, 28.7, 10, 3 ) -- enter your cooderates here for your colshape please note 10 and 3 is to do with the size of the shape. door = createObject ( 980, -871.990234375, 1638.9345703125, 28.7, 0, 0, 212.5 ) -- enter the ID of the object followed by the coordinates -- note the rotx y and z may not be required so you just remove these. x y and z is where you would put your cordinates. function Open ( pla ) if ( getElementType ( pla ) == "player" ) then if ( not isPedOnVehicle ( pla ) ) then if exports.factions:isPlayerInFaction ( pla, 1 ) then --here you can alter the group from Admin to whatever you require in your server but remember the rest must be the same i.e change everything where it says Admin to your desired group and add the users to that group. moveObject ( door, 2200, -875.990234375, 1638.9345703125, 28.7 ) -- here is where you enter the coordinatess of the new location of the object, 2200 = the speed of the movent. end end end end addEventHandler ( "onColShapeHit", col, Open ) function Close ( pla ) if ( getElementType ( pla ) == "player" ) then if ( not isPedOnVehicle ( pla ) ) then if exports.factions:isPlayerInFaction ( pla, 1 ) then moveObject ( door, 2951, -871.990234375, 1638.9345703125, 28.7 ) -- here is where you copy the coordinates of the orginal location of the object, 2951 = the timer of movent. end end end end addEventHandler ( "onColShapeLeave", col, Close ) 1: There was no need to use addEvent. 2: "if vehicle or not vehicle then" that check was useless, see my code I added: if ( not isPedOnVehicle ( pla ) ) then 3: No need to return '0'.
  12. Castillo

    Image button

    guiCreateStaticImage guiCreateLabel
  13. Castillo

    Weapons

    Add this to your save system: addEventHandler ( "onPlayerWasted", root, function ( ) local account = getPlayerAccount ( source ) if ( account and not isGuestAccount ( account ) ) then setAccountData ( account, "zmgm.weaponID0", 0 ) setAccountData ( account, "zmgm.weaponID1", 0 ) setAccountData ( account, "zmgm.weaponID2", 0 ) setAccountData ( account, "zmgm.weaponID3", 0 ) setAccountData ( account, "zmgm.weaponID4", 0 ) setAccountData ( account, "zmgm.weaponID5", 0 ) setAccountData ( account, "zmgm.weaponID6", 0 ) setAccountData ( account, "zmgm.weaponID7", 0 ) setAccountData ( account, "zmgm.weaponID8", 0 ) setAccountData ( account, "zmgm.weaponID9", 0 ) setAccountData ( account, "zmgm.weaponID10", 0 ) setAccountData ( account, "zmgm.weaponID11", 0 ) setAccountData ( account, "zmgm.weaponID12", 0 ) end end )
  14. Castillo

    [HELP]How to

    I don't get what do you mean, you can make a table with skins and then loop that table and insert them on the grid list.
  15. Castillo

    [HELP]How to

    Functions: createMarker triggerServerEvent getPlayerMoney takePlayerMoney setElementModel Events: onMarkerHit onClientGUIClick
  16. Castillo

    Weapons

    You want to reset weapons after killed?
  17. "UTF-8 without BOM" can be compiled, "UTF-8" can't.
  18. Castillo

    [HELP]How to

    What do you mean by "skins"? You can add items to grid lists with: guiGridListAddRow guiGridListSetItemText
  19. Castillo

    Weapons

    That script will save weapons on quit and load them on login.
  20. Castillo

    Weapons

    That script has no onPlayerWasted event, how could it be saved after death?
  21. You should learn the basics before start editing scripts, else you'll mess it up.
  22. Castillo

    Weapons

    You must edit the script, post it here.
  23. Castillo

    Contar Tiempo

    Usa: getTickCount
  24. No offense, but that's just random code.
×
×
  • Create New...