alex_shorin97 Posted January 19, 2014 Share Posted January 19, 2014 (edited) Hi guys! My problem is that my character stops walking when he is getting closer to waypoint on foot HELP///please! Imports System Imports GTAImports System.Windows.Forms Public Class tmpScriptInherits ScriptPublic Sub New() Me.interval = 10End Sub private sub msg(sMsg as string, time as int32) Native.Function.Call("PRINT_STRING_WITH_LITERAL_STRING_NOW", "STRING", sMsg, time, 1)end subPrivate Sub keyDown(ByVal sender As Object, ByVal e As GTA.KeyEventArgs) Handles MyBase.KeyDown if (e.key = keys.d1) then if not exists(player.character.currentvehicle) then msg("you need a car...", 2000) exit sub end if Game.LoadAllPathNodes = True dim wayPoint as blip = game.getwaypoint if exists(wayPoint) then player.character.task.driveto(wayPoint.position, 13.0, true) else msg("set the waypoint...", 2000) end if end if if (e.key = keys.d2) then if not exists(player.character.currentvehicle) then msg("you need a car...", 2000) exit sub end if Game.LoadAllPathNodes = True dim wayPoint as blip = game.getwaypoint if exists(wayPoint) then player.character.task.driveto(wayPoint.position, 26.0, false) else msg("set the waypoint...", 2000) end if end if if (e.key = keys.d3) then player.character.task.wait(0) end if if (e.key = keys.d4) then Game.LoadAllPathNodes = true dim wayPoint as blip = game.getwaypoint if exists(wayPoint) then player.character.task.goto(wayPoint.position) else msg("set the waypoint...", 2000) end if end if if (e.key = keys.d5) then Game.LoadAllPathNodes = True dim wayPoint as blip = game.getwaypoint if exists(wayPoint) then player.character.task.runto(wayPoint.position) else msg("set the waypoint...", 2000) end if end ifEnd SubEnd Class Edited January 19, 2014 by alex_shorin97 Link to comment Share on other sites More sharing options...
Rugz007 Posted April 26, 2014 Share Posted April 26, 2014 How Many Closer? Link to comment Share on other sites More sharing options...
pedro2555 Posted April 26, 2014 Share Posted April 26, 2014 Most likely another actions overrides your's. Your code looks a bit messy to be honest, but you should try to keep checking if the player reached his destination, if it didn't then Goto(). That way you are safe that the player will try to reach the destination. Link to comment Share on other sites More sharing options...
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