Jump to content

Bad Arg. Fix Veh And GetPedOccVeh


Recommended Posts

Well The Title Says All

function fixplayerveh(player, command, target) 
    local isveh = getPedOccupiedVehicle(target) 
    local targetPlayer = getPlayerFromNamePart( target ) 
    if ( hasObjectPermissionTo ( player, "function.aexec" ) ) then 
    if not isveh then 
    if target then 
    fixVehicle(target) 
    else 
    outputChatBox("SYNTAX: /fixveh [Player]",player , 255, 194, 14) 
      end 
      else 
      outputChatBox("The player is not in a vehicle.", player, 255, 0, 0) 
    end 
  end 
end 
addCommandHandler("fixveh", fixplayerveh) 

Link to comment
function fixplayerveh(player, command, target) 
     if (hasObjectPermissionTo(player, "function.aexec")) then 
          local targetPlayer = getPlayerFromNamePart(target) 
          if target and targetPlayer then 
               local veh = getPedOccupiedVehicle(targetPlayer) 
               if veh then 
                    fixVehicle(veh) 
               else 
                    outputChatBox("The player is not in a vehicle.",player,255,0,0) 
               end 
          else 
               outputChatBox("SYNTAX: /fixveh [Player]",player,255,194,14) 
          end 
     else 
          outputChatBox("You don't have Permission.",player,255,0,0) 
     end 
end 
addCommandHandler("fixveh", fixplayerveh) 

Edited by Guest
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...