Jump to content

Derpy

Members
  • Posts

    96
  • Joined

  • Last visited

Posts posted by Derpy

  1. erm i tried doing this thing multiple times, but i always came to an issue, and wasnt really able to make it work

    local sw,sh = guiGetScreenSize() 
    local width,height = 350/1920*sw,500/1080*sh 
    local x,y = sw/2-width/2,sh/2-height/2 
    local scaleX,scaleY = 1/1920*sw,1/1080*sh 
    local font = "default-bold" 
    local maxIndex = 24 
    local currentIndex = 0 
      
    local tab = { 
    [1] = "Text", 
    [2] = "Lmao", 
    [3] = "Rambo", 
    [4] = "Hello World", 
    } 
      
    function drawRectangle() 
       dxDrawRectangle(x,y,width,height,tocolor(0,0,0,180)) 
       for i = currentIndex,maxIndex+currentIndex do 
          if tab[i] then 
             if i >= currentIndex then 
                dxDrawText(tab[i],x,y+i*20,sw,sh,tocolor(255,255,255),scaleX,scaleY,font) 
             end 
          end 
       end 
    end 
    setTimer(function() addEventHandler("onClientRender",root,drawRectangle) end,50,1) 
      
    function increaseIndex() 
    currentIndex = currentIndex + 1 
    outputChatBox("Wheel up: Current Index: "..currentIndex) 
    end 
    bindKey("mouse_wheel_up","down",increaseIndex) 
      
    function decreseIndex() 
    currentIndex = currentIndex - 1 
    outputChatBox("Wheel down: Current Index: "..currentIndex) 
    end 
    bindKey("mouse_wheel_down","down",decreseIndex) 
      
    function addIndex(cmd,tmessage) 
    tab[#tab+1] = tmessage 
    end 
    addCommandHandler("message",addIndex) 
      
    function addMultipleRows(cmd,times,text) 
       for i = 1,tonumber(times) do 
          tab[#tab+1] = text 
       end 
    end 
    addCommandHandler("loop",addMultipleRows) 
    

    if you could help me, i would be really happy, and i checked your resource and at scrolling part it has math.min and math.max functions, but i don't really understand why do you need them

  2. Hi! I am interested in making my scoreboard, but there's a problem.

    I am worried what to do when there would be too many players, they wouldn't all fit on scoreboard.

    But there's scrolling, right?

    But how do i make scrolling in dx?

    If someone could provide me with an example, that would be great!

    something like scrolling on this video:

  3. oh sorry i said it wrongly, its not server using 1,2gb of ram but mta uses that much of ram, but its still high..

    server - LUA VM Totals: around 11300kb

    client - around 9300 kb

  4. hi i have a problem

    in my local server when im alone, just with a not modded car my server uses 1,2gb of ram

    is that normal or do i need to find what is causing that?

    my custom downloader uses around 200mb but theres something else as well

    is this normal or not?

    if i have to go to performancebrowser to which section do i go?

    thanks in advance

  5. Hi!

    I want to get position left,right,front and behind of player(5 units distance) but i am not sure how to do it.

    considering the x,y,z element position i can't just randomly get coordinates like x+5 or y-5 etc

    x depends whether player is moving east/west

    y depends whether player is moving north/south

    z depends on height

    so how can i correctly get left,right,front and behind the player?

  6. i dont think its possible, its built in gta so that when u die inside a car that u fall out the door, unless u explode in car

    though u could try random crazy experiments like freezing the player, or setting position or something, or maybe cancel event of death and "create your own" death system(like fake the death, but still consider it death)?

  7. Okay thank you very much!

    Though since im still pretty new to sql, is there a way to prevent having 100 things on e.g same name?

    i have added additional data in sql; name

    so i would want that if nick isnt in sql database that it writes all data as usual(even if serial is already in sql database) ,otherwise it writes nothing in it

    can you please show me an example how to do this?

  8. hi umm i was trying to practice sql and i got an error which makes no sense to me as table exists

    local PLAYER_DATABASE = dbConnect("sqlite","database/trexarex.db") 
      
    setTimer(function() 
    if PLAYER_DATABASE then 
       sendResult("successfully loaded player database! (trexarex.db)",root) 
       onDatabaseStart() 
    else 
       errorMessage("failed to load player database! (trexarex.db)",root) 
    end 
    end,50,1) 
      
      
    function onDatabaseStart() 
    dbExec(PLAYER_DATABASE, "CREATE TABLE IF NOT EXISTS data_system ( serial TEXT, ip TEXT, account TEXT, country TEXT)") 
    outputDebugString("onDatabaseStart; data_system SQL Table created!") 
    validatePlayerData() 
    end 
      
    function validatePlayerData() 
       for i,v in pairs(getElementsByType("player")) do 
          local result = executeSQLQuery("SELECT * FROM data_system WHERE serial=?",getPlayerSerial(v)) 
          if #result == 0 then 
             dbExec( "INSERT INTO data_system ( serial, ip, account, country ) VALUES ( ?, ?, ?, ? )", 
                getPlayerSerial(v),getPlayerIP(v),getAccountName(getPlayerAccount(v)),getElementData(v,"country") or "Unknown") 
                sendResult("successfully executed data into data_system",root) 
          else 
             --nothing? 
             errorMessage("already found the data :O",root) 
          end 
       end 
    end 
    

    custom and built in debug methods show that table was created, and it says dbExec: no such table data_system at line 23

    please help

  9. hey umm you know the mta watermark? one with version text? e.g MTA 1.4.1 right at bottom of the screen?

    well i am not trying to hide it or anything similiar, but i have noticed that /TfF\ server has hidden it somehow

    aaand i can't see how is it possible

    is there some secret command to hide the watermark or?

  10. thanks, i will try to learn SQL and accomplish this.

    still there are a lot of IDs(from model(vehicle) IDs to upgrade IDs)

    how could i store the data without worrying of it being conflicted?

    like if i had elegy tuned all differently on 4 slots, how could i save the data to elegy, but to each elegy different data to avoid conflicts?

  11. hello, i would like to save following thing permanently(nothing is permanent but something long-keeping like setAccountData)

    lets say i got 4 slots and upgrades(multiple of them)

    and on these 4 slots 4 vehicles can be saved.

    so how could i save specific vehicle's upgrades permanently to the vehicle which is saved to person?

    if you didn't understand then here's usage of it if it'd be done of course:

    you got 4 different cars saved on 4 different slots, and all cars have their own different upgrades.

    you want to spawn car and make it have it's custom upgrades which you saved to it.

    but there are alot of numbers in here, from upgrade id's to vehicle IDs and i am not sure anymore how could i save all of this without all data being conflicted.

    i hope that you understand me, otherwise ask me to explain better

    please help me, and thanks in advance.

×
×
  • Create New...