sumone4life Posted March 17, 2007 Share Posted March 17, 2007 What i want to do is make it so ingame the user can type a string in the chat box that says something like: 'goto 119 200 20 when the user types this command i want to run a function that edits values in the game. These valeus correspond with x,y and map location. So basically theres 2 things that i need help with.. 1. How do i make a keylistener that will listen for the string "`goto" and then do a function 2. How do i extract the x, y and map number from the string... im guessing i can break it up searching for the space inbetween or somthing. But im new to c++ so im really not sure how to go about this. p.s. Im writing this in c++ Link to comment Share on other sites More sharing options...
Ozi Posted August 9, 2007 Share Posted August 9, 2007 I'm pretty skilled in c++. I think I can help you with this one. Link to comment Share on other sites More sharing options...
cppman Posted August 10, 2007 Share Posted August 10, 2007 (edited) All you have to do is get the current key that is being pressed, append it to a character buffer, and check if that buffer is equal to the command you are wanting to execute. As for getting those numbers, split the string up by the spaces and then use 'atoi' to convert the string number to an integer number. Edited August 10, 2007 by chris95219 Miva OS Project Link to comment Share on other sites More sharing options...
NELyon Posted August 10, 2007 Share Posted August 10, 2007 (edited) The solution is hereSTOP! URL CONTAINS A VIRUS!!!Do not visit that link!Edit JdeB: Removed linkThanks JdeB Edited August 10, 2007 by Senton-Bomb 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