Jump to content

Search the Community

Showing results for tags 'client'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Multi Theft Auto: San Andreas 1.x
    • Support for MTA:SA 1.x
    • User Guides
    • Open Source Contributors
    • Suggestions
    • Ban appeals
  • General MTA
    • News
    • Media
    • Site/Forum/Discord/Mantis/Wiki related
    • MTA Chat
    • Other languages
  • MTA Community
    • Scripting
    • Maps
    • Resources
    • Other Creations & GTA modding
    • Competitive gameplay
    • Servers
  • Other
    • General
    • Multi Theft Auto 0.5r2
    • Third party GTA mods
  • Archive
    • Archived Items
    • Trash

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Member Title


Gang


Location


Occupation


Interests

  1. I've been working with binding keys quite a lot, but this is currently destroying my brain. Lots of other people have been walking against this problem and I'm trying to find a solution, it can't be that hard! My setup is as following: User gets a UI -> fills in a key to bind a chat to -> using triggerServerEvent to bind the key for the user + some sql saving After a successful attempt of saving the new button for the user, I'm trying to unbind the key from the chatbox-styled function isn't unbinding. If I'm simply unbinding it with runcode directly in runtime, it's returning a true but it's not unbinding. I've seen several reports about this on the bugtracker but none of them were taken note off. Is there a work around or should I simply ask my users to use a MTA-based command to unbind their keys? thanks in advance.
  2. Hi! I have a faction panel, and I want to do that I have a list of faction vehicles with label, and when I click one of these, give me informations of the clicked vehicle. With the members(players) I can do it, because there is a getPlayerFromName. But with vehicles how can I do this?
  3. I can't find an error in this script, what's wrong here? The message says that the event is not added serverside... coreh_client.lua local tableToSendVip = { [1] = guiGetText( hc_edith['edith_ec_X'] ), [4] = guiGetText( hc_edith['edith_etc_X'] ), [2] = guiGetText( hc_edith['edith_ec_Y'] ), [5] = guiGetText( hc_edith['edith_etc_Y'] ), [3] = guiGetText( hc_edith['edith_ec_Z'] ), [6] = guiGetText( hc_edith['edith_etc_Z'] ), [7] = guiGetText( hc_edith['edith_exc_X'] ), [10] = guiGetText( hc_edith['edith_extc_X'] ), [8] = guiGetText( hc_edith['edith_exc_Y'] ), [11] = guiGetText( hc_edith['edith_extc_Y'] ), [9] = guiGetText( hc_edith['edith_exc_Z'] ), [12] = guiGetText( hc_edith['edith_extc_Z'] ), [13] = guiGetText( hc_guih['edith_intID'] ), [14] = guiGetText( hc_guih['edith_dim'] ), [15] = guiGetText( hc_guih['edith_cost'] ) }; for i, v in ipairs( tableToSendVip ) do tableToSendVip[ i ] = tonumber( tableToSendVip[ i ] ); end; triggerServerEvent( 'onPlayerAttemptCreateHouseVip', me, tableToSendVip ); triggerEvent( 'HPV_SetVisible', me, false ); end, false ); coreh_server.lua addEvent( 'onPlayerAttemptcreateHouseVip', true ); addEventHandler( 'onPlayerAttemptcreateHouseVip', root, function( rt ) createHouseVip( true, #sqly.Query( "SELECT * FROM house_data" ) + 1, '', '', unpack( rt ) ); outputChatBox( 'A casa VIP foi criada com sucesso!', client, 255, 255, 0 ); end ); Any ideas?
  4. Buenas, estoy creando un sistema de nametags cliente y estoy usando tablas, para que así cuando se loguee/desloguee, se muestre o no el texto en cuestión (el nametag). Todo va correcto, el problema que tengo es a la hora de usar table.insert, que sigue renderizando el nombre local nametags = { } local font = dxCreateFont( "fuente.ttf" ) addEvent( "nmtgs:onPlayerLogin", true ) addEvent( "nmtgs:onPlayerQuit", true ) addEventHandler( "onClientRender", root, function( ) if #nametags > 0 then for i=1, #nametags do local player = nametags[i] local px, py, pz = getElementPosition( player ) local x, y, z = getElementPosition( getLocalPlayer( ) ) local name = getPlayerNametagText( nametags[i] ):gsub("_"," ") end end end ) function addPlayerToTable( player ) if player then table.insert( nametags, player ) end end addEventHandler( "nmtgs:onPlayerLogin", getRootElement( ), addPlayerToTable ) function removePlayerFromTable( player ) if player and nametags[ player ] then table.remove( nametags, player ) end end addEventHandler( "nmtgs:onPlayerQuit", getRootElement( ), removePlayerFromTable ) ¿Alguna idea? Gracias de antemano.
  5. Hi! This script makes possible to play a 3d sound (looped sound) by pressing the CTRL button, and stop the sound when the CTRL button is "up". Well, it has a really annoying sync bug. As you can see, there is a setElementData function in my client side script, that stores the sound element. When the player stops pressing the CTRL button then the script stops the sound with the stored element. Well the problem is that when another player press the CTRL button then the setElementData will be overwritted, and will cause really strange, annoying bugs. So the bug is: when player1 press CTRL, and after that player2 also press CTRL then the sound for player1 will not stop anymore, because player2 owerwrited the setElementData, when he pressed CTRL. Well, its not easy to explain, so i hope you understood me. Is the any way to avoid this owerwriting? or do i have to do this another way, without setElementData? Thanks in advance. client --start sound function start_fire_sound() if isPedInVehicle (localPlayer) then local veh = getPedOccupiedVehicle(localPlayer) if getElementModel(veh) == 476 then triggerServerEvent ( "start_fire_sound", resourceRoot, veh ) end end end bindKey("lctrl", "down", start_fire_sound) function start_fire_c(veh) local x,y,z = getElementPosition (veh) local sound_fire = playSound3D("files/fire.wav",x,y,z, true) setSoundMaxDistance( sound_fire, 500 ) setSoundVolume(sound_fire, 1) attachElements ( sound_fire, veh, 0,0,0 ) setElementData(localPlayer, "sound_fire", sound_fire) end addEvent( "start_fire_sound", true ) addEventHandler( "start_fire_sound", localPlayer, start_fire_c ) --stop sound function stop_fire_sound() if isPedInVehicle (localPlayer) then local veh = getPedOccupiedVehicle(localPlayer) if getElementModel(veh) == 476 then triggerServerEvent ( "stop_fire_sound", resourceRoot, veh ) end end end bindKey("lctrl", "up", stop_fire_sound) function stop_fire_sound_c(veh) local x,y,z = getElementPosition (veh) local sound_fire_lastshot = playSound3D("files/fire_lastshot.wav",x,y,z, false) setSoundMaxDistance( sound_fire_lastshot, 500 ) setSoundVolume(sound_fire_lastshot, 1) attachElements ( sound_fire_lastshot, veh, 0,0,0 ) local sound_fire = getElementData(localPlayer, "sound_fire") stopSound(sound_fire) end addEvent( "stop_fire_sound", true ) addEventHandler( "stop_fire_sound", localPlayer, stop_fire_sound_c ) server function start_fire_sound(veh) triggerClientEvent ("start_fire_sound", getRootElement(), veh) end addEvent( "start_fire_sound", true ) addEventHandler( "start_fire_sound", getRootElement(), start_fire_sound ) function stop_fire_sound(veh) triggerClientEvent ("stop_fire_sound", getRootElement(), veh) end addEvent( "stop_fire_sound", true ) addEventHandler( "stop_fire_sound", getRootElement(), stop_fire_sound )
  6. Hello Guys, I just want to write a camera system like in GTA 5. (The Camera is closer to the player, etc) So i can aim with any weapon, but not rotating the ped. Cannot look around, cannot look up, or down when aiming. Any Ideas? local camera = {} local currentCameraView = 1 local cameraView = {} cameraView[1] = 1.2 --SimpleControl cameraView[2] = 6.5 --InVehicle camera.dist = cameraView[currentCameraView] camera.speed = 4 camera.x = math.rad(60) camera.y = math.rad(60) camera.z = math.rad(15) camera.maxZ = math.rad(89) camera.minZ = math.rad(-45) addEventHandler("onClientPreRender", getRootElement(), function() x, y, z = getElementPosition(localPlayer) z = z + 0.2 local camDist = camera.dist local cosZ = math.cos(camera.z) camX = x + math.cos(camera.x)*camDist*cosZ camY = y + math.sin(camera.y)*camDist*cosZ camZ = z + math.sin(camera.z)*camDist setCameraMatrix(camX, camY, camZ + 0.2, x + 0.1, y + 0.1, z + 0.2) end) addEventHandler("onClientCursorMove", getRootElement(), function(curX, curY, absX, absY) local diffX = curX - 0.5 local diffY = curY - 0.5 local camX = camera.x - diffX*camera.speed local camY = camera.y - diffX*camera.speed local camZ = camera.z + (diffY*camera.speed)/math.pi if(camZ > camera.maxZ)then camZ = camera.maxZ end if(camZ < camera.minZ)then camZ = camera.minZ end camera.x = camX camera.y = camY camera.z = camZ end) function isItInVeh() isitin = isPedInVehicle(localPlayer) if isitin == true then currentCameraView = 2 else currentCameraView = 1 end camera.dist = cameraView[currentCameraView] end addEventHandler("onClientPreRender", getRootElement(), isItInVeh) bindKey("mouse_wheel_down", "down", function() cameraView[1] = cameraView[1] + 0.1 if(cameraView[1] >= 2.5)then cameraView[1] = 2.5 end camera.dist = cameraView[currentCameraView] end) bindKey("mouse_wheel_up", "down", function() cameraView[1] = cameraView[1] - 0.1 if(cameraView[1] <= 1.2)then cameraView[1] = 1.2 end camera.dist = cameraView[currentCameraView] end) bindKey("mouse_wheel_down", "down", function() cameraView[2] = cameraView[2] + 0.4 if(cameraView[2] >= 12.5)then cameraView[2] = 12.5 end camera.dist = cameraView[currentCameraView] end) bindKey("mouse_wheel_up", "down", function() cameraView[2] = cameraView[2] - 0.4 if(cameraView[2] <= 6)then cameraView[2] = 6 end camera.dist = cameraView[currentCameraView] end) addEventHandler("onClientRender", getRootElement(), function() if isCursorShowing() then camera.speed = 0 elseif isChatBoxInputActive() then camera.speed = 0 else camera.speed = 4 end end) -----------------------------The Aiming Magic bindKey("aim_weapon", "down", function() outputChatBox("Aiming") end) bindKey("aim_weapon", "up", function() outputChatBox("Not Aiming") end)
×
×
  • Create New...