Jump to content

KariiiM

Members
  • Posts

    1,312
  • Joined

  • Last visited

Everything posted by KariiiM

  1. Im alittle bit curious and I want to know if Is it possible to connect mta server with Oracle Data Base instead of MySQL / Sqlite?
  2. Im asking if there is a way to code for MTA in Java instead of Lua?
  3. Hey, As the title says, Is there another method to attach the player userdata under a key onLogin without using the elementdatas? Thanks,
  4. Alright, does anyone know how to make this circle's shape looks smooth?
  5. @Killer Project You did nothing bro, only copied the wiki. I'm talking about the steps to make circle becomes progress.
  6. Hello Community, Did anyone here have done making the circle progresss bar before? if yes, I would like to know the steps you followed to make it. Thanks in advance.
  7. Hello community, I'm using MySQL database to save data for my scripts I make for people in local server, I wonder if there's a way to use MySQL in local server with out using XAMP since XAMP force you to close the skype before using it, is there any good remplacement? Thanks in advance.
  8. KariiiM

    Car Rotators

    Lua developers had created "ipairs" and "pairs" loops for their purpose, each loop has its role and its own usage; "ipairs": looping indexed tables and in order. "pairs": looping the tables who were created with a key-value and pairs donnot return the table's items in order even for indexed tables.
  9. KariiiM

    trigger

    Hardly to help without posting your code
  10. Hey swag_k_dog, try my code and let me know --CLIENT SIDE: local missionMarker = createMarker(2153, -1799, 12.5, "cylinder", 1.1, 255, 0, 0, 100) local FONT = guiCreateFont(":freeroam_login/images/gtasanandreas.ttf", 50) function missionGui() missionName = guiCreateLabel(0.64, 0.85, 0.38, 0.13, "sweet buisness", true) guiSetFont(missionName, FONT) guiLabelSetColor(missionName, 252, 226, 81) end function destroyGuis ( ) if isElement ( missionName ) then destroyElement ( missionName ) end end addEventHandler ( "onClientMarkerHit", missionMarker, function ( hitElement ) if ( isElement ( hitElement ) and hitElement == localPlayer ) then triggerServerEvent ( "server->hitMarker", localPlayer, localPlayer ) end end ) addEventHandler ( "onClientMarkerLeave", missionMarker, function ( hitElement ) if ( isElement ( hitElement ) and hitElement == localPlayer ) then destroyGuis ( ) end end ) addEvent ( "client->hitMarker", true ) addEventHandler ( "client->hitMarker", localPlayer, function ( ) missionGui ( ) fadeCamera ( false, 1.3 ) setTimer ( fadeCamera, 3000, 1, false, 1.3 ) setTimer ( guiSetVisible, 5500, 1, missionName, false ) end ) --SERVER SIDE: addEvent ( "server->hitMarker", true ) addEventHandler ( "server->hitMarker", root, function ( player ) if ( not client ) then return -- for security reasons, this helps against rouge clients end if ( not player ) then return -- the same end triggerClientEvent ( client, "client->hitMarker", client ) end )
  11. Where is the timing part ?
  12. Make a check if the player is logged in then get his account name, otherwise you will need to store it the player name somewhere each time logged / left the game and get it later.
  13. Hello there, I wanna know why I get this error message in my local server console, ERROR Msg: Kind regards, KariM
  14. You forgot to add the column's type.
  15. You had removed the first part of the error message to tell you where does this error exist at.
  16. The error says its a sql syntax problem... so, the code that you shared here has nothing to do with the sql syntax, its just a code for database connection sharing.
  17. Xampp isn't a connection, Im sure you mean Mysql.
  18. Yeah because this boolean is for the sound loop
  19. I suggest you to go to your native language scripting section
  20. Change the old client code by this: --start sound function start_fire_sound ( ) if isPedInVehicle ( localPlayer ) then local theVehicle = getPedOccupiedVehicle ( localPlayer ) if ( theVehicle and getElementModel ( theVehicle ) == 476 ) then triggerServerEvent ( "start_fire_sound", localPlayer, theVehicle ) end end end bindKey ( "lctrl", "down", start_fire_sound ) local fireSound = { } local lastShot = { } addEvent ( "return_start_fire_sound", true ) addEventHandler ( "return_start_fire_sound", root, function ( ) if isElement ( fireSound [ localPlayer ] ) then destroyElement ( fireSound [ localPlayer ] ) end local x, y, z = getElementPosition ( source ) fireSound [ localPlayer ] = playSound3D ( "files/fire.wav", x, y, z, true ) setSoundVolume ( fireSound [ localPlayer ], 1 ) setSoundMaxDistance ( fireSound [ localPlayer ], 500 ) attachElements ( fireSound [ localPlayer ], source, 0, 0, 0 ) end ) --stop sound function stop_fire_sound ( ) if isPedInVehicle ( localPlayer ) then local theVehicle = getPedOccupiedVehicle ( localPlayer ) if ( theVehicle and getElementModel ( theVehicle ) == 476 ) then triggerServerEvent ( "stop_fire_sound", localPlayer, theVehicle ) end end end bindKey ( "lctrl", "up", stop_fire_sound ) addEvent( "return_stop_fire_sound", true ) addEventHandler( "return_stop_fire_sound", root, function ( ) if isElement ( lastShot [ localPlayer ] ) then destroyElement ( lastShot [ localPlayer ] ) end if isElement ( fireSound [ localPlayer ] ) then destroyElement ( fireSound [ localPlayer ] ) end local x, y, z = getElementPosition ( source ) lastShot [ localPlayer ] = playSound3D ( "files/fire_lastshot.wav", x, y, z, true ) setSoundVolume ( lastShot [ localPlayer ], 1 ) setSoundMaxDistance ( lastShot [ localPlayer ], 500 ) attachElements ( lastShot [ localPlayer ], source, 0,0,0 ) end )
  21. Try my code and inform me the results. --Client side: --start sound function start_fire_sound ( ) if isPedInVehicle ( localPlayer ) then local theVehicle = getPedOccupiedVehicle ( localPlayer ) if ( theVehicle and getElementModel ( theVehicle ) == 476 ) then triggerServerEvent ( "start_fire_sound", localPlayer, theVehicle ) end end end bindKey ( "lctrl", "down", start_fire_sound ) addEvent ( "return_start_fire_sound", true ) addEventHandler ( "return_start_fire_sound", root, function ( ) local x, y, z = getElementPosition ( source ) local fireSound = playSound3D ( "files/fire.wav", x, y, z, true ) setSoundMaxDistance ( fireSound, 500 ) setSoundVolume ( fireSound, 1 ) attachElements ( fireSound, source, 0, 0, 0 ) setElementData ( localPlayer, "sound_fire", fireSound ) end ) --stop sound function stop_fire_sound ( ) if isPedInVehicle ( localPlayer ) then local theVehicle = getPedOccupiedVehicle ( localPlayer ) if ( theVehicle and getElementModel ( theVehicle ) == 476 ) then triggerServerEvent ( "stop_fire_sound", localPlayer, theVehicle ) end end end bindKey ( "lctrl", "up", stop_fire_sound ) addEvent( "return_stop_fire_sound", true ) addEventHandler( "return_stop_fire_sound", root, function ( ) local x, y, z = getElementPosition ( source ) local sound_fire_lastshot = playSound3D ( "files/fire_lastshot.wav", x, y, z, true ) 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" ) if ( sound_fire ) then stopSound ( sound_fire ) destroyElement ( sound_fire ) end end ) --Server side: addEvent ( "start_fire_sound", true ) addEventHandler ( "start_fire_sound", root, function ( theVehicle ) triggerClientEvent ( "return_start_fire_sound", theVehicle ) end ) addEvent ( "stop_fire_sound", true ) addEventHandler ( "stop_fire_sound", root, function ( theVehicle ) triggerClientEvent ( "return_stop_fire_sound", theVehicle ) end )
  22. Whatever, I had answered your main topic's question, About your second question, you'll need to make some calculations using math to draw the first text in the top of the rectangle and in each message draw a new message under the first one using some logic calculations by getting the last height plus the new height ..etc And when your box becomes containing max lines make a scroll system.
  23. The default chatbox is already based on directX, But to make a custom one you'll need to disable the default one and start building a custom one, using dxDrawText and if needed dxDrawRectangle, Also you can use the event onClientChatMessage to output on your custom chatbox any when any text is output to the default chatbox of MTA.
×
×
  • Create New...