Sign in to follow this  
Robbster

Fix Vehicle

Recommended Posts

This script is supposed to bassically, it checks if your in a vehicle and if you are it fixes it, if your not in a vehicle it tells you.

Problem is i'm in a vehicle and get the message saying I'm not in a vehicle, no debug errors

UKMarker = createMarker ( -2079.88, 2099.58, 15.5,"cylinder",7.0,255,255,0,125) 
function fixUK ( hitPlayer, matchingDimension ) 
    if ( hitPlayer == localPlayer ) then 
local vehicle = getPedOccupiedVehicle ( thePlayer ) 
    if vehicle then 
            fixVehicle ( vehicle ) 
            outputChatBox ( "Your vehicle was fixed!", player, 0, 255, 0 ) 
        else 
            outputChatBox ( "You need to be in a vehicle!", player, 255, 0, 0 ) 
    end 
    end 
end 
addEventHandler ( "onClientMarkerHit", UKMarker, fixUK ) 

Edited by Guest

Share this post


Link to post
local vehicle = getPedOccupiedVehicle ( thePlayer ) 

You are trying to get the vehicle from the wrong argument, your argument is "hitPlayer".

Share this post


Link to post

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
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.