
Kubimate
Members-
Posts
8 -
Joined
-
Last visited
Everything posted by Kubimate
-
Yes, you are right, it has to be lowercase e, now it works like a charm Thank you all for help! Final product: function enterVehicle ( theVehicle, seat, jacked ) if isPedInVehicle (source) and getElementModel (theVehicle) == 478 then setVehicleHandling(theVehicle, "mass", 1050.0) setVehicleHandling(theVehicle, "turnMass", 2000.0) setVehicleHandling(theVehicle, "dragCoeff", 3.3) setVehicleHandling(theVehicle, "centerOfMass", { 0.0, 0.1, -0.25 } ) setVehicleHandling(theVehicle, "percentSubmerged", 75) setVehicleHandling(theVehicle, "tractionMultiplier", 0.65) setVehicleHandling(theVehicle, "tractionLoss", 0.85) setVehicleHandling(theVehicle, "tractionBias", 0.5) setVehicleHandling(theVehicle, "numberOfGears", 4) setVehicleHandling(theVehicle, "maxVelocity", 130.0) setVehicleHandling(theVehicle, "engineAcceleration", 8.0) setVehicleHandling(theVehicle, "engineInertia", 3.0) setVehicleHandling(theVehicle, "driveType", "rwd") setVehicleHandling(theVehicle, "engineType", "petrol") setVehicleHandling(theVehicle, "brakeDeceleration", 6.5) setVehicleHandling(theVehicle, "brakeBias", 0.5) setVehicleHandling(theVehicle, "ABS", false) setVehicleHandling(theVehicle, "steeringLock", 35.0) setVehicleHandling(theVehicle, "suspensionForceLevel", 1.15) setVehicleHandling(theVehicle, "suspensionDamping", 0.1) setVehicleHandling(theVehicle, "suspensionHighSpeedDamping", 0.0) setVehicleHandling(theVehicle, "suspensionUpperLimit", 0.14) setVehicleHandling(theVehicle, "suspensionLowerLimit", -0.1) setVehicleHandling(theVehicle, "suspensionFrontRearBias", 0.55) setVehicleHandling(theVehicle, "suspensionAntiDiveMultiplier", 0.3) setVehicleHandling(theVehicle, "seatOffsetDistance", 0.25) setVehicleHandling(theVehicle, "collisionDamageMultiplier", 0.70) setVehicleHandling(theVehicle, "modelFlags", 0x40002804) setVehicleHandling(theVehicle, "handlingFlags", 0x4000001) setVehicleHandling(theVehicle, "headLight", long) setVehicleHandling(theVehicle, "tailLight", small) setVehicleHandling(theVehicle, "animGroup", 1) --outputChatBox("Handling changed successfully !") end end addEventHandler ( "onPlayerVehicleEnter", getRootElement(), enterVehicle )
-
I restarted MTA, and none of scripts from my previous post actually apply handling changes... What do I have to do to reload my script when testing? Anyway, as you asked, function enterVehicle ( theVehicle, seat, jacked ) if isPedInVehicle (source) then outputChatBox(tostring(setVehicleHandling(theVehicle, "EngineAcceleration", 40))) end end addEventHandler ( "onPlayerVehicleEnter", getRootElement(), enterVehicle ) returns false
-
I don't really want to edit server files, I just need a 'standalone' resource which would only be used in one race map, edited and used in another, eventually. onPlayerSpawn Does not work, kinda... I made this script: function player_Spawn ( posX, posY, posZ, spawnRotation, theTeam, theSkin, theInterior, theDimension ) outputChatBox("SPAWNED") if isPedInVehicle (source) then outputChatBox("IN CAR") setModelHandling(504, "EngineAcceleration", 40) end end addEventHandler ( "onPlayerSpawn", getRootElement(), player_Spawn ) When I start the race, I got 'SPAWNED' message and my handling is changed, but it don't says 'IN CAR' as if the player was not in a car. So... why is handling applied? So, I tried removing isPedInVehicle check: function player_Spawn ( posX, posY, posZ, spawnRotation, theTeam, theSkin, theInterior, theDimension ) outputChatBox("SPAWNED") --if isPedInVehicle (source) then outputChatBox("IN CAR") setModelHandling(504, "EngineAcceleration", 40) --end end addEventHandler ( "onPlayerSpawn", getRootElement(), player_Spawn ) I got both messages and custom handling. Died, respawned, again both messages, but no handling. Next i tried with onPlayerVehicleEnter function enterVehicle ( theVehicle, seat, jacked ) outputChatBox("ENTERED") if isPedInVehicle (source) then outputChatBox("IN CAR") setVehicleHandling(theVehicle, "EngineAcceleration", 40) end end addEventHandler ( "onPlayerVehicleEnter", getRootElement(), enterVehicle ) Result: same as script above - I got both messages and custom handling. Died, respawned, again both messages, but no handling. So now the main question of this tread is going to be: what function is used by race gamemode to 'respawn' players in cars after they die, and what event should i listen to to execute handling change? Alternatively, I think about to make my script change handling to every players' car every second, so when a player dies and respawns, after 1 second my handling would be back. (This feels like the marker-on-every-checkpoint-poor-idea one )
-
Hi! I have a problem making a script with custom vehicle handling for race gamemode. I made a script that uses setModelHandling (also tried setVehicleHandling) and onResourceStart. It works, but when a player dies and respawns, the handling of his vehicle restores back to default. I don't know if I should somehow force the handling change to be permanent on resource start or if I should somehow make these changes apply everytime a player respawns? One solution i think of was to make an invisible marker on every checkpoint, and make setVehicleHandling onMarkerHit (which i managed to succesfully write), but it feels like a dumb solution and i know it can be done more efficient by good scripting. I tried using onClientPlayerSpawn, which is client side, and setVehicleHandling appears to be server side. I have no idea yet how to connect scripts like that, but I'm still learning. My tuning on marker hit script: function tuning(hitMarker, matchingDimension) if (matchingDimension) then local theVehicle = getPedOccupiedVehicle(source) if theVehicle then outputChatBox ("Tuned!") setVehicleHandling(theVehicle, "engineAcceleration", 35.0) end end end addEvent("onPlayerMarkerHit", true) addEventHandler("onPlayerMarkerHit", getRootElement(), tuning) My handling test script: function handlingChange ( ) setVehicleHadling(504, "EngineAcceleration", 35.0) end addEventHandler ( "onPlayerSpawn", getLocalPlayer(), handlingChange ) TL;DR How to keep starting handling changes after player respawn in a race gamemode? I'm a scripting beginner, please be nice to me! Any help will be appreciated!
-
Not good for me. I cant exit my starting vehicle, and other created vehs are non-colidable Any solutions? Edit: Ok, I got it Just needed to learn some scripting basics, using Play and Freeroam resources and my noobish server (based on standard, downloaded and modified resources) is on. Thanks for replies
-
Ok, now I know how to make race but what with freeroam? Maybe I should not make any checkpoints? But wouldn't it be a DM then? Would be possible to exit or enter other vehs?
-
I tried but all I found is thousant vids showin basics, like how to place an object or how to convert map to samp Do I have to place objecst and then edit the maps script?
-
Hi all, I've made lots of maps in Race Mod map editor. The new editor seems to be more powerfull tool, but it's a little too complicated Can someone please tell me, step by step, how to make a simple freeroam map, like in old Race Mode editor? I want to know how to configure maps settings, how to place a simple spawnpoint, what resources do I need to make my map playable and how to load my map into my lan server. I'm kinda noob now, but i learn fast Thanks.