Jump to content

Turbe$Z

Members
  • Posts

    439
  • Joined

  • Last visited

  • Days Won

    4

Posts posted by Turbe$Z

  1. hey, i made a custom chat script, and i want to output every message to that, and i found this event, but does not work... 

    i tried it this way:

    function onChatMessageHandler(theMessage, thePlayer)
    	--outputChatBox(theMessage)
    	triggerClientEvent(root,"chat->NewMessage",root,false,theMessage)
    end
    addEventHandler("onChatMessage", root, onChatMessageHandler)

    what wrong, or how to use? there is no errors or warnings, simply just does not trigger the client event

  2. I have this line: 

    		dbExec(connection,"UPDATE interiors SET megujitva = ? WHERE id = ?",getTimestamp(),idd)

    And the funny thing is, in the same script and same function, this is works good, i get the correct date data. But when i try in another function in the same script, i get 0000-00-00 00:00:00. Why? What the difference, cause i copied exactly the same code part (which is working) to the another function, and i got only zeros!? I dont understand... how to fix this?

  3. I want to get a data from all accounts on the server, but i get this warning:

    'getAccount' [Expected string at argument 1, got account]
    'getAccountData' [Expected account at argument 1, got boolean]

    this is my code:

    for i, v in pairs(getAccounts()) do 
    	names = getAccountData(getAccount(v), "acc:nickname")
    end 
    	outputChatBox(names)

    What wrong?

    • Like 1
  4. i send datas from server side to client side then insert these datas to a table, and i want to render it, but the render does not work, cause the loop is does not working, and i dont know why, what wrong with the loop?

    this is my code:

    local playerVehicles = {}
    local sx, sy = guiGetScreenSize()
    				
    function vehicles()
    	for k, veh in pairs(playerVehicles) do
    		dxDrawText(veh[k][1].." | "..veh[k][2], sx/2-370,sy/2-297,sx/2,sy/2, tocolor(255, 255, 255, 220), 3, "default-bold", "left", "top", false, false, false, true )
    	end		
    end
    
    addEventHandler("onClientRender",root,vehicles)
    
    function teszt(p,id,model)
    	table.insert(playerVehicles,{id,model})
    end
    
    addEvent("test",true)
    addEventHandler("test",root,teszt)

     

  5. Hello, i want to make a vertical progress bar which comes from bottom to top, but whatever i do it show like this: 

    okKFLNY.png it comes from top to bottom...

    but i want something like this: 

    I0Wynwt.png

    this is the code of the rectangle:

    					dxDrawRectangle(moveX-20, moveY+5, 30, math.ceil(itemWeight)/getTypeOfElement(elementSource)[3]*290,tocolor(172, 211, 115,200))

    Anyone can help me? I tried so many ways but none of them worked... :S 

  6. 5 hours ago, Haxardous said:

    that's really common since GTA:SA is really a CPU demanding game (because GTA:SA is an old game and made to work perfectly on older computers) also, at most cases it depends on the server script optimization since it really plays the major role on the performance side, you can notice that every server has it's own unique FPS rating. these CPU usage jumps are caused on what you're doing and how the server managed to make their script, they're pretty much expected and common so no worries.

    I just start the client, i'm not joining to any server when the CPU usage go up to 20-30%

  7. When i start MTA client, the CPU usage go up to 30-35% usage from 5-10%, and then 5-10 mins later decrease back the usage to 5-10%. It's annoying me, because the CPU temp go up to 50C°-60C° too from 30C°-45C°... What's this?

    My config (if important):

    Intel Core i5-9600K
    2x8GB RAM
    GTX 1080

  8. When a player create car with the freeroam panel, the cursor does not disappear, i removed all showCursor from the script, and the players show the cursor with another script, when press M, but the cursor does not disappear too.. then how can i fix this bug?

  9. 		if key == 'backspace' and ePress then
    			chat.input = string.sub(chat.input, 0, string.len(chat.input) - 1)
    		end

    The backspace working with default characters (a,b,c,d...), but when i type a special character, for example: á, é, ű, ő, ü...etc., the backspace not working, what wrong? o.O

  10. This is the code:

        local now = getTickCount() 
        local x,y = interpolateBetween(one, one1, 0, two, two1, 0, (now - start) / ((start + 2500) - start), "Linear") 
        local now2 = getTickCount() 
        local x2,y2 = interpolateBetween(asd, asd1, 0, fgh, fgh1, 0, (now2 - start2) / ((start2 +2500) - start2), "Linear") 
        if right == false then
        dxDrawRectangle(x, (sy_/2-20) * ym, 3* xm, 40 * ym,tocolor(255,255,255,255))
        else
        dxDrawRectangle(x2, (sy_/2-20) * ym, 3* xm, 40 * ym,tocolor(255,255,255,255))
        end
        --
        if x >= 1063 and x <= 1073 and right == false then
            test = true
        elseif x >= 1089 and x <= 1099 and right == false then
            test = true
    
        elseif x >= 1158 and x <= 1172 and right == false then
            test = true
    
        elseif x >= 1212 and x <= 1232 and right == false then
            test = true
    
        elseif x >= 1276 and x <= 1293 and right == false then
            test = true
    
        elseif x >= 1423 and x <= 1433 and right == false then
            test = true
    
        elseif x >= 1476 and x <= 1487 and right == false then
            test = true
        else 
            test = false
        end

    i want change the test to true when the rectangle is in the granted position, but how can i get the momentary position of the dx rectangle?

×
×
  • Create New...