Jump to content

kieran

Members
  • Posts

    367
  • Joined

  • Last visited

Everything posted by kieran

  1. Hello, I have spent a couple days learning the ins and outs of installing MySQL, I can tell you where to get the needed files, how to avoid errors, how to set it all up and basically get you started, I do NOT know how to create a database right now, but watched a tutorial or two and it seems easy, if you need links/help then either leave a comment or message me. I am here to help! --I have posted this here as MySQL is a great resource for creating databases and is easy to set up once you know how to do it.--
  2. Thanks I figured as much, got a lot of editing to move stuff to client and server side. Was just making it to learn from.
  3. I mean to check if it a player has spawned a vehicle from the table, so when he hits the marker to spawn a truck/trailer any existing vehicles will be destroyed.
  4. kieran

    Errors

    @CodX looks to me as if you just chucked random stuff from resources in the wrong folders and hoped for the best..... First of all sort all the missing files, for example... [2017-06-17 16:55:15] ERROR: Couldn't find file skins/csher.txd for resource changeme [2017-06-17 16:55:15] Loading of resource 'changeme' failed [2017-06-17 16:55:15] ERROR: Couldn't find script s_marker.lua for resource job-system-trucker [2017-06-17 16:55:15] Loading of resource 'job-system-trucker' failed [2017-06-17 16:55:15] ERROR: Couldn't find map San Fierro/LSTR.map for resource map-system-old [2017-06-17 16:55:15] Loading of resource 'map-system-old' failed "Couldn't find" probably means that you don't actually have the files... Go and make sure they are there, if you put them in a folder in your game mode (as I often do which is the WRONG WAY) you should make sure you have "Folder\Resource" in your meta.xml where Folder is your folder and Resource is the resource name, after that post again, that or send the parts of the script with errors and then players can see..... [2017-06-17 16:55:21] ERROR: ped-system/s_peds.lua:39: cannot resume dead coroutine [string "?"] <<<Here the problem originates from line 39 in your ped-system/s_peds.lua file, I suggest searching the command/event/function on the wiki. Useful tip, make a resource folder and call the folder(s) instead of the scripts on a game mode, this prevents problems such as black screens and other weird things like that when using the "upgrade" command in console. (Can still do weird stuff, but less likely to) Also learn how to ask for help! I do it a lot, but rules and guidelines for posting topics are here: https://forum.multitheftauto.com/topic/12275-forum-rules/ And rules for posting on this subforum are here: https://forum.multitheftauto.com/topic/94790-guidelines-and-formatting-for-this-section-read-before-posting/ Basically you forgot an accurate title missing [Question] or [Bug] tags.
  5. Thanks, I'm sort of swaying off topic here, but is there a way to check if an element in a table is spawned and if it is destroy it with destroyelement?
  6. Okay, forget the marker etc, I fixed it, thanks to MoPoMaN's script I found out I needed to change delivmark = createMarker(-1355.6999511719, -506.20001220703, 13.10000038147, "cylinder", 3, 42, 214, 153, 100) --this is the location. to delivmark = createMarker(-1355.6999511719, -506.20001220703, 13.10000038147, "cylinder", 3, 42, 214, 153, 100) --this is the location. addEventHandler ("onMarkerHit", delivmark, deliveredgood) (I guess this makes it then tells it to go to the function, rather than trying to call nil from the script) Now I just want to know how to attach trailers to a vehicle created on a table, other stuff is easy to figure out.
  7. It still doesn't, I also need the function to givePlayerCash etc from line 26 when a player hits the marker, it was creating the marker before, but the problem is it won't see the marker when the resource starts, meaning it gives me an error because the function linked to the destination marker apparently isn't there...... For some reason it only wants createMarker to be at the top. Also with trailers I want to make it simple and use the attachTrailerToVehicle function newvehicle = createVehicle ( 515, 0, 0, 4 ) -- create a trailer tower (roadtrain) setTimer( function() trailer = createVehicle ( 435, 0, 0, 4 ) -- create a trailer attachTrailerToVehicle ( newvehicle, trailer ) -- attach them end, 50, 1)
  8. I have made another half working half failed script basically it is a trucker script and sort of works, but I can't figure out how to delete the blip attached to marker, the marker itself, and I also want to spawn the marker when I spawn the truck...... The only problem is I can't figure out how to create marker from eventhandler or call it from a function when it is created. Here's what I have so far... startdelmark = createMarker( 211.39999389648, 1809.5, 16.60000038147, "cylinder", 3, 42, 214, 153, 100 ) --spawns truck from here. delivmark = createMarker(-1355.6999511719, -506.20001220703, 13.10000038147, "cylinder", 3, 42, 214, 153, 100) --this is the location. TruckVehiclesTable = {} local myBlip = createBlipAttachedTo ( startdelmark, 51 ) --blip on the spawn marker. function spawntruck (truckElement) if ( isElement(truckElement) and getElementType(truckElement) == 'player' ) then local truckVeh = getPedOccupiedVehicle(truckElement) local x, y, z = getElementPosition (truckElement) local rotX, rotY, rotZ = getElementRotation (truckElement) TruckVehiclesTable[truckElement] = createVehicle (515, x-5, y, z+2) setElementRotation (TruckVehiclesTable[truckElement], rotX, rotY, 90) warpPedIntoVehicle (truckElement, TruckVehiclesTable[truckElement]) local deliverBlip = createBlipAttachedTo ( delivmark, 52 ) --the blip I want on the destination marker. setBlipSize ( myBlip, 1 ) outputChatBox ("You have took on the role of goods courier, deliver the goods to the dollar blip to get your reward", truckElement, 0, 255, 0) outputChatBox ("Do NOT leave the vehicle or it will be destroyed and your mission will fail!", truckElement, 255, 0, 0) end end addEventHandler("onMarkerHit", startdelmark, spawntruck) function deliveredgood (truckElement) --the markers function I want to do when a player drives into it with the spawned vehicle. if ( isElement(truckElement) and getElementType(truckElement) == 'player' ) then local truckVeh = getPedOccupiedVehicle(truckElement) if ( truckVeh ) then if ( TruckVehiclesTable[truckElement] ) then destroyElement(truckVeh) TruckVehiclesTable[truckElement] = nil givePlayerMoney ( truckElement, tonumber(1000) ) outputChatBox ("Congrats! Here's your payment.", truckElement, 0, 255, 0) destroyElement(deliverBlip) -- I want to delete the blip attached to the marker below. destroyElement(delivmark) -- I want to delete it. end end en end addEventHandler("onMarkerHit", delivmark, deliveredgood) addEventHandler ( "onPlayerVehicleExit", getRootElement(), function(truckVehicle, leftSeat, jackerPlayer) if ( TruckVehiclesTable[source] ) then destroyElement(TruckVehiclesTable[source]) TruckVehiclesTable[source] = nil outputChatBox ("Your vehicle was destroyed as you left it and now your mission has failed!", truckElement, 255, 0, 0) end end) addEventHandler('onPlayerQuit',root, function () if ( TruckVehiclesTable[source] ) then destroyElement(TruckVehiclesTable[source]) TruckVehiclesTable[source] = nil end end) I also want to attach a trailer when the vehicle spawns, but it spawns on a table, so how would I do that, is there a createVehicleFromTable function or something s that?
  9. @!#NssoR_) Thanks so much, it works great now, you seem to always find my cries for help haha.
  10. It still says [2017-06-20 23:32:27] WARNING: test\destroy_veh.lua:3: Bad argument @ 'isObjectInACLGroup' [Expected acl-group at argument 2, got Booleani local accountname = getAccountName(getPlayerAccount(player)) if isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "admin" ) ) then --is now line 3. There's still however the small issue of actually deleting the element even without the admin part it does not see the element being clicked, just the mouse click itself...
  11. I am trying to make a script for admins so they can destroy vehicles with mouse click, just in case they can not enter vehicle as it might be close to walls either side, the problems I am having are one, the vehicle does not get removed, and 2, I get an error when I try it as admin. function AdminCarRemoval ( button, state, player ) if isObjectInACLGroup ( "user." .. getAccountName(getPlayerAccount(source)), aclGetGroup ( "admin" ) ) then if getElementType == "vehicle" then if button == "left" and state == "down" then destroyElement () end end end end addEventHandler( "onElementClicked", getRootElement( ), AdminCarRemoval ) ^Yes, I have set it server side^ Error: test\destroy_veh.lua:2: attempt to concatenate global 'accountname' (a nil value)
  12. I tried logging into the community forum today and it said invalid ID.... However I am somehow logged in here able to comment about this issue.... I know it is an account issue as I have created another account just in case any of these glitches happened and I thought it would be best to test them before posting, I logged in on other account but this account can not log on to community resources. I didn't really know where to post this, so sorry if this is the wrong place.
  13. Thanks I completely forgot that was a thing haha, only needed to use it once. it works perfect now :3
  14. Hello, I have just made an interior but I was wondering if you could set 2 markers within the same interior, basically I want to warp my guy from one bit of my interior to another on a marker hit. This is what I got so far: one_marker = createMarker(126.9833984375, 407.57830810547, 893.24072265625, "arrow", 0.8, 255, 255, 0, 170 ) two_marker = createMarker(127.30000305176, 386, 859.20001220703, "arrow", 0.8, 255, 255, 0, 170 ) setElementInterior(one_marker, 2, 126.9833984375, 407.57830810547, 893.24072265625) setElementInterior(two_marker, 2, 127.30000305176, 386, 859.20001220703) function int_test(player) if (source == one_marker and getElementType(player) == "player") then setElementInterior(player, 2, 127.30000305176, 388, 859.20001220703) setElementFrozen(player,false) setTimer(setElementFrozen, 1000, 1, player, false) elseif (source == two_marker and getElementType(player) == "player") then setElementInterior(player, 2, 126.30000305176, 407.60000610352, 892.40002441406) setElementFrozen(player,false) setTimer(setElementFrozen, 1000, 1, player, false) end end addEventHandler("onMarkerHit", root, int_test) The markers are there but do nothing when I hit them, I sort of figured out it's because you can't send yourself to the same interior, but I thought I'd post just to see if there is a way.
  15. It works perfectly now! thanks so much for helping guys
  16. @!#NssoR_) OMG thanks, this works nice. but it still pops up with warning in console when it destroys element... [2017-06-17 03:58:47] WARNING: Test\vehiclestuff.lua:5: Bad argument @ 'getElementType' [Expected element at argument 1]
  17. Hello, I have made a basic script to spawn a vehicle on marker hit, but I want to destroy the vehicle when a player drives back into the marker, my script is below, get message saying "Expected element at argument 1, got nil" (From line 14) vehSpawnMark = createMarker (2410.6, 1552.1, 10, "cylinder", 5, 0, 255, 203, 100 ) function spawnvehicle (thePlayer) local x, y, z = getElementPosition (thePlayer) local mainveh = createVehicle (411, x-10, y, z) local rotX, rotY, rotZ = getElementRotation (thePlayer) setElementRotation (mainveh, rotX, rotY, 90) warpPedIntoVehicle (thePlayer, mainveh) outputChatBox ("You successfully spawned an Infernus!", thePlayer, 0, 255, 0) end addEventHandler("onMarkerHit", vehSpawnMark, spawnvehicle) function removecar () destroyElement (mainveh) end addEventHandler ( "onMarkerHit", vehSpawnMark, removecar ) It spawns the vehicle, but it doesn't see an element at "destroyElement (mainveh)" (line 14) when I hit the marker... Got this script from a YouTube video, it was originally meant to spawn car on command and destroy it when a player left the car, but I changed it for markers.
  18. @pa3ckCheers! I thought it was something like this, but was unsure.
  19. @Tourettes Remaining question.... How to set timers between/before a function?
  20. Thanks, but I have tried this already, both elements stay in the same position and ignore rotation, I don't think there is a way to attach and move on marker hit...
  21. Having some problems with an Elevator/lift script I am making, it's all on the comments below, but will write under too. --lift test crate = createObject(2669, 2340.3000488281, 1544.9000244141, 11.10000038147, 0, 0, 90)--Creates the lift. crate_Rdoor = createObject(2678, 2342.8999023438, 1544.0999755859, 10.970000267029) crate_Ldoor = createObject(2679, 2342.8999023438, 1545.6999511719, 10.970000267029, 0, 0, 180) marker_ = createMarker(2338, 1546.1999511719, 11.10000038147, "arrow", 1, 100, 0, 0, 110)--Marker KeyPad_ = createObject(2922, 2338, 1546.3000488281, 11.199999809265, 0, 0, 180)--Want to attach my marker to move with this. --Function to close doors will be added here later. (setTimer, 2000) --Want to start the function AFTER the player hits the marker. function crate_up(player) --Moves everything but marker up by 10) moveObject(crate, 10000, 2340.3000488281, 1544.9000244141, 21.10000038147) moveObject(crate_lift_Rdoor, 10000, 2342.8999023438, 1544.0999755859, 20.970000267029) moveObject(crate_lift_Ldoor, 10000, 2342.8999023438, 1545.6999511719, 20.970000267029) moveObject(KeyPad_, 10000, 2338, 1546.3000488281, 21.199999809265) end addEventHandler("onMarkerHit",marker_,crate_up) --Another timer for doors opening at top will go here. --Function to open doors will be added later. --Final timer to move the crate back down (and marker). function crate_down(player) moveObject(crate, 10000, 2340.3000488281, 1544.9000244141, 11.10000038147) moveObject(crate_Rdoor, 10000, 2342.8999023438, 1544.0999755859, 10.970000267029) moveObject(crate_Ldoor, 10000, 2342.8999023438, 1545.6999511719, 10.970000267029) moveObject(KeyPad_, 10000, 2338, 1546.3000488281, 11.199999809265) end addEventHandler("onMarkerLeave",marker_,crate_down) Basically I want my marker attached to my keypad so the marker moves WITH the object. I also want to set timers starting from marker hit, I am trying to hit marker, close doors, set timer for lift to move, then after that I can figure it out. (Will be using more than one timer.) Thanks for any help/advice you have!
  22. Still doesn't work..... Loaded the .lua conversion and nothing...
  23. I have encountered a problem on a base I made using that horrid large grey object, I have removed a building and created the base there... It works, but I was wondering if you can use LOD's in a .map instead of making it all into a .lua, here is how I have attempted to make one object not disappear on my .map file. <object id="object (gnhtelgrnd_lvs) (28)" breakable="true" interior="0" collisions="true" alpha="255" model="8661" doublesided="true" scale="1" dimension="0" lodModel="5154" posX="2397.3999" posY="1553.1" posZ="49.6" rotX="0" rotY="0" rotZ="0"></object> Please help, I can't be bothered converting it all to lua!
×
×
  • Create New...