-
Posts
2,753 -
Joined
-
Last visited
-
Days Won
18
Everything posted by Captain Cody
-
--get in local posicoes1 = { { 367, -9, 1002 }, -- local in int "9" } -------------------------------- ------Cluckin Bell------ -------------------------------- -----------{LS}----------- markenterLSCB1 = createMarker (2398, -1898, 15, "arrow", 2, 0, 255, 0, 255) function entradaFoodCB1(thePlayer) local azar = math.random ( #posicoes1 ) setElementPosition(thePlayer, unpack ( posicoes1 [ azar ] ) ) setElementDimension(thePlayer, 1) setElementInterior(thePlayer, 9) end addEventHandler("onMarkerHit", markenterLSCB1, entradaFoodCB1) ---------------------------------------------- markenterLSCB2 = createMarker (2420, -1509, 25, "arrow", 2, 0, 255, 0, 255) function entradaFoodCB2(thePlayer) local azar = math.random ( #posicoes1 ) setElementPosition(thePlayer, unpack ( posicoes1 [ azar ] ) ) setElementDimension(thePlayer, 2) setElementInterior(thePlayer, 9) end addEventHandler("onMarkerHit", markenterLSCB2, entradaFoodCB2) --Exit ---------------------------------- ------Cluckin Bell------ ---------------------------------- ------{LS}------- markenterExitLSCB1 = createMarker (365, -11, 1003, "arrow", 2, 255, 0, 0, 255) setElementInterior(markenterExitLSCB1, 9) setElementDimension(markenterExitLSCB1, 1) function ExitFoodCL1(thePlayer) if ( getElementDimension ( thePlayer ) == 1 ) then setElementInterior(thePlayer, 0) setElementDimension(thePlayer, 0) setElementPosition(thePlayer, 2400, -1896, 14) end addEventHandler("onMarkerHit", markenterExitLSCB1, ExitFoodCL1) ---------------------------------------------- markenterExitLSCB2 = createMarker (365, -11, 1003, "arrow", 2, 255, 0, 0, 255) setElementInterior(markenterExitLSCB2, 9) setElementDimension(markenterExitLSCB2, 2) function ExitFoodCL2(thePlayer) if ( getElementDimension ( thePlayer ) == 2 ) then setElementInterior(thePlayer, 0) setElementDimension(thePlayer, 0) setElementPosition(thePlayer, 2425, -1509, 24) end addEventHandler("onMarkerHit", markenterExitLSCB2, ExitFoodCL2) Added -- if ( getElementDimension ( thePlayer ) == "TheDimension" ) then That should work --- There's other ways of doing it, that are probably easier, but this'll work.
-
yeh nvm what I put here --- But here's your code put in lua. function startHijackTable() random = math.random(#hijackT) model = math.random (#hijackCar) x, y, z, rx, ry, rz = hijackT[random][1], hijackT[random][2], hijackT[random][3], hijackT[random][4], hijackT[random][5], hijackT[random][6] hijackStart = createVehicle ( hijackCar[model][1], x,y,z,rx,ry,rz ) setVehicleDamageProof ( hijackStart, true ) x1, y1, z1 = getElementPosition ( hijackStart ) hijackBlip1 = createBlipAttachedTo (hijackStart, 53) setBlipVisibleDistance ( hijackBlip1, 1500 ) outputChatBox ( "A customer wants the "..getVehicleName( hijackStart ).." at "..getZoneName(x1, y1, z1).."! Go to the race flag before anyone else!", root, 200, 255, 100, true ) end setTimer(startHijackTable, 50, 1) function enterHijack(hijacker, seat, jacked) if source == hijackStart then hx, hy, hz = hijackDT[deliverH][1], hijackDT[deliverH][2], hijackDT[deliverH][3] px, py, pz = getElementPosition ( hijacker ) if (getDistanceBetweenPoints2D ( px, py, hx, hy)) <= 550 then enterHijack(hijacker, seat, jacked) return end deliverH = math.random(#hijackDT) hijackDeliver1 = createMarker ( hx, hy, hz, "cylinder", 4.0, 250, 50,0, 150) hijackBlip2 = createBlipAttachedTo ( hijackDeliver1, 51 ) setVehicleDamageProof ( hijackStart, false ) setElementVisibleTo ( hijackBlip, root, false ) setElementVisibleTo ( hijackBlip, hijacker, true ) setElementVisibleTo ( hijackDeliver1, root, false ) setElementVisibleTo ( hijackDeliver1, hijacker, true ) outputChatBox("Deliver the car to the customer in "..getZoneName(hx, hy, hz).."", hijacker, 52, 134, 196, false) end end
-
You're doing something wrong, script I put should work 100%
-
Is it server sided for one, and for two is the playerInfos = {} at the top of the script
-
In a straight line, the 200km car will hit 200km the 160km car will hit 160, the 160km one just has higher acceleration.
-
What is the exact error you get?
-
playerInfos = {} function infostuff () playerInfos[source] = {} local localplayerinfos = playerInfos[source] localplayerinfos["infos"] = true outputChatBox ( "/Spam /Caps ...Etc.. <--- Input chat message you want", source ) end addCommandHandler("infohelp", infostuff ) function spam () local localplayerinfos = playerInfos[source] if localplayerinfos["infos"] then outputChatBox ( "Info: Stop spamming chat" ) end end addCommandHandler ("spam", spam) function caps () local localplayerinfos = playerInfos[source] if localplayerinfos["infos"] then outputChatBox ( "Info: Please turn caps lock off" ) end end addCommandHandler ("caps", caps) --- Add in the other chat messages with the format I put --- Fixed a few errors, try this (Server sided)
-
Can you put the exact error, because there are many errors that can be outputted there..
-
playerinfos = {} function infostuff () playerinfos[source] = {} local localplayerinfos = playerinfos[source] localplayerinfos["infos"] = true outputChatBox ( "/Spam /Caps ...Etc.. <--- Input chat message you want", source ) end addCommandHandler("infohelp", infostuff ) function spam () local localplayerinfos = playerinfos[source] if localplayerinfos["infos"] then outputChatBox ( "Info: Stop spamming chat" ) end end addCommandHandler ("spam", spam) function caps () local localplayerinfos = playerinfos[source] if localplayerinfos["infos"] then outputChatBox ( "Info: Please turn caps lock off" ) end end addCommandHandler ("caps", caps) --- Add in the other chat messages with the format I put --- Try that, made a typo
-
What line of code is the issue at?
-
If that doesn't work then either wait for someone else to respond or I'll figure out the issue in the morning.
-
Make it server sided.
-
What exactly is the issue?
-
Create a table playerinfos = {} function infostuff () playerinfos[source] = {} local localplayerinfos = playerinfos[source] localplayerinfos["infos"] = true outputChatBox ( "/Spam /Caps ...Etc.. <--- Input chat message you want", source ) end addCommandHandler("infohelp", infostff ) function spam () local localplayerinfos = playerinfos[source] if localplayerinfos["infos"] then outputChatBox ( "Info: Stop spamming chat" ) end end addCommandHandler ("spam", spam) function caps () local localplayerinfos = playerinfos[source] if localplayerinfos["infos"] then outputChatBox ( "Info: Please turn caps lock off" ) end end addCommandHandler ("caps", caps) --- Add in the other chat messages with the format I put --- Questions?
-
For topbar - It depends on the script, or you can make gui come up from a certain amount of time. For /caps or what not For caps- function Caps () outputchatbox("Info: Please turn off your caps") end addcommandhandler("caps", Caps For spam function Spam () outputchatbox("Info: Please stop spamming chat") end addcommandhandler("spam", Spam and so on
-
More info of what you want maybe
-
Assuming the way you copied it moved line 3 to line 4, do you have the right ip and stuff?
-
Any errors in /debugscript 3 And you added a few eventhandlers in the function, they will be added again and again every time someone does the command.
-
*edited by mod because this topic became a sort of knownledge-base* The max volatility out puts in km/h. In your case, it's set to 160 is what it's limited to. In certain conditions yes you can get it up to 160 so 160 is it's max speed. There's however a difference between technical and theoretical limits/end results, due to several handling parameters and factors interacting with eachother. If the vehicles actually reaches the theoretical topspeed (in your case 160km/h) depends on several other factors, like bad tires would affect a real car that was designed to be fast. If your handling grip ('traction' and 'traction loss') is low, you may not achieve the maxvelocity topspeed. Explanation of other parameters that interact: - Drag multiplier is the biggest bottleneck. If it's zero, a car could theoretically reach 2000 kph or more, if other factors allow for it. Try putting it to 0 and edit other parameters accordingly if the performance becomes overkill instantly. - Acceleration affects topspeed, eventhough it realisticly shouldn't, you can thank GTA's engine for this. If topspeed is bad, you could raise acceleration to more extreme values, and then limit the end result (which is too fast) with Engine inertia and others like lower traction, so the acceleration curve (absolute accel speed) is fixed while its value will allow for higher topspeeds. - Similarly to the above, "Steering lock" also caps topspeed. A lower steering lock will allow for higher topspeeds reachable, but too low or high and you can barely steer the vehicle or the visual wheel angles may glitch out. - If inertia is too high, at a point it won't even properly limit the acceleration curve, but also the maximum top speed. A negative inertia is also a bad idea. It's value should ideally be between 1 and 10. (1 for high performance vehicles, where other parameters are also tuned for speed) Conclusion: if you edit just a bunch of random values that to the eye look like they should raise vehicle speed, you will probably not achieve speeds matching to what the values look like, because of bottlenecks that you will also need to edit before unleashing the true power of what you initially (mainly) changed. Practical example: you spawn a vehicle, and edit only Max velocity (topspeed) and nothing really changes. Or, you edit Max velocity and also Acceleration, your vehicle will just slip out easier and/or nothing changes to it's speeds or topspeed. Now, if you also (besides max velocity/topspeed and acceleration) change: Drag multiplier, to 0, and Traction to 0.9, and Traction Loss to 1.1, while Max velocity is 2000 and Acceleration is 40, then you will probably reach about 1100 mp/h, depending on the vehicle you're changing default handling of (its predefined other values). This shows GTA SA is capable of driving with such speeds. You can then proceed to edit several other factors to cap the too extreme end result down to something more realistic, or just use this example as your test case to learn how handling values interact with eachother.
-
Whats the event hadler/command handler attatched to it? And you don't put what "plr" is, unless that's included in a previous part of the script.
-
Yes, had to add in something in the first script to check if the driver was on the fuel marker when repeating to prevent it from constantly showing the message.
-
Ok nvm, this accually works, seams it was another part on the script causing the issue.
-
setTimer ( function() IsHejailed = isElementWithinColShape ( thePlayerJail, JailColShape ) end, 15000, 1 ) if IsHejailed == true then No errors in debug script "3".
-
Yet another issue... God, I suck at scripting.
Captain Cody replied to Captain Cody's topic in Scripting
How would I do serial or account name?