Tockra Posted July 17, 2010 Posted July 17, 2010 Hi guys, i use this code: function OnPlayerConnect() bindKey ( "u", "both", botMove ) bindKey ( "k", "both", rechts ) bindKey ( "h", "both", links ) bindKey ( "j", "both", back ) end addEventHandler( "onClientResourceStart", getResourceRootElement(getThisResource()), OnPlayerConnect) function botMove(key,keystate) bot = getElementByID ( "bot" ) if(keystate == "down") then setPedControlState ( bot, "forwards", true ) elseif(keystate == "up") then setPedControlState ( bot, "forwards", false ) end end function rechts(key,keystate) if(keystate == "down") then setPedControlState ( bot, "vehicle_right", true ) elseif(keystate == "up") then setPedControlState ( bot, "vehicle_right", false ) end end function links(key,keystate) if(keystate == "down") then setPedControlState ( bot, "vehicle_left", true ) elseif(keystate == "up") then setPedControlState ( bot, "vehicle_left", false ) end end function back(key,keystate) if(keystate == "down") then setPedControlState ( bot, "backwards", true ) elseif(keystate == "up") then setPedControlState ( bot, "backwards", false ) end end h and k run but u and j dont run...
50p Posted July 17, 2010 Posted July 17, 2010 Because you use wrong control names. Forwards and backwards are for peds who are not in vehicles. For peds inside vehicle use "accelerate" and "brake_reverse".
Tockra Posted July 17, 2010 Author Posted July 17, 2010 Thank... Know someone how i can caliculate perfect curves ? The ped shall drive a curve and shall on the right street site after the curve ...
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