idiot Posted January 25, 2008 Share Posted January 25, 2008 Hi, would it be possible that someone makes a "teleport" script? I mean that the client only must write "/s1" (just an example of what I dream ) to save his position. And if he pushes the "1" on the keyboard he spawns at the "/s1"-position. Then 1-9 that each client can save a few personal positions. When the client writes "/s1" again the old position should be overwritten for the new one. If it shouldn't work to spawn by pushing 1-9 it would be also okay with typing "/l1" (1-9). Simple example: Player:/s7 Console:Position 7 saved! Type ' /l7 ' to spawn. Player:/l7 Console:Position 7 loaded! You spawned. Type ' /s7 ' again to overwrite. greetz ruschiiiii Link to comment
Woovie Posted January 26, 2008 Share Posted January 26, 2008 Very possible. Alot of code to write though =P Link to comment
50p Posted January 26, 2008 Share Posted January 26, 2008 Not much really. I've got it "almost" working. Almost because players are elements and it is quite difficult to store all the coords in an array. In SA:MP, players are integers, so it would be really easy there. I'm trying to figure out how to store players' coords in a table and then load them. Link to comment
eAi Posted January 26, 2008 Share Posted January 26, 2008 You can use elements to index tables, just like you would use an integer to index an array: local teleportPoints = {} local x,y,z = getElementPosition(player) teleportPoints[player][0].x = x teleportPoints[player][0].y = y teleportPoints[player][0].z = z Alternatively, you can just use setElementData. Link to comment
50p Posted January 26, 2008 Share Posted January 26, 2008 *post deleted* EDIT: I got it working now. Look here. 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