Jump to content

[RACE]Commands Help


gytisan

Recommended Posts

function repairVeh( thePlayer ) 
   local theVehicle = getPedOccupiedVehicle ( thePlayer ) 
----i don't know what max health is so i made it 1000 
setElementHealth(theVehicle,1000) 
takePlayerMoney(500) 
end 
addCommandHandler("repair",repairVeh) 

function addNitro( thePlayer ) 
local theVehicle = getPedOccupiedVehicle ( thePlayer ) 
addVehicleUpgrade(theVehicle, 1010) 
takePlayerMoney(500) 
end 
addCommandHandler("nitro",addNitro) 

Better, lol.

|

|

|

\/

Edited by Guest
Link to comment
function repairVehicle(thePlayer) 
   local veh = getPedOccupiedVehicle(thePlayer) 
   local money = getPlayerMoney(thePlayer) 
    if (money < 500) then 
       outputChatBox("You don't have money!",thePlayer,255,0,0,true) 
    else 
       setElementHealth(veh,1000) 
       takePlayerMoney(thePlayer,500) 
     end 
  end 
end 
addCommandHandler('repair',repairVehicle) 

function addNitro(thePlayer) 
    local theveh = getPedOccupiedVehicle(thePlayer) 
    local money = getPlayerMoney(thePlayer) 
     if (money < 500) then 
       outputChatBox("You don't have money!",thePlayer,255,0,0,true) 
     else 
       addVehicleUpgrade(theveh,1010) 
       takePlayerMoney(thePlayer,500) 
     end 
  end 
end 
addCommandHandler('nitro',addNitro) 
  

Link to comment
takeMoney = function( player,cash ) 
    if getPlayerMoney ( player ) >= tonumber( cash ) then 
        return takePlayerMoney ( player,cash ) 
    end 
    return false 
end 
  
errorOutput = function( text,player ) 
    return outputChatBox( text,player,255,0,0 ) 
end  
  
addCommandHandler( 'nitro', 
    function( player ) 
        local veh = getPedOccupiedVehicle( player ) 
        if veh then 
            if takeMoney( player,500 ) then 
                addVehicleUpgrade( veh,1010 ) 
            else 
                errorOutput ( "You don't have money!",player ) 
            end 
        end 
    end 
)    
  
addCommandHandler( 'flip', 
    function( player ) 
        local veh = getPedOccupiedVehicle( player ) 
        if veh then 
            if takeMoney( player,500 ) then 
                setElementRotation( veh,0,0,0 ) 
            else 
                errorOutput ( "You don't have money!",player ) 
            end 
        end 
    end 
)    
  
addCommandHandler( 'repair', 
    function( player ) 
        local veh = getPedOccupiedVehicle( player ) 
        if veh then 
            if takeMoney( player,500 ) then 
                setElementHealth( veh,1000 ) 
            else 
                errorOutput ( "You don't have money!",player ) 
            end 
        end 
    end 
)    
  

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