[Tutorial] Position saver and loader [With pictures & video]
#4

Quote:
Originally Posted by biker122
Посмотреть сообщение
Well done, but still you could've done it with ZCMD.
Indeed but I've kind of aimed this towards new scripters and didn't want to get into includes and stuff.

Quote:
Originally Posted by Vince
Посмотреть сообщение
The tutorial is neatly structured and very well written but quite outdated and very hard to maintain.

Use a three dimensional array instead.

pawn Код:
enum { x, y, z } // just for convenience
new Float:position[MAX_PLAYERS][3][3];
pawn Код:
GetPlayerPos(playerid, position[playerid][0][x], position[playerid][0][y], position[playerid][0][y]);
You could then also create your list ("Save to position x") with a loop and use the corresponding response directly. This means that if you were to add more positions you would only have to change one (1) single number instead of altering code in three or four different places.
You're right I could have done this in a much more convenient way by the method you showed and also other things but I chose not to since that propably be too much to explain to a newbie.
Also another flaw in the script is that you could use the /pos[1-3] command without even having saved a position there and you would (propably) be teleported to 0, 0, 0.
These problems could all be fixed easily but would overwhelm a junior scripter.

Thanks for your feedback, both!
Reply


Messages In This Thread
Position saver and loader [With pictures & video] - by Sellize - 08.03.2015, 10:47
Re: Position saver and loader [With pictures & video] - by biker122 - 08.03.2015, 11:40
Re: Position saver and loader [With pictures & video] - by Vince - 08.03.2015, 12:18
Re: Position saver and loader [With pictures & video] - by Sellize - 08.03.2015, 12:35
Re: Position saver and loader [With pictures & video] - by Vince - 08.03.2015, 15:13

Forum Jump:


Users browsing this thread: 1 Guest(s)