[DemoN] Posted June 10, 2011 Posted June 10, 2011 function ejectTarget (source, command, targetPlayer) if isPedInVehicle(targetPlayer) then removePedFromVehicle(targetPlayer) else outputChatBox("Target is not in a vehicle.", source, 255, 255, 255, true) end end addCommandHandler ( "eject", getRootElement() ejectPlayer ) It says: Bad argument @ isPedInVehicle I don't know what to do...
Castillo Posted June 10, 2011 Posted June 10, 2011 function ejectTarget (source, command, who) local targetPlayer = getPlayerFromName(who) if not targetPlayer then outputChatBox("This player doesn't exist",source,255,0,0) return end if isPedInVehicle(targetPlayer) then removePedFromVehicle(targetPlayer) else outputChatBox("Target is not in a vehicle.", source, 255, 255, 255, true) end end addCommandHandler ( "eject", getRootElement() ejectPlayer )
[DemoN] Posted June 10, 2011 Author Posted June 10, 2011 function ejectTarget (source, command, who) local targetPlayer = getPlayerFromName(who) if not targetPlayer then outputChatBox("This player doesn't exist",source,255,0,0) return end if isPedInVehicle(targetPlayer) then removePedFromVehicle(targetPlayer) else outputChatBox("Target is not in a vehicle.", source, 255, 255, 255, true) end end addCommandHandler ( "eject", getRootElement() ejectPlayer ) Oh Thanks Castillo.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now