Jump to content

JR10

Retired Staff
  • Posts

    2,947
  • Joined

  • Last visited

Everything posted by JR10

  1. There is easier/safer ways of doing this, use setAccountData to save. And make a timer that will increase the player minutes/seconds. If seconds == 60 then increase the minutes if minutes == 60 then increase the hours. That's better.
  2. Better to do this: showCursor(guiGetVisible ( myWiindw ) )
  3. There is no solution for that, the bugs are being fixed, you just have to wait.
  4. JR10

    Help in Logo!

    setTimer ( function ( ) removeEventHandler("onClientRender",rootElement, renderDisplay) end , 10000 , 1 )
  5. For setting a window in the middle of the screen: local win = guiCreateWindow( x / 2 - 50 / 2 , y / 2 - 75 / 2, 50, 75, ... )
  6. JR10

    help

    1. I don't know what are you talking about 2. https://wiki.multitheftauto.com/wiki/Main_Page
  7. And it's named fr_server.lua, lol. Is it server side, or client side. Put the resource, in admin group, in ACL.
  8. -------------------------------------------------------- -- Salvar informações no LOGIN/EXIT ------------------ function onPlayerQuit ( ) local conta = getPlayerAccount ( source ) if ( conta ) then armas = {} for i = 0,12 do local arma = getPedweapon(source,i) local ammu = getPedTotalAmmo(source,i) if ammu > 0 then table.insert(armas, {arma,ammu}) end end local x,y,z = getElementPosition(source) local rx,ry,rz = getElementRotation(source) local salvarConta = { [1] = getPlayerMoney ( source ); [2] = getElementModel(source); [3] = x; [4] = y; [5] = z; [6] = rx; [7] = getElementDimension(source); [8] = getElementInterior(source) } setAccountData(conta,"char.armas",armas) for i,v in ipairs(salvarConta) do setAccountData(conta,"char."..tostring(i),tostring(v)) end end end function onPlayerJoin ( ) local conta = getPlayerAccount ( source ) local din = getAccountData(conta,"char.1") setPlayerMoney(source,din) end addEventHandler ( "onPlayerQuit", getRootElement ( ), onPlayerQuit ) addEventHandler ( "onPlayerLogin", getRootElement ( ), onPlayerJoin ) -------------------------------------------------------- --------------------------------------------------------
  9. JR10

    SQL Question.

    Not sure, but it's better using the SQL table the way I did, because this way, it's a guarantee you will get the data right. playerTable[1]["x"]
  10. JR10

    SQL Question.

    Done. local Spieler = getRootElement() addEventHandler( "onResourceStart", Spieler, function() executeSQLCreateTable( "playerData", "name STRING, x FLOAT, y FLOAT, z FLOAT, r FLOAT, s INT" ) end ) addEventHandler( "onPlayerQuit", Spieler, function() local Account = getAccountName( getPlayerAccount( source ) ) local x, y, z = getElementPosition( source ) local rx, ry, rz = getElementRotation( source ) local s = getElementModel( source ) local playerTable = executeSQLSelect ( "playerData", "*", "name = '" .. Account .. "'" ) if playerTable and #playerTable == 1 then local playerTable = executeSQLUpdate( "playerData", "name = '" .. Account .. "', x = '" .. x .. "', y = '" .. y .. "', z = '" .. z .. "', r = '" .. rz .. "', s = '" .. s .. "'" ) else local playerTable = executeSQLInsert( "playerData", "'"..Account .. "','" .. x .. "','" .. y .. "','" .. z .. "','" .. rz .. "','" .. s .. "'" ) end end ) addEventHandler( "onPlayerLogin", Spieler, function() local Account = getAccountName( getPlayerAccount( source ) ) local playerTable = executeSQLSelect ( "playerData", "*", "name = '" .. Account .. "'") if playerTable and #playerTable == 1 then spawnPlayer( source, playerTable[1]["x"], playerTable[1]["y"], playerTable[1]["z"], playerTable[1]["r"], playerTable[1]["s"] ) setCameraTarget( source, source ) fadeCamera( source, true, 1.0 ) else spawnPlayer( source, 1000, 1000, 50, 90, 285 ) setCameraTarget( source, source ) fadeCamera( source, true, 1.0 ) end end ) Tested. spawnPlayer( source, playerTable[1]["x"], playerTable[1]["y"], playerTable[1]["z"], playerTable[1]["r"], playerTable[1]["s"] ) That's what I changed, same as my last post.
  11. JR10

    SQL Question.

    Where? I didn't forget anything. Try: spawnPlayer( source, playerTable[1]["x"], playerTable[1]["y"], playerTable[1]["z"], playerTable[1]["r"], playerTable[1]["s"] )
  12. JR10

    PlaySound3D

    setSoundMinDistance setSoundMaxDistance
  13. JR10

    SQL Question.

    addEventHandler( "onPlayerLogin", Spieler, function() local Account = getAccountName( getPlayerAccount( source ) ) local playerTable = executeSQLSelect ( "playerData", "*", "name = '" .. Account .. "'") if playerTable and #playerTable == 1 then spawnPlayer( source, playerTable[1][2], playerTable[1][3], playerTable[1][4], playerTable[1][5], playerTable[1][6] ) setCameraTarget( source, source ) fadeCamera( source, true, 1.0 ) else spawnPlayer( source, 1000, 1000, 50, 90, 285 ) setCameraTarget( source, source ) fadeCamera( source, true, 1.0 ) end end )
  14. I know, I compiled it normally, then did the same above. And it worked.
  15. Don't double post, use the edit button. addEvent( "onZombieWasted" ) addEventHandler( "onZombieWasted", root, function ( killer ) local playerTeam = getPlayerTeam ( killer ) if ( playerTeam == Army) then local account = getPlayerAccount ( killer ) setAccountData (account,"zombieKills",getAccountData ( account , "zombiekills" ) + 2 ) givePlayerMoney( killer, math.random( 80, 110 ) ) elseif ( playerTeam == Scientific) then setAccountData (account,"zombieKills",getAccountData ( account , "zombiekills" )-1) outputChatBox ( "You Don't Kill Zombies! -1 EXP", killer, 0, 0, 255 ) else outputChatBox ( "Error", killer, 0, 0, 255 ) end end )
  16. I have NP++ I had the same errors/warnings. To fix that I did: Encoding >> Encode in UTF-8
  17. JR10

    screenshot

    You can't do that with scripting.
  18. Haha. That made my day. Nice video, good job. Off: Happy b-day Arran.
  19. JR10

    SQL Question.

    Yes, but, insert syntax is wrong, should be values only, without the column. local playerTable = executeSQLInsert( "playerData", "'"..Account .. "','" .. x .. "','" .. y .. "','" .. z .. "','" .. rz .. "','" .. s .. "'" )
×
×
  • Create New...