Jump to content


  • Posts

  • Joined

  • Last visited


  • Gang

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

LagParty's Achievements


Square (6/54)



  1. thanks, after trying it i discovered that the event is only called when setPlayerMoney, givePlayerMoney or takePlayerMoney are called on a server side script. It's not bad after all since i only need to move the money related things to the server.
  2. Just an event that's triggered every time a player recieves or loses money, so if you save some player's money serverside, you don't have to script "saveThisPlayersMoney" everywhere.
  3. Thanks for your help. I'm converting an old sa-mp business-script to mta (and adding all the bonuses of the new system). The problem comes when a player leaves the server, because after that you have 5 minutes to come back or else your business will be sold. Also, the other players can't buy that player's business if he's not connected. This system helps players that are dropped from the server for any reason (time-out, crash, etc). Anyways, here's the code: addEventHandler("onPlayerQuit", rootElem, function() playerMarker[source] = nil setTimer(sellAllProperties, 300000, 1, source, getPlayerName(source), getPlayerMoney(source)) -- 5 minutes to come back end ) function sellAllProperties(playerID, pname, pmoney) local player = getPlayerFromName(pname) if player ~= false then return end -- if he's still connected then stop for mark,prop in pairs(properties) do if prop["owner"] == playerID then pmoney = pmoney + prop["price"]*0.5 prop["owner"] = nil setBlipColor(prop["blip"],0,255,0,180) setMarkerColor(mark,0,255,0,150) end end executeSQLUpdate("playerinfo", string.format("money = %d", pmoney), string.format("name = '%s'", pname) ) end
  4. simple: function isPlayerConnected(theplayer) <- returns true if the player is connected, false if its not. theplayer is a player element. Any substitute will do.
  5. where is this function? i cant seem to find it
  6. Is there any way to detect mouse movement along the x axis?, (when aiming or moving the camera around the vehicle you are driving)
  7. You win https://community.multitheftauto.com/index.html?p ... ils&id=488 (oh and also the 3 seconds difference comes from the previous alpha function: totalFramesToShow/currentfps. So 250/50fps -> 5 seconds and 250/30fps -> 8 seconds)
  8. The difference between 30fps and 50fps is 3 seconds, not a big deal. https://community.multitheftauto.com/index.php?p= ... ils&id=488 There's the standalone-freeroam resource, updated with more comments and that kind of stuff.
  9. I'll work on that. If i release it as a standalone resource then it will work with a custon xml file. If i use the setTimer function the text flashes, so if you know any workaround for that i'll use it.
  10. Thanks 50p. Here's my working code: (if anyone is interested) Server side: --read the xml file yadda yadda local rootElement = getRootElement() function cargarXml() local i = 0 local xmlRoot = xmlLoadFile( "vehicles.xml" ) local xmlTag = xmlFindChild( xmlRoot, "group", i ) local xmlName = xmlNodeGetAttribute( xmlTag, "name" ) while xmlName ~= "Todos los cambiados" do xmlTag = xmlFindChild( xmlRoot, "group", i ) xmlName = xmlNodeGetAttribute( xmlTag, "name" ) i = i+1; end i = 0 --[[here we will save the important values, tablaid is a table with integers representing each of the replaced cars id's. nombres is another table with strings representing the new names for those cars.]] tablaid = {} nombres = {} local xmlCars = xmlFindChild( xmlTag, "vehicle", i) while xmlCars do table.insert( tablaid, tonumber(xmlNodeGetAttribute(xmlCars, "id")) ) table.insert( nombres, xmlNodeGetAttribute(xmlCars, "name") ) i = i+1 xmlCars = xmlFindChild( xmlTag, "vehicle", i) end xmlUnloadFile(xmlRoot) end addEventHandler("onResourceStart", rootElement, cargarXml) --Here's the important part: function entrar ( theVehicle ) showPlayerHudComponent ( source, "vehicle_name", true ) for i,v in ipairs(tablaid) do if (v==getElementModel(theVehicle)) then showPlayerHudComponent ( source, "vehicle_name", false ) playerCarName = nombres[i] triggerClientEvent( source, "MostrarNombre", rootElement, playerCarName ) end end end addEventHandler ( "onPlayerVehicleEnter", rootElement, entrar ) Client side: --get some important values and create some more local rootElement = getRootElement() local screenWidth, screenHeight = guiGetScreenSize() local x = screenWidth*0.25 local y = screenHeight*0.95 local carName = "fail" local i = 0 function createText () --smooth fade in/out i = i+1 local alpha = 255 if i < 63 then alpha = i*4 elseif i >= 190 then alpha = (250-i)*4 end --black border dxDrawText( carName, x+1, y, screenWidth, screenHeight, tocolor ( 0, 0, 0, alpha ), 1.2, "bankgothic" ) dxDrawText( carName, x-1, y, screenWidth, screenHeight, tocolor ( 0, 0, 0, alpha ), 1.2, "bankgothic" ) dxDrawText( carName, x, y+1, screenWidth, screenHeight, tocolor ( 0, 0, 0, alpha ), 1.2, "bankgothic" ) dxDrawText( carName, x, y-1, screenWidth, screenHeight, tocolor ( 0, 0, 0, alpha ), 1.2, "bankgothic" ) --green text dxDrawText( carName, x, y, screenWidth, screenHeight, tocolor ( 54, 104, 44, alpha ), 1.2, "bankgothic" ) --we don't want to see the text forever: if i==250 then removeEventHandler("onClientRender",rootElement, createText) end end --called by the server: function HandleText( var ) carName = var i = 0 addEventHandler("onClientRender",rootElement, createText) end addEvent("MostrarNombre", true) addEventHandler("MostrarNombre",rootElement, HandleText) And here's my example xml file, i'm using these scripts with freeroam vehicles.xml <catalog type="vehicle"> <group name="Vehiculos aereos"> <group name="Helicopteros"> <vehicle id="548" name="Cargobob" /> <vehicle id="425" name="Hunter" /> <vehicle id="417" name="Leviathan" /> <vehicle id="487" name="Maverick" /> <vehicle id="488" name="News Chopper" /> <vehicle id="497" name="Police Maverick" /> <vehicle id="563" name="Raindance" /> <vehicle id="447" name="Seasparrow" /> <vehicle id="469" name="Sparrow" /> </group> <group name="Aviones y jets"> <vehicle id="592" name="Andromada" /> <vehicle id="577" name="AT-400" /> <vehicle id="511" name="Beagle" /> <vehicle id="512" name="Cropduster" /> <vehicle id="593" name="Dodo" /> <vehicle id="520" name="Hydra" /> <vehicle id="553" name="Nevada" /> <vehicle id="476" name="Rustler" /> <vehicle id="519" name="Shamal" /> <vehicle id="460" name="Skimmer" /> <vehicle id="513" name="Stuntplane" /> </group> </group> <group name="Motos y Bicicletas"> <group name="Motos"> <vehicle id="581" name="BF-400" /> <vehicle id="462" name="Faggio" /> <vehicle id="521" name="FCR-900" /> <vehicle id="463" name="Freeway" /> <vehicle id="523" name="HPV1000" /> <vehicle id="522" name="NRG-500" /> <vehicle id="461" name="PCJ-600" /> <vehicle id="448" name="Pizza Boy" /> <vehicle id="468" name="Sanchez" /> <vehicle id="586" name="Wayfarer" /> <vehicle id="471" name="Quadbike" /> </group> <group name="Bicicletas"> <vehicle id="509" name="Bike" /> <vehicle id="481" name="BMX" /> <vehicle id="510" name="Mountain bike" /> </group> </group> <group name="Botes"> <vehicle id="472" name="Coastguard" /> <vehicle id="473" name="Dinghy" /> <vehicle id="493" name="Jetmax" /> <vehicle id="595" name="Launch" /> <vehicle id="484" name="Marquis" /> <vehicle id="430" name="Predator" /> <vehicle id="453" name="Reefer" /> <vehicle id="452" name="Speeder" /> <vehicle id="446" name="Squalo" /> <vehicle id="454" name="Tropic" /> </group> <group name="Autos"> <group name="Deportivos"> <vehicle id="602" name="Alpha" /> <vehicle id="429" name="Banshee" /> <vehicle id="402" name="Buffalo" /> <vehicle id="541" name="Bullet" /> <vehicle id="415" name="Cheetah" /> <vehicle id="480" name="Comet" /> <vehicle id="562" name="Elegy" /> <vehicle id="587" name="Euros" /> <vehicle id="565" name="Flash" /> <vehicle id="411" name="Infernus" /> <vehicle id="559" name="Jester" /> <vehicle id="603" name="Phoenix" /> <vehicle id="560" name="Sultan" /> <vehicle id="506" name="Super GT" /> <vehicle id="451" name="Turismo" /> <vehicle id="558" name="Uranus" /> <vehicle id="555" name="Windsor" /> <vehicle id="477" name="ZR-350" /> </group> <group name="Lowriders"> <vehicle id="536" name="Blade" /> <vehicle id="575" name="Broadway" /> <vehicle id="518" name="Buccaneer" /> <vehicle id="419" name="Esperanto" /> <vehicle id="534" name="Remington" /> <vehicle id="567" name="Savanna" /> <vehicle id="535" name="Slamvan" /> <vehicle id="576" name="Tornado" /> <vehicle id="412" name="Voodoo" /> </group> <group name="2 Puertas"> <vehicle id="496" name="Blista Compact" /> <vehicle id="401" name="Bravura" /> <vehicle id="527" name="Cadrona" /> <vehicle id="542" name="Clover" /> <vehicle id="589" name="Club" /> <vehicle id="533" name="Feltzer" /> <vehicle id="526" name="Fortune" /> <vehicle id="474" name="Hermes" /> <vehicle id="545" name="Hustler" /> <vehicle id="517" name="Majestic" /> <vehicle id="410" name="Manana" /> <vehicle id="436" name="Previon" /> <vehicle id="475" name="Sabre" /> <vehicle id="439" name="Stallion" /> <vehicle id="549" name="Tampa" /> <vehicle id="491" name="Virgo" /> </group> <group name="4 Puertas"> <vehicle id="445" name="Admiral" /> <vehicle id="438" name="Cabbie" /> <vehicle id="507" name="Elegant" /> <vehicle id="585" name="Emperor" /> <vehicle id="466" name="Glendale" /> <vehicle id="492" name="Greenwood" /> <vehicle id="546" name="Intruder" /> <vehicle id="551" name="Merit" /> <vehicle id="516" name="Nebula" /> <vehicle id="467" name="Oceanic" /> <vehicle id="426" name="Premier" /> <vehicle id="547" name="Primo" /> <vehicle id="405" name="Sentinel" /> <vehicle id="580" name="Stafford" /> <vehicle id="409" name="Stretch" /> <vehicle id="550" name="Sunrise" /> <vehicle id="566" name="Tahoma" /> <vehicle id="420" name="Taxi" /> <vehicle id="540" name="Vincent" /> <vehicle id="421" name="Washington" /> <vehicle id="529" name="Willard" /> </group> </group> <group name="Emergencias"> <vehicle id="416" name="Ambulance" /> <vehicle id="433" name="Barracks" /> <vehicle id="427" name="Enforcer" /> <vehicle id="490" name="FBI rancher" /> <vehicle id="528" name="FBI truck" /> <vehicle id="407" name="Fire truck" /> <vehicle id="544" name="Fire truck (ladder)" /> <vehicle id="596" name="Police car (LS)" /> <vehicle id="598" name="Police car (LV)" /> <vehicle id="597" name="Police car (SF)" /> <vehicle id="599" name="Police ranger" /> <vehicle id="432" name="Rhino" /> <vehicle id="601" name="S.W.A.T." /> </group> <group name="Vehiculos pesados"> <group name="Industriales"> <vehicle id="524" name="Cement truck" /> <vehicle id="578" name="DFT-30" /> <vehicle id="486" name="Dozer" /> <vehicle id="406" name="Dumper" /> <vehicle id="573" name="Dune" /> <vehicle id="455" name="Flatbed" /> <vehicle id="530" name="Forklift" /> <vehicle id="403" name="Linerunner" /> <vehicle id="443" name="Packer" /> <vehicle id="515" name="Roadtrain" /> <vehicle id="574" name="Sweeper" /> <vehicle id="514" name="Tanker" /> <vehicle id="525" name="Towtruck" /> <vehicle id="408" name="Trashmaster" /> <vehicle id="552" name="Utility van" /> </group> <group name="Acoples"> <vehicle id="606" name="Baggage trailer (covered)" /> <vehicle id="607" name="Baggage trailer (Uncovered)" /> <vehicle id="610" name="Farm trailer" /> <vehicle id="537" name="Freight train" /> <vehicle id="590" name="Freight train boxcar" /> <vehicle id="569" name="Freight train flatbed" /> <vehicle id="611" name="Street Clean trailer" /> <vehicle id="584" name="Gas trailer" /> <vehicle id="608" name="Trailer 1" /> <vehicle id="435" name="Trailer 2" /> <vehicle id="450" name="Trailer 3" /> <vehicle id="591" name="Trailer 4" /> </group> <group name="Camiones"> <vehicle id="499" name="Benson" /> <vehicle id="609" name="Black Boxville" /> <vehicle id="422" name="Bobcat" /> <vehicle id="498" name="Boxville" /> <vehicle id="414" name="Mule" /> <vehicle id="600" name="Picador" /> <vehicle id="543" name="Sadler" /> <vehicle id="428" name="Securicar" /> <vehicle id="478" name="Walton" /> <vehicle id="456" name="Yankee" /> <vehicle id="554" name="Yosemite" /> </group> <group name="Camionetas"> <vehicle id="459" name="Berkley's RC van" /> <vehicle id="482" name="Burrito" /> <vehicle id="483" name="Camper" /> <vehicle id="508" name="Journey" /> <vehicle id="418" name="Moonbeam" /> <vehicle id="582" name="News van" /> <vehicle id="413" name="Pony" /> <vehicle id="440" name="Rumpo" /> </group> </group> <group name="Miscelaneos"> <group name="Otros"> <vehicle id="485" name="Baggage" /> <vehicle id="568" name="Bandito" /> <vehicle id="424" name="BF Injection" /> <vehicle id="504" name="Bloodring Banger" /> <vehicle id="538" name="Brownstreak Engine" /> <vehicle id="431" name="Bus" /> <vehicle id="457" name="Caddy" /> <vehicle id="437" name="Coach" /> <vehicle id="532" name="Combine harvester" /> <vehicle id="588" name="Hotdog" /> <vehicle id="434" name="Hotknife" /> <vehicle id="494" name="Hotring racer" /> <vehicle id="502" name="Hotring racer 2" /> <vehicle id="503" name="Hotring racer 3" /> <vehicle id="444" name="Monster" /> <vehicle id="556" name="Monster 2" /> <vehicle id="557" name="Monster 3" /> <vehicle id="572" name="Mower" /> <vehicle id="423" name="Mr. Whoopee" /> <vehicle id="570" name="Kart" /> <vehicle id="531" name="Tractor" /> <vehicle id="449" name="Trolly" /> <vehicle id="583" name="Tug" /> <vehicle id="539" name="Vortex" /> </group> <group name="Vehiculos radiocontrolados"> <vehicle id="441" name="RC Bandit" /> <vehicle id="464" name="RC Baron" /> <vehicle id="594" name="RC Flower Pot" /> <vehicle id="501" name="RC Goblin" /> <vehicle id="465" name="RC Raider" /> <vehicle id="564" name="RC Tiger" /> </group> </group> <group name="SUVs y Wagons"> <vehicle id="579" name="Huntley" /> <vehicle id="400" name="Landstalker" /> <vehicle id="500" name="Mesa" /> <vehicle id="470" name="Patriot" /> <vehicle id="404" name="Perennial" /> <vehicle id="489" name="Rancher" /> <vehicle id="479" name="Regina" /> <vehicle id="442" name="Romero" /> <vehicle id="495" name="Sandking" /> <vehicle id="458" name="Solair" />
  11. Is it possible to change the vehicle names (the text that appears in green after you get into one)? if so, which functions should i use? Thanks.
  12. or make a map with a jump over 10 busses what about the modified cars on game? (with parts that you get on the shops on sa)
  13. I have a suggestion of having the ability to spawn vehicles into the map, not for players, just like you put a cone or pickup you can put a vehicle with no players on it. For example you can use this to make a police roadblock or to make the race more difficult because you have to evade the vehicles on the street. I want this because i was making a drag map of nfsu2 in sa but i didn't find the trains into the items. ah.. i was near to forget it.. can you get cars modified at start? tnx.
  • Create New...