Jump to content

Team Vehicles


Mike269

Recommended Posts

Hello guys, I know that most of you will say that you're just helping us and you wont make scripts for us but I just need help how could I spawn cars for team only like if my team name is NAVY I could use command /create infernus NAVY

or something like that, would be very cool if anyone could help me with that, thanks!

Link to comment

you can use somethin' like this:

function spawnCar(thePlayer, command) 
    local x,y,z = getElementPosition(thePlayer) 
    local playerTeam = getPlayerTeam(thePlayer) 
    if playerTeam then 
        local teamName = getTeamName(playerTeam) 
        if ( teamName == "NAVY" ) then 
        car = createVehicle(411, x,y,z) 
        warpPedIntoVehicle(thePlayer, car)       
        else 
        outputChatBox("You're not part of NAVY team!", thePlayer, 255, 0, 0, false)  
        end 
    end 
  
end 
addCommandHandler("spawnc", spawnCar) 

check it out https://wiki.multitheftauto.com/

Link to comment

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...