Jump to content

AJXB

Members
  • Posts

    370
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by AJXB

  1. AJXB

    Playtime

    I couldn't find a way to fix the current script, can you try to fix it before I change the timers?
  2. AJXB

    Playtime

    What do you think I should do with the timers?
  3. AJXB

    Playtime

    local playTimeTimer = {} function loadPlayTime(_,account) local minutes = getAccountData(account, "playTime") if (tonumber(minutes)) then minutes = tonumber(minutes) local hours = math.floor(minutes / 60) if (hours > 0) then setElementData(source, "playTime", hours.." Hours") else setElementData(source, "playTime", minutes.." Minutes") end else setAccountData(account, "playTime", 0) setElementData(source, "playTime", "0 Minutes") end playTimeTimer[source] = setTimer(incrementPlayTime, 60000, 0, source) end addEventHandler("onPlayerLogin", root, loadPlayTime) function stopPlayTime() if (isTimer(playTimeTimer[source])) then killTimer(playTimeTimer[source]) end end addEventHandler("onPlayerLogout", root, stopPlayTime) addEventHandler("onPlayerQuit", root, stopPlayTime) function incrementPlayTime(player) if (not player or not isElement(player)) then return end if (isGuestAccount(getPlayerAccount(player))) then return end local account = getPlayerAccount(player) local minutes = getAccountData(account, "playTime") or 1 minutes = tonumber(minutes) minutes = minutes + 1 local hours = math.floor(minutes / 60) if (hours > 0) then setElementData(player, "playTime", hours.." Hours") else setElementData(player, "playTime", minutes.." Minutes") end setAccountData(account, "playTime", minutes) end This is the code, somehow when the player is playing time adds, but when he reconnects, his time sets to 0
  4. AJXB

    Playtime

    It won't save/load The time adds to ElementData But when I reconnect the time is gone.
  5. AJXB

    Playtime

    function loadPlayTime(account) local minutes = getAccountData(account, "playTime") if (tonumber(minutes)) then minutes = tonumber(minutes) local hours = math.floor(minutes / 60) if (hours > 0) then setElementData(source, "playTime", hours.." Hours") else setElementData(source, "playTime", minutes.." Minutes") end else setAccountData(account, "playTime", 0) setElementData(source, "playTime", "0 Minutes") end playTimeTimer[source] = setTimer(incrementPlayTime, 60000, 0, source) end addEventHandler("onPlayerLogin", root, loadPlayTime) Save side: function incrementPlayTime(player) if (not player or not isElement(player)) then return end if (isGuestAccount(getPlayerAccount(player))) then return end local account = getPlayerAccount(player) local minutes = getAccountData(account, "playTime") or 1 minutes = tonumber(minutes) minutes = minutes + 1 local hours = math.floor(minutes / 60) if (hours > 0) then setElementData(player, "playTime", hours.." Hours") else setElementData(player, "playTime", minutes.." Minutes") end setAccountData(account, "playTime", minutes) end What's wrong with this?
  6. AJXB

    Timer?

    Yeah it its, thanks!
  7. AJXB

    Timer?

    You're calling this function via what? 'Event - Command - Handler?' addEventHandler("onPlayerWasted",root,test)
  8. AJXB

    Timer?

    Main function and a sub function works on timer, what's the problem? function test () local curAcc = getPlayerAccount(source) setAccountData(curAcc,"Test",true) setTimer ( function () spawnPlayer(source,1186, -1323, 14 + 0.5,0,skin) setElementHealth (source,100) end,7500,1) end Bad argument for spawnPlayer and setElementHealth, expected element
  9. AJXB

    GUI Thing

    What won't be?
  10. AJXB

    GUI Thing

    Worked, thanks!
  11. AJXB

    GUI Thing

    It shows the cursor?
  12. AJXB

    GUI Thing

    I have this client side event: mainLoginWindow = guiCreateWindow(0,0,100,100,"Window",false) addEvent ( "setLoginWindowVisable", true ) function showLoginWindow () guiSetVisible (mainLoginWindow, true) enableCursor ( true ) end addEventHandler( "setLoginWindowVisable", root, showLoginWindow ) It's triggered using this on the server side: addEventHandler ("onPlayerJoin",root, function () triggerClientEvent( source, "setLoginWindowVisable", source ) end ) Yet GUI Window doesn't show, problem?
  13. AJXB

    Save Code

    Thanks, I missed that point
  14. AJXB

    Save Code

    Here is the code:
  15. Steps: 1. Install another server with another dir. 2. Change server port from mta-server.conf 3. you can simply use screen for starting multiple servers. I don't understand where is the problem?
  16. You can use "screen" command to manage windows. Install it using: #sudo apt-get install screen screen-profiles screen-profiles-extras to list the screens: #screen to choose: #screen -S [screen Number] Wish I'm being correct. Just to point out the ports thing [each server different ports].
  17. AJXB

    Map?

    Is there a command to show/hide the F11 Map Window?
  18. AJXB

    Debugscript Problem

    When I execute the command: /debugscript 3 the box on the bottom of the screen appears but with no text at all Solution?
  19. http://pastebin.mtasa.com/310244020 Omg that log is everything on my PC MTADiag is simply awsome!
  20. http://pastebin.mtasa.com/error[No code2 specified] I'm not sure that it gave me a working URL, it just copied this to my clipboard Still the same problem
  21. Thanks for your reply! I re installed MTA:SA Client, the problem stays It started just a while earlier.
×
×
  • Create New...