Jump to content

steadyfi

Members
  • Posts

    144
  • Joined

  • Last visited

Posts posted by steadyfi

  1. Hi everybody, PewDiePie here,

    A couple days ago I fell into boredom, and started working on vAuth again.

    So here it is, fresh and updated:

    vAuth 1.2 RELEASED, now moved to GitHub!

    Changelog:

    - Recoded & Cleaned the whole resource.

    - Moved to GitHub.

    - Added MIT License to the code.

    - Appended "steadyfi" namespace to all events to avoid conflicts.

    - All account data keys, email templates, the webserver url, and recover tries can be easily changed from the meta.xml settings, and can even be changed during run-time without the need of a restart.

    Even tho the changelog isn't too... exciting, I took my time and recoded or cleaned the whole files, and made sure it can deliver better performance and stability. Hence it's only a very small script, nothing can go wrong, error-wise at least.

    If you discover any bugs or exploits, please report them immediately to the Issue section of the repository or here as a reply. DO NOT PM ME, as I'm blind as a bat in sunlight, and rarely even notice the notification counter.

    I will try to respond as fast as possible to every issue.

    If you have any suggestions, don't hesitate to write them down here.

    That's pretty much all of it.

    I might release a simple, minimalist and easy to setup, Login Panel later.

    Until then, please enjoy your lives... no rly, pls dont be liek me.

    The memes are over, thank you for the attention.

    Greetings, Steady.

  2. Hello. While I was coding, I realized one thing:

    It would be awesome if you could pass a table of events to a addEventHandler() function.

    Example:

    addEventHandler("event1", getRootElement(), function() 
        -- This will listen to only one event, passed in the first argument. 
    end); 
    addEventHandler({"event1", "event2"}, getRootElement(), function() 
        -- This will listen to multiple events, passed as a table in the first argument. 
    end); 
    

    There are times when you only want a anonymous function, but you gotta listen to multiple events, and you end up with really long names, usually which don't make sense, just to not interfere with the other functions.

    This shouldn't be hard to implement, as far as I know. Just overload the addEventHandler() ;D.

    I hope this makes sense. Have a great day! ;)

  3. Could you tell me what functions did you use on your webserver? A small snippet would mean a lot.

    Thanks for the information! ;)

    You can use the PHP SDK library to build your own system for communications. You can call functions on your MTA server remotely from the web server. Pretty good for a bit more advanced stuff, rather than just simple ASE stuff.

    Thanks!

    //Can close topic

  4. Interesting library, thanks! :)

    I personally built my own HTTP functions on my server which my web server then queries every few minutes, caching the details into a JSON file and then reading it out to the visitors on the site.

    Game-Tracker and Game-State send a UDP packet to the server with the old ASE protocol, having just a 's' character and then it returns all the server ASE information. You can do this with PHP, but not sure how much information you want. Sometimes it's even better to just make it custom if you want to share a lot of data.

    Could you tell me what functions did you use on your webserver? A small snippet would mean a lot.

    Thanks for the information! ;)

  5. Hello community.

    I wanna make a webpage which shows all the players which are online on the server.

    My question is, how do website's like Game-Tracker or Game-State query the player list?

    Is there any kind of special query protocol or something?

    I've seen this on the wiki,

    ase

    1

    This parameter can be used to make the server report to Game-Monitor master servers, allowing it to be visible in the ingame server browser. An additional UDP port needs to be available for this to work (value from + 123 , so on a default value 22003 the right port will be 22126 ).

    Available values: 0 - disabled , 1 - enabled. Optional parameter, defaults to 0.

    Will ASE help me in any way? If yes, how do I query this port?

    Thanks! :D

  6. hmm looks nice but if you realese something then you normaly give free

    if you want to sell it for 5 then you should put in [sALE]Open Teams or something like that

    Sorry, didn't really pay attention to the title at first, so I just put "Release". I may fix it if I can.

    It's kinda weird to name it OpenTeams when you're going to sell it.

    Well, I don't think the name of the resource really matters. I am working to make it more stable and even implement more functionalities to it in order to sell it.

  7. I saw a server called Top-GTA, a MTA DayZ server, that uses shaders stored in the format of .vtf.

    The .vtf format stands for Valve Texture Format (Outside Link), but the files they use are not common VTF Files, they are somehow modified and not conventional.

    As far as I tried, no Standard VTF Editor/Viewer can read from them, which lead me to the idea that they are somehow Invalid, for the .vtf format, but valid for MTA to load them.

    Also, MTA wouldn't be able to load conventional VTF Files, as they are newer technology, they are meant especially for the Valve Source Engine, and RenderWare (GTA SA Engine) wouldn't be able to handle them.

    I tried to load them, it kinda worked, but the Texture doesn't apply.

    The object remains white.

    local shader = dxCreateShader("world.fx"); 
    local texture = dxCreateTexture("test.vtf", "argb"); 
    dxSetShaderValue(shader, "gTexture", texture); 
    engineApplyShaderToWorldTexture(shader, "desgrassbrnsnd"); 
    

    If any of you know, I would like to hear what you say.

    Thanks :D

  8. Hello ! :)

    I've got a little problem here with dbQuery. I can't seem to understand how to pass the results correctly to the callbackFunction.

    Code:

    dbQuery(function(deaths, matches) 
        dbExec(db, "UPDATE main SET deaths=?, matches=? WHERE account=?", tonumber(deaths) + 1, tonumber(matches) + 1, getAccountName(getPlayerAccount(source))) 
    end, {deaths, matches}, db, "SELECT deaths,matches FROM main WHERE account=? LIMIT 1", getAccountName(getPlayerAccount(source))) 
    

    SQL Table:

    k4pfM83.png

    I have everything set. There you can also see ROW Properties.

    Error:

    [2015-04-10 14:40:50] ERROR: ***\main_s.lua:92: attempt to perform arithmetic on a nil value 
    

    Thanks ! ;)

  9. Good Nice :D

    Next Updates ??

    Good work ..

    What do you suggest ?

    example:

    A tab that you Spawn / Delete Tent with Items - So all in a Resource.

    and also add a tab Another Admin Can See The inventory players, helping to account players fiction abusing items bugs. This would help me Enough Even.

    Good one. Thank you buddy.

    Gonna release that tomorrow (i hope), right now I have to work on another project.

  10. 1. It is possible, but it would be kinda hard. You need to use DX functions to draw the snake and etc.

    2. No ! MTA has it's own Lua Environment, with it's own functions. The Programming Language used for scripts is Lua. You cannot use JSON to script here. What you have there is a game made for another platform that has it's own functions.

    Therefor, you should learn Lua. It is not that hard. But remember, do it as a HOBBY, not a OBLIGATION !

    You can ask us (the MTA Community) if you've got a problem, everyone is here to help.

    Here are some link what can introduce you to Lua and MTA Scripting:

  11. I don't think that setting account data on exit based on account data is the solution.

    Explanation: accountData is always saved AUTOMATICALLY. It's being saved in internal.db where it is safe and is stored by account

    Here is my version, I commented all of it.

    P.S: Put it in your code editor, the text is very disordered here in the Code Box.

    function getPlayerFromPartialName(who) --Useful Function | Author: TAPL 
        local who = who and who:gsub("#%x%x%x%x%x%x", ""):lower() or nil 
        if who then 
            for _, player in ipairs(getElementsByType("player")) do 
                local name_ = getPlayerName(player):gsub("#%x%x%x%x%x%x", ""):lower() 
                if name_:find(who, 1, true) then 
                    return player 
                end 
            end 
        end 
    end 
      
    function vip(thePlayer, cmd, target) 
          if isElement(thePlayer) then --Check if the player who triggered the function exists (not really useful, just to hesitate errors) 
                if (target ~= "") then --Check if the target string isn't empty 
                      local target = getPlayerFromPartialName(target) --Call the function "getPlayerFromPartialName" to get the target element from the name and store it as the var target 
                      if isElement(target) then --Check if the element "target" exists 
                            local account = getPlayerAccount(target) --Get the target account 
                            if (getAccountData(account, "vip") == false) then --If he is not a vip, then... (vip == false) 
                                  setAccountData(account, "vip", true) --Set his VIP status 
                                  outputChatBox("Added "..getPlayerName(target):gsub("#%x%x%x%x%x%x", "").." as VIP", thePlayer, 255, 255, 255) --Output to thePlayer's chat 
                            elseif (getAccountData(account, "vip") == true) then --If he is a vip, then... (vip == true) 
                                  setAccountData(account, "vip", false) --Set his VIP status 
                                  outputChatBox("Removed "..getPlayerName(target):gsub("#%x%x%x%x%x%x", "").." as VIP", thePlayer, 255, 255, 255) --Output to thePlayer's chat 
                            end 
      
                            --The code above makes it so you can use only one command for ADDING and REMOVING 
                      end 
                end 
          end 
    end 
    addCommandHandler("avip", vip) --Add the command 
    

    You shall chose the one you like ;)

  12. modshopls1 = createMarker(1041.5,-1021.5,31,"cylinder",3.5,250,0,0,100,getRootElement ()) 
    Blipmodshopls1 = createBlipAttachedTo(modshopls1, 27) 
    setBlipVisibleDistance (Blipmodshopls1, 300) 
      
    function Panel() 
    modshop = guiCreateWindow(1230, 285, 323, 433, "modshop", false) 
    guiWindowSetSizable(modshop, false) 
    Nitrox2 = guiCreateButton(20, 38, 134, 43, "Nitrox2", false, modshop) 
    Nitrox5 = guiCreateButton(20, 100, 134, 43, "Nitrox5", false, modshop) 
    Nitrox10 = guiCreateButton(20, 163, 134, 43, "Nitrox10", false, modshop) 
    Exit = guiCreateButton(66, 375, 193, 48, "Exit", false, modshop) 
      
    showCursor ( true ) 
    guiSetVisible(modshop, true) 
    addEventHandler ( "onClientGUIClick", Exit, Close, false ) 
    addEventHandler ( "onClientGUIClick", Nitrox2, Nitroxx2, false ) 
    addEventHandler ( "onClientGUIClick", Nitrox5, Nitroxx5, false ) 
    addEventHandler ( "onClientGUIClick", Nitrox10, Nitroxx10, false ) 
    end 
      
    addEventHandler ( "onClientMarkerHit", modshopls1, Panel ) 
      
    function Close() 
      
    guiSetVisible (modshop, false ) 
    showCursor ( false ) 
      
    end 
      
    function Nitroxx2() 
    triggerServerEvent ( "onNitroxxx2", getLocalPlayer() ) 
    end 
      
    function Nitroxx5() 
    triggerServerEvent ( "onNitroxxx5", getLocalPlayer() ) 
    end 
      
    function Nitroxx10() 
    triggerServerEvent ( "onNitroxxx10", getLocalPlayer() ) 
    end 
    

    He wanted to open it ONLY if he is in a vehicle

  13. Hey guys, I'm still newbie and I can't write this script correctly, what should I do to make Panel window open when (only) vehicles hit the marker (only that marker)? Waiting for a answer, thanks for reading.

    modshopls1 = createMarker(1041.5,-1021.5,31,"cylinder",3.5,250,0,0,100,getRootElement ())

    Blipmodshopls1 = createBlipAttachedTo(modshopls1, 27)

    setBlipVisibleDistance (Blipmodshopls1, 300)

    function Panel()

    modshop = guiCreateWindow(1230, 285, 323, 433, "modshop", false)

    guiWindowSetSizable(modshop, false)

    Nitrox2 = guiCreateButton(20, 38, 134, 43, "Nitrox2", false, modshop)

    Nitrox5 = guiCreateButton(20, 100, 134, 43, "Nitrox5", false, modshop)

    Nitrox10 = guiCreateButton(20, 163, 134, 43, "Nitrox10", false, modshop)

    Exit = guiCreateButton(66, 375, 193, 48, "Exit", false, modshop)

    showCursor ( true )

    addEventHandler ( "onClientGUIClick", Exit, Close, false )

    addEventHandler ( "onClientGUIClick", Nitrox2, Nitroxx2, false )

    addEventHandler ( "onClientGUIClick", Nitrox5, Nitroxx5, false )

    addEventHandler ( "onClientGUIClick", Nitrox10, Nitroxx10, false )

    end

    function MarkerHit( vehicle )

    end

    addEventHandler ( "onClientMarkerHit", modshopls1, Panel )

    function Close()

    guiSetVisible (modshop, not guiGetVisible ( modshop ) )

    showCursor ( false )

    end

    function Nitroxx2()

    triggerServerEvent ( "onNitroxxx2", getLocalPlayer() )

    end

    function Nitroxx5()

    triggerServerEvent ( "onNitroxxx5", getLocalPlayer() )

    end

    function Nitroxx10()

    triggerServerEvent ( "onNitroxxx10", getLocalPlayer() )

    end

    marker = createMarker(1041.5,-1021.5,31,"cylinder",3.5,250,0,0,100,getRootElement()) 
    blip = createBlipAttachedTo(marker, 27) 
    setBlipVisibleDistance(blip, 300) 
      
    function draw() 
        modshop = guiCreateWindow(1230, 285, 323, 433, "Modshop", false) 
        guiWindowSetSizable(modshop, false) 
        Nitrox2 = guiCreateButton(20, 38, 134, 43, "Nitrox2", false, modshop) 
        Nitrox5 = guiCreateButton(20, 100, 134, 43, "Nitrox5", false, modshop) 
        Nitrox10 = guiCreateButton(20, 163, 134, 43, "Nitrox10", false, modshop) 
        Exit = guiCreateButton(66, 375, 193, 48, "Exit", false, modshop) 
        showCursor(true) 
        addEventHandler("onClientGUIClick", Exit, Close, false) 
        addEventHandler("onClientGUIClick", Nitrox2, Nitroxx2, false) 
        addEventHandler("onClientGUIClick", Nitrox5, Nitroxx5, false) 
        addEventHandler("onClientGUIClick", Nitrox10, Nitroxx10, false) 
    end 
      
    addEventHandler("onClientMarkerHit", modshopls1, function() 
        if isPedInVehicle(getLocalPlayer()) == true then --Check if he is in a vehicle 
            draw() --We call the function to draw the GUI 
        end 
    end) 
      
    function Close() 
        guiSetVisible(window, false) --There is no need to use a NOT Gate, all you want is to close it (false) 
        showCursor(false) 
    end 
      
    function Nitroxx2() 
        triggerServerEvent("onNitroxxx2", getLocalPlayer()) 
    end 
      
    function Nitroxx5() 
        triggerServerEvent("onNitroxxx5", getLocalPlayer()) 
    end 
      
    function Nitroxx10() 
        triggerServerEvent("onNitroxxx10", getLocalPlayer()) 
    end 
    

  14. There is a problem:

    When I reload the Total Ammo goes down -30 but the clip is empty so Save and Load it and then I takes -30 again.

    I was not having this problem.

    Problem Representation:

    Example Bullets: 180

    Reload: -30 bullets

    Reload isn't instant, there aren't bullets in weapon

    The split get's triggered and then I load => -30 bullets

    This is a scheme of how my system works:

    Shoot Event Trigger > Get Ammo > Split > Save ElementData > Load ElementData > GiveBullets depending on ElementData

×
×
  • Create New...