Jump to content

/makeveh


Recommended Posts

and it's so simple

do like this

function anything( player, commandName ) 
    if not isPedInVehicle ( player ) then -- checks if the player is already in a vehicle 
        local color = {} -- table of random colors  
        color[1] = math.random(1,126) -- color 1 
        color[2] = math.random(0,126) -- color 2 
        color[3] = math.random(0,126) -- color 3 
        color[4] = math.random(0,126) -- color 4 
            sX, sY, sZ = getElementPosition ( player ) -- gets the player's position 
                blade = createVehicle ( 536, sX, sY, sZ ) -- create a vehicle "536" you can change it whatever you like  
                    warpPedIntoVehicle ( player, blade ) -- warp him into the car 
                        setVehicleColor ( blade, color[1], color[2], color[3], color[4] ) -- sets the vehicle random colors 
                        outputChatBox("Blade has been spawned",getRootElement(),255,255,0, true) -- outPutChatBox that blade has been spawned 
                        setVehicleDamageProof ( blade, true ) -- sets the car infinity health 
                    else   
                    outputChatBox("you can not spawn a vehicle when you already in one sorry",getRootElement(),255,0,0, true) 
    end 
    end 
end 
    addCommandHandler (  "spawnblade", anything )-- add the command handler which the player will type 

i added some new stuff here like infinity vehicle health

Link to comment

Try this:

    function anything( player, commandName ) 
        if not isPedInVehicle ( player ) then -- checks if the player is already in a vehicle 
            local color = {} -- table of random colors 
            local color[1] = math.random(1,126) -- color 1 
            local color[2] = math.random(0,126) -- color 2 
            local color[3] = math.random(0,126) -- color 3 
            local color[4] = math.random(0,126) -- color 4 
               local sX, sY, sZ = getElementPosition ( player ) -- gets the player's position 
               local blade = createVehicle ( 536, sX, sY, sZ ) -- create a vehicle "536" you can change it whatever you like 
                        warpPedIntoVehicle ( player, blade ) -- warp him into the car 
                         setVehicleColor ( blade, color[1], color[2], color[3], color[4] ) -- sets the vehicle random colors 
                            outputChatBox("Blade has been spawned",player,255,255,0, true) -- outPutChatBox that blade has been spawned 
                            setVehicleDamageProof ( blade, true ) -- sets the car infinity health 
        else   
            outputChatBox("You can not spawn a vehicle when you already in one",player,255,0,0, true) 
        end 
    end 
       addCommandHandler (  "spawnblade", anything )-- add the command handler which the player will type 
  

you had one end too much, and using local variables is usually the best way to go.

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