Jump to content

dragonofdark

Members
  • Posts

    203
  • Joined

  • Last visited

Everything posted by dragonofdark

  1. Tu suis le tutoriel ici : https://wiki.multitheftauto.com/wiki/Server_Manual#Port_forwarding
  2. Oui c'est bien là que tu dois ouvrir les ports, et non tu ne risques pas de perdre ton internet, sinon pourquoi ton fournisseur aurait mis cette option ?
  3. Si quelqu'un sait t'aider, il t'aidera, mais ce n'est pas la peine de demander sur un autre sujet.
  4. Je n'ai aucun fichier .map dans mon dossier mods... Pourtant j'ai été dans bien beaucoup de serveurs !
  5. Les maps sont du coté "serveur", et ne sont donc pas stockées dans l'ordinateur du client une fois téléchargées. C'est pour cela qu'ils doivent toujours retélécharger les maps.
  6. Tout simplement sur le wiki de MTA. => https://wiki.multitheftauto.com/wiki/Main_Page Attention toute fois : Il te faut beaucoup de connaissances en LUA et SQL avant de pouvoir monter ton serveur RP, car cela prend longtemps à faire. Par exemple, il a fallu 1an et demi à Byston Evolution pour ouvrir sa beta au public. Et moi j'en suis à 1an de scripting (seul) et la beta ouvrira ses portes en 2012. Le mieux est de commencer par faire un simple Freeroam, puis aller vers une type RPG du genre CIT, et ensuite si tu estimes que tu es assez "pro" avec le LUA tu pourras faire ton serveur RP tant attendu
  7. Hey, I tested your resource but there's a problem through. I put 2 files named securicar.dff and securicar.txd in the vehicles folder, and when I start the resource, it saw in the debugscript that no mod were loaded, I didn't have any download. However, restartResource is set on true in the ACL. I don't get it
  8. Benox vient de la partie Francophone du Canada... Donc je ne vois pas pourquoi il utiliserait Google Translate. Et puis, les Canadiens ont des expressions/grammaire différente(s) qu'en Europe, donc ce n'est pas la peine de l'agresser. Savoir tu parler Français ? A bon entendeur...
  9. So, Can I make some painjobs for a vehicle which doesn't support painjobs things ? (virgo, tampa,...)
  10. Hello, I would like to know if there is a possibility to make a vehicle paintjob with shaders ? If yes, could you explain me how to ? Thanks a lot, dragonofdark
  11. Hum.. I tested your script and I have a Bad Argument @ 'bindKey' I didn't change anything in it...
  12. Hello, I made a tolls system there are some months ago and I would like to modify it to use mySQL for more facility. Here is my problem, I have a "table index is nil" error when I start the resource and it loads only one barrier (with ID 1) My script : local peageIDs = { } local peages = { } addEventHandler( "onResourceStart", resourceRoot, function( ) -- Create the SQL tables if not already. if not exports.sql:create_table( 'peages', { { name = 'peageID', type = 'int(10) unsigned', primary_key = true }, { name = 'barrierModel', type = 'int(10) unsigned' }, { name = 'interior', type = 'tinyint(3) unsigned', default = 0 }, { name = 'dimension', type = 'int(10) unsigned', default = 0 }, -- { name = 'markerposX', type = 'float' }, { name = 'markerposY', type = 'float' }, { name = 'markerposZ', type = 'float' }, -- { name = 'posX', type = 'float' }, { name = 'posY', type = 'float' }, { name = 'posZ', type = 'float' }, { name = 'rotX', type = 'float' }, { name = 'rotY', type = 'float' }, { name = 'rotZ', type = 'float' }, -- { name = 'openPosX', type = 'float' }, { name = 'openPosY', type = 'float' }, { name = 'openPosZ', type = 'float' }, { name = 'openRotX', type = 'float' }, { name = 'openRotY', type = 'float' }, { name = 'openRotZ', type = 'float' }, -- { name = 'prix', type = 'int(10) unsigned', default = 0 }, -- price of the taxe when passing the toll } ) then cancelEvent( ) return end -- load the tolls local result = exports.sql:query_assoc( "SELECT * FROM peages ORDER BY peageID ASC" ) if result then for key, data in ipairs( result ) do local barrier = createObject ( data.barrierModel, data.posX, data.posY, data.posZ, data.rotX, data.rotY, data.rotZ ) local marker = createMarker( data.markerposX, data.markerposY, data.markerposZ, 'cylinder', 3, 100, 100, 100, 100 ) -- tables for ID -> data peageIDs[ data.peageID ] = peage peages[ peage ] = { peageID = data.peageID, interior = data.interior, dimension = data.dimension } end end end ) Debugscript : ERROR: peages\peage.lua:44: table index is nil Thanks
  13. Sorry for this bump but.. Will you implement the plane/boat special handlings too ?
  14. Perfect I couldn't thank you enought Castillo
  15. No, Still give me sometimes the wrong line.
  16. No, it's not that. EDIT : I think it's the math.random thing.
  17. Thanks, most of the things work but I still have this "attempt to get length of field '?' (a nil value)" error at line local route = math.random( #routes[getElementData(player,"route")] ) (I'll test if it's not the S at route) Not that EDIT : It works ! (But why when I click on "city" it put me the country line ?)
  18. route.lua (the list of checkpoints) routes = {} routes["city"] = { { { x=1802.39, y=-2072.26, z=13.64, hint = "C'est tres simple, suivez la route jusqu'au premier arret. Pour tous les points jaunes, il est suffisant de passer dedans." }, { x=1964.35, y=-1959.11, z=13.79 }, { x=1824.07, y=-1858.88, z=13.49, hint = "Ralentissez ! Il y a un arret devant et vous devez attendre quelques secondes avant de continuer votre route." }, { x=1784.24, y=-1826.28, z=13.51, hint = "Arret actuel : Gare centrale.\nProchain arret : Pershing Square.", stop = true }, { x=1692.29, y=-1750.9, z=13.48 }, { x=1496.73, y=-1728.63, z=13.51, hint = "Arret actuel : Pershing Square.\nProchain arret : St-Lawrence Blvd.", stop = true }, { x=1386.77, y=-1806.54, z=13.48 }, { x=1316.22, y=-1828.36, z=13.55, hint = "Arret actuel : St-Lawrence Blvd.\nProchain arret : Hopital.", stop = true }, { x=1354.21, y=-1428.68, z=13.48 }, { x=1177.48, y=-1391.7, z=13.49, hint = "Arret actuel : Hopital.\nProchain arret : Librairie.", stop = true }, { x=914.78, y=-1514.97, z=13.6 }, { x=821.54, y=-1625.65, z=13.51, hint = "Arret actuel : Librairie.\nProchain arret : Port de plaisance.", stop = true }, { x=782.39, y=-1771.37, z=13.34 }, { x=455.41, y=-1757.26, z=5.74 }, { x=165.62, y=-1732.64, z=4.69, hint = "Arret actuel : Port de plaisance.\nProchain arret : Banque ING.", stop = true }, { x=296.53, y=-1415.17, z=14.07 }, { x=564.04, y=-1245.1, z=17.28, hint = "Arret actuel : Banque ING.\nProchain arret : Cimetiere.", stop = true }, { x=794.35, y=-1091.09, z=24.18 }, { x=966.31, y=-1113.29, z=23.79, hint = "Arret actuel : Cimetiere.\nProchain arret : W. Broadway.", stop = true }, { x=1058.31, y=-1041.8, z=32.17 }, { x=1122.6, y=-959.4, z=42.76, hint = "Arret actuel : W. Broadway.\nProchain arret : Banque BNP-Paribas.", stop = true }, { x=1369, y=-1037.64, z=26.339 }, { x=1459.65, y=-1037.55, z=23.79, hint = "Arret actuel : Banque BNP-Paribas.\nProchain arret : St-Lawrence Blvd.", stop = true }, { x=1452.9, y=-1218.06, z=15.57 }, { x=1339.18, y=-1313.67, z=13.54, hint = "Arret actuel : St-Lawrence Blvd.\nProchain arret : St-Lawrence Blvd.", stop = true }, { x=1419.39, y=-1443.15, z=13.52 }, { x=1490.71, y=-1595.67, z=13.51, hint = "Arret actuel : St-Lawrence Blvd.\nProchain arret : Prison.", stop = true }, { x=1825.08, y=-1593.21, z=13.49, hint = "Arret actuel : Prison.\nProchain arret : Glenpark.", stop = true }, { x=1852.7, y=-1291.64, z=13.51 }, { x=2000.21, y=-1264.62, z=23.9, hint = "Arret actuel : Glenpark.\nProchain arret : Coutt and Schutz.", stop = true }, { x=2153.27, y=-1120.19, z=25.4, hint = "Arret actuel : Coutt and Schutz.\nProchain arret : Club de StripTease.", stop = true }, { x=2367.98, y=-1162.99, z=27.56 }, { x=2425.04, y=-1260.31, z=23.96, hint = "Arret actuel : Club de StripTease.\nProchain arret : Saints Blvd (haut).", stop = true }, { x=2477.72, y=-1186.71, z=39.44 }, { x=2705.904, y=-1187.57, z=69.37, hint = "Arret actuel : Saints Blvd (haut).\nProchain arret : Saints Blvd.", stop = true }, { x=2718.82, y=-1482.23, z=30.41, hint = "Arret actuel : Saints Blvd.\nProchain arret : Plage Est.", stop = true }, { x=2865.68, y=-1514.6, z=11.01 }, { x=2833.7, y=-1779.46, z=11 }, { x=2854.3, y=-1958.55, z=11.07, hint = "Arret actuel : Plage Est.\nProchain arret : Ten Green Bottles.", stop = true }, { x=2835.55, y=-1918.01, z=11.07 }, { x=2532.75, y=-1729.7, z=13.51 }, { x=2316.57, y=-1655.24, z=14.18, hint = "Arret actuel : Ten Green Bottles.\nProchain arret : Station service TOTAL.", stop = true }, { x=2180.45, y=-1746.95, z=13.5 }, { x=1920.82, y=-1748.64, z=13.52, hint = "Arret actuel : Station service TOTAL.\nProchain arret : Gare centrale.", stop = true }, { x=1789.22, y=-1851.71, z=13.54, hint = "Arret actuel : Gare centrale.\nPour terminer votre service, allez garer ce bus au dépôt.", stop = true }, { x=1807.93, y=-2072.05, z=13.55 }, } } routes["country"] = { { { x=1802.39, y=-2072.26, z=13.64, hint = "Country Bus Line, just follow the checkpoints." }, { x=1964.35, y=-1959.11, z=13.79 }, { x=1784.24, y=-1826.28, z=13.51, hint = "Bus Stop 1 : Unity Station", stop = true }, -- I need to finish these checkpoints } } bus.lua local vehicles = get( "vehicles" ) or { "Coach" } -- Charge les véhicules qui commence le job après être entrer dedans local max_earnings = tonumber( get( "earnings" ) ) or 10 local delay = tonumber( get( "delay" ) ) or 5 -- put it in a for us better format local vehicles2 = { } for key, value in ipairs( vehicles ) do local model = getVehicleModelFromName( value ) if model then vehicles2[ model ] = true else outputDebugString( "Le vehicule '" .. tostring( value ) .. " n existe pas." ) end end vehicles = vehicles2 vehicles2 = nil local function isJobVehicle( vehicle ) return vehicle and vehicles[ getElementModel( vehicle ) ] and not exports.vehicles:getOwner( vehicle ) or false end -- local p = { } local function advanceRoute( player, earnings ) if p[ player ] and p[ player ].route and p[ player ].checkpoint then local cp = p[ player ].checkpoint + 1 local c = p[ player ].route[ cp ] local n = p[ player ].route[ cp + 1 ] if c then if p[ player ].route[ p[ player ].checkpoint ] then if p[ player ].route[ p[ player ].checkpoint ].stop and earnings and earnings > 0 then exports.players:giveMoney( player, earnings ) end if p[ player ].route[ p[ player ].checkpoint ].hint then triggerClientEvent( player, "gui:hint", player, "Votre job : Chauffeur de bus", p[ player ].route[ p[ player ].checkpoint ].hint ) end end if not n then -- last checkpoint triggerClientEvent( player, getResourceName( resource ) .. ":set", player, c.x, c.y, c.z, c.stop and true ) else triggerClientEvent( player, getResourceName( resource ) .. ":set", player, c.x, c.y, c.z, c.stop and true, n.x, n.y, n.z, n.stop and true ) end else if earnings then exports.players:giveMoney( player, earnings * 3 ) end triggerClientEvent( player, getResourceName( resource ) .. ":set", player ) p[ player ] = nil return false end p[ player ].checkpoint = cp return true end end local function panel( player ) if "job-" .. tostring( exports.players:getJob( player ) ) == getResourceName( resource ) then triggerClientEvent (source, "fenetreBUS", getRootElement()) end end addCommandHandler("bus", panel) local function newRoute( player ) p[ player ].vehicleOnResourceStart = nil local route = math.random(1, #routes[getElementData(player,"route")] ) p[ player ].route = routes[getElementData(player,"route")][ route ] p[ player ].checkpoint = 0 advanceRoute( player ) end addEventHandler( "onVehicleEnter", root, function( player, seat ) if seat == 0 and isJobVehicle( source ) then if not p[ player ] then p[ player ] = { } end if not p[ player ].route then panel( player ) outputChatBox( "(( /bus pour commencer votre tournée. ))", player, 255, 0, 0 ) else triggerClientEvent( player, getResourceName( resource ) .. ":show", player ) end end end ) -- addEventHandler( "onResourceStart", resourceRoot, function( ) if not routes or routes == 0 then cancelEvent( ) return end -- setElementData( resourceRoot, "delay", delay ) -- for key, value in ipairs( getElementsByType( "player" ) ) do local vehicle = getPedOccupiedVehicle( value ) if vehicle and getPedOccupiedVehicleSeat( value ) == 0 and isJobVehicle( vehicle ) then p[ value ] = { vehicleOnResourceStart = vehicle } end end setTimer( function( ) for key, value in pairs( p ) do p[ key ].vehicleOnResourceStart = nil end end, 10000, 1 ) end ) addEvent( getResourceName( resource ) .. ":ready", true ) addEventHandler( getResourceName( resource ) .. ":ready", root, function( ) if source == client then if p[ source ] and getPedOccupiedVehicle( source ) == p[ source ].vehicleOnResourceStart and getPedOccupiedVehicleSeat( source ) == 0 then panel( source ) end end end ) -- addEvent( getResourceName( resource ) .. ":complete", true ) addEventHandler( getResourceName( resource ) .. ":complete", root, function( ) if source == client then local vehicle = getPedOccupiedVehicle( source ) if p[ source ] and p[ source ].route and isJobVehicle( vehicle ) and getPedOccupiedVehicleSeat( source ) == 0 then -- distance check if not p[ source ].route[ p[ source ].checkpoint ].stop or getDistanceBetweenPoints2D( p[ source ].route[ p[ source ].checkpoint ].x, p[ source ].route[ p[ source ].checkpoint ].y, getElementPosition( vehicle ) ) < 5 then local health = math.min( 1000, getElementHealth( vehicle ) ) if health > 350 then -- calculate earnings based on vehicle health local earnings = p[ source ].route[ p[ source ].checkpoint ].stop and math.ceil( ( health - 350 ) / 650 * max_earnings ) or 0 -- get a checkpoint advanceRoute( source, earnings ) end end end end end ) addEventHandler( "onCharacterLogout", root, function( ) if p[ source ] and p[ source ].route then triggerClientEvent( source, getResourceName( resource ) .. ":set", source ) end p[ source ] = nil end ) addEventHandler( "onPlayerQuit", root, function( ) p[ source ] = nil end ) -- addEventHandler( "onVehicleStartEnter", root, function( player, seat ) if seat == 0 and isJobVehicle( source ) and "job-" .. tostring( exports.players:getJob( player ) ) ~= getResourceName( resource ) then outputChatBox( "(( Vous pouvez avoir ce job à l'hôtel de ville. ))", player, 255, 0, 0 ) cancelEvent( ) end end ) -- function introduce( player ) triggerClientEvent( player, getResourceName( resource ) .. ":introduce", player ) end bus_c.lua local localPlayer = getLocalPlayer( ) local position = nil local marker = nil local blip = nil local blip2 = nil local wait = false local screenX, screenY = guiGetScreenSize( ) function drawWaitingText( ) -- Voyons si le bus attend local text = "patientez..." local vehicle = getPedOccupiedVehicle( localPlayer ) if vehicle then if getElementHealth( vehicle ) <= 350 then text = "Réparez votre véhicule" elseif wait and wait ~= 0 then local diff = wait - getTickCount( ) if diff >= 0 then text = ( "Veuillez attendre %.1f secondes" ):format( diff / 1000 ) else triggerServerEvent( getResourceName( resource ) .. ":complete", localPlayer ) wait = 0 end end -- draw the text dxDrawText( text, 4, 4, screenX, screenY, tocolor( 0, 0, 0, 255 ), 1, "pricedown", "center", "center" ) dxDrawText( text, 0, 0, screenX, screenY, tocolor( 255, 255, 255, 255 ), 1, "pricedown", "center", "center" ) end end -- function fenetreBUS(source) fenetre = guiCreateWindow(521,520,253,122,"Choix de la route",false) guiWindowSetSizable(fenetre,false) label = guiCreateLabel(12,26,232,30,"Vous avez le choix entre 2 routes a faire :\nLa ville ou les villages",false,fenetre) cityButton = guiCreateButton(31,78,88,24,"Ville",false,fenetre) countryButton = guiCreateButton(130,78,88,24,"Villages",false,fenetre) guiSetVisible(fenetre, true) showCursor(true) end function onGUIClick() if (source == cityButton) then setElementData(localPlayer,"route","city") elseif (source == countryButton) then setElementData(localPlayer,"route","country") end end addEventHandler("onClientGUIClick",root,onGUIClick) addEvent("fenetreBUS", true) addEventHandler("fenetreBUS", getResourceRootElement(getThisResource()), fenetreBUS) -- local function hide( ) if isElement( blip ) then destroyElement( blip ) end blip = nil if isElement( blip2 ) then destroyElement( blip2 ) end blip2 = nil if isElement( marker ) then destroyElement( marker ) end marker = nil if wait then wait = false removeEventHandler( "onClientRender", root, drawWaitingText ) end end local function show( ) hide( ) if position then -- in lack of a more detailed close-location (aka we use the entrance), use large markers marker = createMarker( position.x, position.y, position.z, "checkpoint", 3, position.stop and 0 or 255, 255, 0, 63 ) if marker then blip = createBlipAttachedTo( marker, 0, 2, position.stop and 0 or 255, 255, 0, 255 ) end if position.nx and position.ny and position.nz then blip2 = createBlip( position.nx, position.ny, position.nz, 0, 1, position.nstop and 0 or 255, 255, 0, 255 ) end end end addEvent( getResourceName( resource ) .. ":show", true ) addEventHandler( getResourceName( resource ) .. ":show", localPlayer, show ) addEvent( getResourceName( resource ) .. ":set", true ) addEventHandler( getResourceName( resource ) .. ":set", localPlayer, function( x, y, z, stop, nx, ny, nz, nstop ) if x and y and z then position = { x = x, y = y, z = z, stop = stop, nx = nx, ny = ny, nz = nz, nstop = nstop } show( ) else position = nil hide( ) end end ) addEventHandler( "onClientPlayerVehicleExit", localPlayer, hide ) addEventHandler( "onClientResourceStart", resourceRoot, function( ) triggerServerEvent( getResourceName( resource ) .. ":ready", localPlayer ) end ) addEventHandler( "onClientMarkerHit", resourceRoot, function( element, matching ) if matching and element == localPlayer then if position.stop then if not wait then wait = getTickCount( ) + getElementData( resourceRoot, "delay" ) * 1000 addEventHandler( "onClientRender", root, drawWaitingText ) end else triggerServerEvent( getResourceName( resource ) .. ":complete", localPlayer ) end end end ) addEventHandler( "onClientMarkerLeave", resourceRoot, function( element, matching ) if matching and element == localPlayer then wait = false removeEventHandler( "onClientRender", root, drawWaitingText ) exports.gui:hint( "Votre job : Chauffeur de bus", "Pas trop vite, laissez le temps aux clients d'entrer !", 3 ) end end )
  19. When i click on a button, it does nothing. i have no error.
  20. bandi94 => Doesn't work Another question : How can I join 2 buttons to these routes ? Exemple : city button variable : city and country button : country.
  21. Hey, I have this error : ERROR: job-bus\bus.lua:70: attempt to get length of field '?' (a nil value) at line local route = math.random( #routes[getElementData(player,"route")] )
  22. Hello, I made a little GUI for my bus system, which let us chose which route to take (city or countryside). Normally I have just one route so I have this : routes = { { { x=1802.39, y=-2072.26, z=13.64, hint = "City Bus Line, just follow the checkpoints." }, { x=1964.35, y=-1959.11, z=13.79 }, { x=1784.24, y=-1826.28, z=13.51, hint = "Bus Stop 1 : Unity Station", stop = true }, -- and all my checkpoints/stops for this route } } and in my script I have that : local function newRoute( player ) p[ player ].vehicleOnResourceStart = nil local route = math.random( #routes ) p[ player ].route = routes[ route ] p[ player ].checkpoint = 0 advanceRoute( player ) end advanceRoute is the function which unPack all coordinates,.. So, How can I modify this to make 2 routes (first code) and if I push "this" button then it loads "this" route ? Thanks
×
×
  • Create New...