Jump to content

Vehicle plate


xyz

Recommended Posts

function plate(player, cmdName, text) 
local acc = getPlayerAccount(player) 
local accn = getAccountName(acc) 
    local occveh = getPedOccupiedVehicle(player) 
        if occveh then 
            if getElementData(occveh, "vehsAcc") == accn and text then -- This checks if the vehicle is the player's personal veh. If you're wondering 
                setVehiclePlateText(occveh, text) 
                outputChatBox("Plate text changed!", player, 0, 255, 0) 
                    else 
                end 
                    outputChatBox("This isn't your personal vehicle!", player, 255, 0, 0)    
                        else 
                    outputChatBox("You must be in a vehicle to change the plate!", player,  255, 0, 0) 
            end 
end 
addCommandHandler("plate", plate) 

The problem is, that when everything is correct it still outputs "You must be in a vehicle to change the plate!", how can I fix that?

Link to comment
function plate(player, cmdName, text) 
local acc = getPlayerAccount(player) 
local accn = getAccountName(acc) 
    local occveh = getPedOccupiedVehicle(player) 
        if occveh then 
            if getElementData(occveh, "vehsAcc") == accn and text then -- This checks if the vehicle is the player's personal veh. If you're wondering 
                setVehiclePlateText(occveh, text) 
                outputChatBox("Plate text changed!", player, 0, 255, 0) 
             else 
                    outputChatBox("This isn't your personal vehicle!", player, 255, 0, 0)    
            end  
          else 
                 outputChatBox("You must be in a vehicle to change the plate!", player,  255, 0, 0) 
           end 
end 
addCommandHandler("plate", plate) 

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