Jump to content

Locking script for the team


Unique23

Recommended Posts

Posted
function speedup ( thePlayer ) 
    if ( getTeamName ( getPlayerTeam ( thePlayer ) ) == "Unique" ) and ( getElementModel ( source ) == 470 ) then 
        local handlingTable = getVehicleHandling ( source ) 
        local newVelocity = ( handlingTable [ "maxVelocity" ] + ( handlingTable [ "maxVelocity" ] / 100 * 200 ) ) 
        setVehicleHandling ( source, "numberOfGears", 5 ) 
        setVehicleHandling ( source, "driveType", 'awd' ) 
        setVehicleHandling ( source, "maxVelocity", newVelocity ) 
        setVehicleHandling ( source, "engineAcceleration", handlingTable [ "engineAcceleration" ] + 8 ) 
    end 
end 
addEventHandler ( "onVehicleEnter", root, speedup ) 

Errors I found:

1: You put the event handler inside the function.

2: You had one extra 'end'.

3: You were using getElementType for the wrong purpose.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

@Solidsnake

I'd like to thank you again but I have a problem with the script.

It sometimes works , sometimes doesn't work plus I want to do it for all vehicles(except Boats and Airplanes)

Posted

Well, you restricted it to the vehicle model 470, have you removed this restriction?

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

If you want it to work for every vehicle, you must remove it.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted
  
function speedup ( thePlayer ) 
    if ( getTeamName ( getPlayerTeam ( thePlayer ) ) == "Unique" ) and ( getElementModel ( source ) == )  then 
        local handlingTable = getVehicleHandling ( source ) 
        local newVelocity = ( handlingTable [ "maxVelocity" ] + ( handlingTable [ "maxVelocity" ] / 100 * 700 ) ) 
        setVehicleHandling ( source, "numberOfGears", 5 ) 
        setVehicleHandling ( source, "driveType", 'awd' ) 
        setVehicleHandling ( source, "maxVelocity", newVelocity ) 
        setVehicleHandling ( source, "engineAcceleration", handlingTable [ "engineAcceleration" ] + 8 ) 
    end 
end 
addEventHandler ( "onVehicleEnter", root, speedup ) 
  
  

Okay, It gives error

Unexpected symbol near ')'

Posted
      
    function speedup ( thePlayer ) 
        if ( getTeamName ( getPlayerTeam ( thePlayer ) ) == "Unique" ) then 
            local handlingTable = getVehicleHandling ( source ) 
            local newVelocity = ( handlingTable [ "maxVelocity" ] + ( handlingTable [ "maxVelocity" ] / 100 * 700 ) ) 
            setVehicleHandling ( source, "numberOfGears", 5 ) 
            setVehicleHandling ( source, "driveType", 'awd' ) 
            setVehicleHandling ( source, "maxVelocity", newVelocity ) 
            setVehicleHandling ( source, "engineAcceleration", handlingTable [ "engineAcceleration" ] + 8 ) 
        end 
    end 
    addEventHandler ( "onVehicleEnter", root, speedup ) 
      
      

#~BlackBird~#

Posted

@mint3d

  
function speedup ( thePlayer ) 
    if ( getTeamName ( getPlayerTeam ( thePlayer ) ) == "Unique" ) and ( getElementModel ( source ) == )  then 
        local handlingTable = getVehicleHandling ( source ) 
        local newVelocity = ( handlingTable [ "maxVelocity" ] + ( handlingTable [ "maxVelocity" ] / 100 * 700 ) ) 
        setVehicleHandling ( source, "numberOfGears", 5 ) 
        setVehicleHandling ( source, "driveType", 'awd' ) 
        setVehicleHandling ( source, "maxVelocity", newVelocity ) 
        setVehicleHandling ( source, "engineAcceleration", handlingTable [ "engineAcceleration" ] + 8 ) 
    end 
end 
addEventHandler ( "onVehicleEnter", root, speedup ) 
  

It says:

ERROR:Loading script failed: Enes\speed.lua:3: unexpected symbol near ')'

Posted

Try (not tested)

function speedup ( thePlayer ) 
    if ( getTeamName ( getPlayerTeam ( thePlayer ) ) == "Unique" )  then 
        local handlingTable = getVehicleHandling ( source ) 
        local newVelocity = ( handlingTable [ "maxVelocity" ] + ( handlingTable [ "maxVelocity" ] / 100 * 700 ) ) 
        setVehicleHandling ( source, "numberOfGears", 5 ) 
        setVehicleHandling ( source, "driveType", 'awd' ) 
        setVehicleHandling ( source, "maxVelocity", newVelocity ) 
        setVehicleHandling ( source, "engineAcceleration", handlingTable [ "engineAcceleration" ] + 8 ) 
    end 
end 
addEventHandler ( "onVehicleEnter", root, speedup ) 

Multi Theft Auto Player since middle of 2011.

Everybody want to act Crazy/Smart/Intelligent/Different/Unique/Innocent and Thats why I am Perfect.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...