Jump to content

dolmen62

Members
  • Posts

    42
  • Joined

  • Last visited

dolmen62's Achievements

Rat

Rat (9/54)

0

Reputation

  1. Tu souhaite lister tout les véhicules du serveur ? Veux-tu des données sauvegardées ? (Base de données) Car sinon une simple boucle suffit ! function carlist () local tablecar = {{car}} local cars = getElementsByType( "vehicle" ) for k, veh in ipairs( carrs ) do tablecar[k] = {car=veh} end
  2. dolmen62

    Train System?

    Yes ! But I've tryed everything and nothing work without client. It work great because it use only the best Ping client.
  3. Hello ! Now I want to finish it ! I've work on other script now and I know a lot of things. The train script is impossible to read ! its Amazing ! I've seen some big error! Well, It need to be optimized. And the last problems is when there is nobody in the server and the start up of the train that need a player next to the train !
  4. dolmen62

    Train System?

    I've made a train system ! But I have problem when nobody is in the server. The train stop in the Stations ! And it's automatic, nobody have to drive it. But it's very very laggy, and something went wrong when nobody is in the server.
  5. Moi j'ai connu MTA avant SA:MP. Et la première fois que j'y ai joué (pour voir la différence) c'est au niveau de la personnalisation que j'ai trouvé MTA meilleur. En effet, SA:MP conserve énormément de choses du jeu original. (Un bon exemple, le chargement de démarrage, ou encore les couleurs de véhicules, qui sont entièrement personnalisée dans MTA). Voilà une petite remarque sans argumenter des pages (je ne suis pas expert ).
  6. Bug found ! when there is no player in the server ! I'm working to repare it. I will make a vidéo soon.
  7. It is finish now, this is the first version, before MTA 1.1 Thank you all for your help, Citizen, CrystalMV, Solidsnake14.
  8. I need to program station now. But timer are not presise it change in function of the processor charge.
  9. Thank you !!! It work great now !!! Now I have to program station ^^
  10. Well, I've a new idea. view my code : It don't work. Client Side : addEvent("removeStreamableLocos", true ) function removeStreamableLocos( theElement ) setElementStreamable( getElementByID( "loco1" ), false ) setElementStreamable( getElementByID( "wagon1" ), false ) setElementStreamable( getElementByID( "pilot1" ), false ) setElementStreamable( getElementByID( "pilot2" ), false ) end addEventHandler("removeStreamableLocos", getRootElement(), removeStreamableLocos ) addEvent("getTrain", true ) function getTrain () local x, y, z = getElementPosition(getElementByID( "loco1" )) local a, b, c = getElementPosition(getElementByID( "wagon1" )) local g, h, i = getElementPosition(getElementByID( "pilot2" )) local d, e, f = getElementPosition(getElementByID( "pilot1" )) triggerServerEvent("setTrainPosition",getRootElement(),x,y,z,a,b,c,g,h,i,d,e,f) end addEventHandler("getTrain", getRootElement(), getTrain) and Server Side : function makeTrain(source) loco = createVehicle(537,1725.9,-1954,16) locool = createVehicle(538,1840,-1954,16) setElementID( loco, "loco1" ) setElementID( locool, "wagon1" ) setTrainDerailable(loco, false) setTrainDerailable(locool, false) local pilot1 = createPed(241,1693.38,-1959,15.6) local pilot2 = createPed(241,1711,-1959,15.6) setElementID( pilot1, "pilot1" ) setElementID( pilot2, "pilot2" ) warpPedIntoVehicle (pilot1, loco) warpPedIntoVehicle (pilot2, locool) setTimer(setTrain, 5000, 0) createBlipAttachedTo(loco, 42) setTrainSpeed(loco, 0) setTrainSpeed(locool,0.203) setTimer(assemblage, 10000, 1) outputChatBox("Train is here", source, 255, 255, 0) removeStreamable( loco ) setTimer(depart, 20000, 1) nextgare = 0 end addCommandHandler("traintest", makeTrain) function assemblage () nextgare = nextgare+1 setTrainSpeed(loco, 0) setTrainSpeed(locool, 0) setTimer(depart, 20000,1) end function depart () nextgare = nextgare+1 setTrainSpeed(loco, 1) setTrainSpeed(locool, 1) if nextgare == 0 then setTimer(assemblage, 88000, 1) else if nextgare == 2 then setTimer(assemblage, 23000, 1) else if nextgare == 4 then setTimer(assemblage, 93000, 1) else if nextgare == 6 then setTimer(assemblage,102000, 1) else if nextgare == 8 then setTimer(assemblage, 50000, 1) else if nextgare == 10 then nextgare = 0 end end end end end end end function speed () setTrainSpeed(loco, 1) setTrainSpeed(locool, 1) end function removeStreamable( theElement ) triggerClientEvent( "removeStreamableLocos", getRootElement() ) end addEvent("setTrainPosition",true) function setTrain (x,y,z,a,b,c,g,h,i,d,e,f) triggerClientEvent( "getTrain", getRootElement()) setElementPosition(loco, x, y, z, false) setElementPosition(locool, a, b, c, false) setElementPosition(pilot1, d, e, f, false) setElementPosition(pilot2, g, h, i, false) end addEventHandler("setTrainPosition",getRootElement(),setTrain)
  11. I have an Idea : refresh coordinates only when the train is in the station.
  12. It don't work, I have error, when i want to setElement Position !
  13. No... Ok I will try ! But how to execute the function, only for the nearest player ?
  14. I don't think I will use that, because, it's to laggy. I'm working on a system of marker, to put the player into the train. But only when it is here "if nextgare == number of the station "
×
×
  • Create New...