[DemoN] Posted June 10, 2011 Share 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... Link to comment
Castillo Posted June 10, 2011 Share 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 ) Link to comment
[DemoN] Posted June 10, 2011 Author Share 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. Link to comment
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