Jump to content

Create vehicle


-Doc-

Recommended Posts

Posted

How i can make a script? For example i type /cv bug or bugatti and it should create 496(blista compact) or get vehicle name from part

Posted

What do you mean?

  
addCommandHandler("cv", function (player, _, arg1) 
   if tostring(arg1) then 
        veh = getVehicleModelFromName(arg1) 
               if veh then 
                   createVehicle(veh,unpack( {getElementPosition ( player ) } ) ) 
               else 
                   outputChatBox("wrong name", player) 
               end 
   else 
     if tonumber(arg1) then 
         createVehicle(arg1,unpack( {getElementPosition ( player ) } ) ) 
     end 
   end 
end 
) 
  

Posted
But at weapons?

Not to be mean, but you flamed a topic saying that your server is the best and that you are a good scripter, but you keep making topics asking for scripts, but you don't even try... I am not the only one telling you this -.-

Posted
Im asking where i dont know

Once you learn how to properly navigate the MTA Wiki, you'll be able to solve simple issues like these all by yourself.

What you're looking for is to take Tomas's example and modify it so you can give yourself a weapon instead, so, you'll want to look under weapon functions, wham, there you have getWeaponIDFromName.

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