Jump to content

tosfera

Members
  • Posts

    1,193
  • Joined

  • Last visited

Everything posted by tosfera

  1. Hey guys, I'm creating a mechanic script, but can't find the animation thats being used on most server. The smashing the car's roof one, . Anyone has the blockname + animation name for me? Thanks!
  2. hahaha those feelings are the worst. Look what I made it,,, is useless.
  3. haha yeah its AND. Without SQL knowledge it might be a entirely new world for you. This might be interesting to look at as an example; local id = executeSQLQuery("SELECT COUNT(ID) as 'id_' FROM player_vehicle") insert = executeSQLQuery("INSERT INTO player_vehicle(ID, modelID,color1,color2,color3,color4,vehicleOwner, vehicleHealth, saveX, saveY, saveZ, saveRX, saveRY, saveRZ, spawned, fuel) VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)", id[1].id_, modelID, color_1, color_2, color_3,color_4, accName, "1000", 1464.8820, 748.1798, 11.5, 0, 0, 90, 1, 100 )
  4. Cause the XML of your map isn't correct. Use the editor to recreate the map (make sure you have the latest MTA version and server files). The new XML files looks like this; "object (carter-bars) (3)" breakable="true" interior="0" collisions="true" alpha="255" model="14437" doublesided="false" scale="1" dimension="0" posX="3290.8999" posY="1172" posZ="943.90002" rotX="0" rotY="0" rotZ="0">
  5. addCommandHandler("obj", function () if ( getPedOccupiedVehicle ( source ) ) then if ( isElement ( marker ) ) then destroyElement ( marker ); else local x,y,z = getElementPosition( getPedOccupiedVehicle( source ) ); local marker = createObject ( 1318, x,y,z+2, 0, 0, 0 ); attachElements (marker, getPedOccupiedVehicle( source ) , 0, 0, 2 ); end else outputChatBox("You need to be in a vehicle to do this.", source); end end ); Like that? ._.'
  6. Nope, but why do you want to use this functions? Maybe there is another way.
  7. Pointless what you did there. Since its a command its suppose have; function (player, command, vehicleId, x, y, z)
  8. Ahh a serversided event that gets activated with a triggerEvent? Will try it tomorrow. edit; works like a charm!
  9. It is but why do you want to type the coordinates. Just use; local x,y,z = getElementPosition( source )
  10. There is, the thing you have to do is as following; -- get the player's location -- create the vehicle on the location and rotation (would be nice) -- warpPedIntoVehicle Thats all. Oh and you mind want to change the command to accept another argument; a vehicle ID.
  11. Hey guys, There is something going wrong but I'm not sure what or where. When the player hits the last marker it resets all the data and restarts the function. But it doesn't restart the function. O_O client; -- accepts the job function bus_accept() guiSetVisible ( bus_start_window, false ); showCursor( false ); triggerServerEvent ( "bus_start_accept", getLocalPlayer(), getLocalPlayer() ); end addEvent("bus_start_job", true); addEventHandler("bus_start_job", root, function() local jobs = { { "2447.0329", "2055.8024", "10" }, { "2339.8483", "1990.3818", "10" }, { "2546.0214", "1966.8399", "10" }, { "2850.3469", "2092.4084", "10" }, { "2581.9252", "2115.7055", "10" }, { "2617.3837", "1716.0717", "10" }, { "2447.0329", "2055.8024", "10" }}; for i, item in ipairs ( jobs ) do if ( i == getElementData(getLocalPlayer(), "marker") ) then finish_marker_bus = createMarker( item[1], item[2], item[3], "checkpoint", 5, 0, 0, 255, getLocalPlayer() ); finish_blip_bus = createBlip( item[1], item[2], item[3], 19 ); outputChatBox(tostring(i)); end if ( getElementData(getLocalPlayer(), "marker") == #jobs ) then setElementData(getLocalPlayer(), "marker", 0 ); triggerEvent("bus_start_job", localPlayer ); call ( getResourceFromName ( "hud_messages" ), "showBox","[Company] Great work, now pick up the new people!", 0, 255, 0, 5000 ); givePlayerMoney( 250 ); setElementData( getLocalPlayer(), "Money", getPlayerMoney() ); end end end ); addEventHandler("onClientMarkerHit", root, function ( hitElement ) if ( source == finish_marker_bus and hitElement == localPlayer ) then if ( getPedOccupiedVehicle ( hitElement ) and getElementModel ( getPedOccupiedVehicle ( hitElement ) ) == 431 ) then setElementData(getLocalPlayer(), "marker", getElementData(getLocalPlayer(), "marker") + 1 ); destroyElement(finish_marker_bus); destroyElement(finish_blip_bus); triggerEvent("bus_start_job", localPlayer ); call ( getResourceFromName ( "hud_messages" ), "showBox","[People] Right in time, lets go!", 0, 255, 0, 5000 ); else call ( getResourceFromName ( "hud_messages" ), "showBox","[People] Where is the bus? I'm coming late for work!!", 255, 0, 0, 5000 ); end end end ); server; addEvent("bus_start_accept", true); addEventHandler("bus_start_accept", root, function( source ) setPlayerTeam( source, getTeamFromName("Busdriver") ); setElementData( source, "marker", 1 ); setElementModel( source, 171 ); triggerClientEvent( "bus_start_job", source ); end ); Thaanks
  12. yeah, a bunch of busses has to be spawned. Only problem is, its not working as a command or as a onResourceStart. It smacked me in the face with a dizzy dummy and its still confusing me. I stopped every resource and only started 1. Still doesn't work. ha, ha-ha, hahahahaha trolled my MTA's dimension system. --' I left the editor but didn't reconnect. So its spammed with cars in dimension 0 now. Stupid safe system... thanks anyways!
  13. Still doesn't work... O_O My code is perfect, nothing wrong about it. edit; I noticed that I can't spawn vehicle's with runcode anymore too...
  14. Oke so here is the thing. I want to get rid of the .map file cause I got a fuel system that has his own way of working etc. So I exported all the information I got from the .map file (about the vehicle's I spawned) but it's telling me to fck off and hit my head against a wall or something... So I placed this code in my onResourceStart (SERVER SIDE, I'm not stupid); local vehicles = { {"2588.5", "1830.59998", "11.1", "0", "0", "270" }, {"2606.3999", "1837", "11.1", "0", "0", "90" }, {"2606.30005", "1843.30005", "11.1", "0", "0", "90" }, {"2606.30005", "1849.69995", "11.1", "0", "0", "90" }, {"2606.3999", "1856.09998", "11.1", "0", "0", "90" }, {"2606.30005", "1862.69995", "11.1", "0", "0", "90" }, {"2606.3999", "1830.69995", "11.1", "0", "0", "90" }, {"2588.3999", "1856.09998", "11.1", "0", "0", "270" }, {"2588.30005", "1849.80005", "11.1", "0", "0", "270" }, {"2588.3999", "1843.40002", "11.1", "0", "0", "270" }, {"2588.30005", "1862.80005", "11.1", "0", "0", "270" }, {"2588.3999", "1837", "11.1", "0", "0", "270" }, {"2606.3999", "1815.09998", "11.1", "0", "0", "90" }, {"2606.3999", "1808.59998", "11.1", "0", "0", "90" }, {"2588.19995", "1808.69995", "11.1", "0", "0", "270" }, {"2606.30005", "1802.19995", "11.1", "0", "0", "90" }, {"2606.3999", "1795.90002", "11.1", "0", "0", "90" }, {"2606.5", "1789.59998", "11.1", "0", "0", "90" }, {"2588.19995", "1802.40002", "11.1", "0", "0", "270" }, {"2588.19995", "1815.09998", "11.1", "0", "0", "270" }, {"2588.3999", "1795.90002", "11.1", "0", "0", "270" }, {"2606.5", "1783.40002", "11.1", "0", "0", "90" }, {"2588.3999", "1789.90002", "11.1", "0", "0", "270" }, {"2588.3999", "1783", "11.1", "0", "0", "270" } }; for index, item in ipairs (vehicles) do v = createVehicle(431, item[1], item[2], item[3]); setElementData(v, "fuel", 100); setElementData(v, "type", "work"); end but its not working. Not even 1 single bus is getting spawned...
  15. tosfera

    New chat

    You mean a Local chat? You can create a Col around the person that said something, send the message to everyone thats in that Col and done. The support chat can be found here; https://community.multitheftauto.com/in ... ls&id=6552
  16. tosfera

    Table

    Its just a way to save it, I didn't recommend doing it. Only told him that its a way of doing it. I would only recommend XML if you're making marker's for shops, blips and so on.
  17. tosfera

    Question/Tip

    just save all the data to your SQLITE database. Its only a query of a few bytes that are being sent. Its wont bring any lag if you manage to get the queries bugless.
  18. tosfera

    Table

    The best thing to do with these kind of script is to save them somewhere else. You can do that in 3 ways (The 3 ways I can think of right now! ) xmlLoadFile -- using xml files to save character's and accounts executeSQLQuery -- mysql server msyql_query -- mysql server, but with a module For more information about the module, check out this link: [url=https://wiki.multitheftauto.com/wiki/Modules/MTA-MySQL/mysql_query]https://wiki.multitheftauto.com/wiki/Mo ... ysql_query[/url] The reason that your password keeps changing back is because when you restart the source, the information will be refilled with your information. You can't hold a variable modified while the script restarts.
  19. The eventhandlers does not support tokens like ( " ' , ). Change the name; account:login:attempt to this; account_login_attempt
  20. Incorrect... For some reason you do have to do a check on the hitelement otherwise it will show for all players.. Not really sure why, but it does. ^ that is still a black box for me too. Client side is only for the player thats doing something, like single player. But somehow the entire server will get the GUI...
  21. You dont have to use an export. You can also try and combine these 2 resources. Would be alot easier and bring less bugs / glitches.
  22. You got help or did you do it yourself? Else I could check for any bugs in it for you if you'd like that.
  23. I can also see a little bug in your script, always use this while you're making a marker; if ( hitElement == getLocalPlayer() and source == ) then Else it will trigger for all the players and not only the client (hitElement)
  24. Also add these; getPlayerAccount setAccountData getAccountData
  25. MTA is not supporting custom animations YET! They did announce that they will be adding it!
×
×
  • Create New...