Jump to content

IulyanNek

Members
  • Posts

    5
  • Joined

  • Last visited

Details

  • Gang
    Neculai Gaming

IulyanNek's Achievements

Vic

Vic (3/54)

0

Reputation

  1. IulyanNek

    Vehicle handling

    Hi everyone, I hope somebody can help me with a script. I have a problem with a vehicle handling script. It's works perfectly, but if i have to restart the server, handling on made cars disappear ( roleplay server with mysql db, so permanents cars), but if i create a new car, handling works perfectly. How can i do a function that set's handling to all vehicles on the server by model? Or can i fix this one? Or have anybody another resource that set's custom handling to all cars on the server? This is the handling script, i have a complect resource for mods if you want to see... handlingProperties = { "identifier", "mass", "turnMass", "dragCoeff", "centerOfMassX", "centerOfMassY", "centerOfMassZ", "percentSubmerged", "tractionMultiplier", "tractionLoss", "tractionBias", "numberOfGears", "maxVelocity", "engineAcceleration", "engineInertia", "driveType", "engineType", "brakeDeceleration", "brakeBias", "ABS", "steeringLock", "suspensionForceLevel", "suspensionDamping", "suspensionHighSpeedDamping", "suspensionUpperLimit", "suspensionLowerLimit", "suspensionFrontRearBias", "suspensionAntiDiveMultiplier", "seatOffsetDistance", "collisionDamageMultiplier", "monetary", "modelFlags", "handlingFlags", "headLight", "tailLight", "animGroup" } function setHandling ( model, property, value ) if not isHandlingPropertySupported ( property ) then return false end if isHandlingPropertyCorrectable ( property ) then value = getCorrectedHandlingValue ( value ) elseif isHandlingPropertyHexadecimal ( property ) then value = tonumber ( "0x" .. value ) else value = tonumber ( value ) if isHandlingPropertyCenterOfMass ( property ) then local com = getModelHandling ( model )["centerOfMass"] local axis = property property = "centerOfMass" if axis == "centerOfMassX" then value = { value, com[2], com[3] } elseif axis == "centerOfMassY" then value = { com[1], value, com[3] } elseif axis == "centerOfMassZ" then value = { com[1], com[2], value } end end end if not setModelHandling ( model, property, value ) then outputDebugString ( tostring(property) ) end return true end function isHandlingPropertySupported ( property ) local unsupported = { ["ABS"]=true, ["monetary"]=true, ["headLight"]=true, ["tailLight"]=true, ["animGroup"]=true } if unsupported[property] then return false end return true end function isHandlingPropertyCorrectable ( property ) local props ={ ["driveType"]=true, ["engineType"]=true, ["headLight"]=true, ["tailLight"]=true } return props[property] or false end function isHandlingPropertyCenterOfMass ( property ) local props = { ["centerOfMassX"]=true, ["centerOfMassY"]=true, ["centerOfMassZ"]=true } return props[property] or false end function isHandlingPropertyHexadecimal ( property ) if property == "modelFlags" or property == "handlingFlags" then return true end return false end local correctedValues = { ["f"] = "fwd", ["r"] = "rwd", ["4"] = "awd", ["p"] = "petrol", ["d"] = "diesel", ["e"] = "electric", ["0"] = "long", ["1"] = "small", ["3"] = "big", } function getCorrectedHandlingValue ( value ) return correctedValues[string.lower(value)] or "big" -- as 3 cant be converted to 'tall', we use 'big' end
  2. Acest script seteaza Handlingul la masinile pe care le vei face, cum as putea sa il modific sa seteze handling si la masinile deja facute? Asa in caz ca dau restart la sv, pot seta iar handlingul la toate masinile, si numai am nevoie sa il salveze nicaieri, ca sa numai intru sa modific baza de date. Ce zici D&G?
  3. Works, but if i have to restart the server, handling on permanent cars disappear, and i have to make a new car ..
  4. Salut, am nevoie de ajutor cu un script asa ca ma adresez la scripterii romani care sigur au rezolvat aceasta problema. Am o resursa de moduri, (masini modate) si am o problema cu scriptul de Handling, functioneaza tot perfect, dar daca sunt nevoit pt orice motiv sa dau Restart la Server, dispare handlingul de pe masinile facute inaintea restartului, daca creez o masina noua se face cu tot cu handling. Stiti cumva cum pot sa rezolv problema cu restartul sau este o alta resursa pe care o pot folosi? Va multumesc . Acesta este scriptul pt handling: handlingProperties = { "identifier", "mass", "turnMass", "dragCoeff", "centerOfMassX", "centerOfMassY", "centerOfMassZ", "percentSubmerged", "tractionMultiplier", "tractionLoss", "tractionBias", "numberOfGears", "maxVelocity", "engineAcceleration", "engineInertia", "driveType", "engineType", "brakeDeceleration", "brakeBias", "ABS", "steeringLock", "suspensionForceLevel", "suspensionDamping", "suspensionHighSpeedDamping", "suspensionUpperLimit", "suspensionLowerLimit", "suspensionFrontRearBias", "suspensionAntiDiveMultiplier", "seatOffsetDistance", "collisionDamageMultiplier", "monetary", "modelFlags", "handlingFlags", "headLight", "tailLight", "animGroup" } function setHandling ( model, property, value ) if not isHandlingPropertySupported ( property ) then return false end if isHandlingPropertyCorrectable ( property ) then value = getCorrectedHandlingValue ( value ) elseif isHandlingPropertyHexadecimal ( property ) then value = tonumber ( "0x" .. value ) else value = tonumber ( value ) if isHandlingPropertyCenterOfMass ( property ) then local com = getModelHandling ( model )["centerOfMass"] local axis = property property = "centerOfMass" if axis == "centerOfMassX" then value = { value, com[2], com[3] } elseif axis == "centerOfMassY" then value = { com[1], value, com[3] } elseif axis == "centerOfMassZ" then value = { com[1], com[2], value } end end end if not setModelHandling ( model, property, value ) then outputDebugString ( tostring(property) ) end return true end function isHandlingPropertySupported ( property ) local unsupported = { ["ABS"]=true, ["monetary"]=true, ["headLight"]=true, ["tailLight"]=true, ["animGroup"]=true } if unsupported[property] then return false end return true end function isHandlingPropertyCorrectable ( property ) local props ={ ["driveType"]=true, ["engineType"]=true, ["headLight"]=true, ["tailLight"]=true } return props[property] or false end function isHandlingPropertyCenterOfMass ( property ) local props = { ["centerOfMassX"]=true, ["centerOfMassY"]=true, ["centerOfMassZ"]=true } return props[property] or false end function isHandlingPropertyHexadecimal ( property ) if property == "modelFlags" or property == "handlingFlags" then return true end return false end local correctedValues = { ["f"] = "fwd", ["r"] = "rwd", ["4"] = "awd", ["p"] = "petrol", ["d"] = "diesel", ["e"] = "electric", ["0"] = "long", ["1"] = "small", ["3"] = "big", } function getCorrectedHandlingValue ( value ) return correctedValues[string.lower(value)] or "big" -- as 3 cant be converted to 'tall', we use 'big' end
×
×
  • Create New...