Kind of teleport command
#1

Hello.

I have been reading about strtok, strcmp etc etc..
But i can't seem to find a solution on how to make this.

What i want to do, is a command similar to this /level [0-10].
An example is, if you type /level 0 you'll get to an underground parking, but if you type /level 2, you'll get to the second level of a building.
And if you just type /level, it sais Usage: /level [0-10].

The command will set player position in different x, y, z and virtual worlds but i know how to do that.

The question is, am i supposed to make a command for all levels, like:
if(strcmp(cmd, "/level 0", true) == 0
SetPlayerPos etc etc
if(strcmp(cmd, "/level 5", true) == 0
SetPlayerPos etc etc..

- Or is it possible to make a more advanced /level command where it finds out what level the person is typing?

Any help is appreciated.


If there is an "advanced command", then please give an example of how it could be for just 2 levels. then i can modify it for several levels.
Thanks alot.

Reply


Messages In This Thread
Kind of teleport command - by Faith - 19.04.2010, 20:56
Re: Kind of teleport command - by cessil - 20.04.2010, 00:32
Re: Kind of teleport command - by Backwardsman97 - 20.04.2010, 03:48
Re: Kind of teleport command - by Faith - 20.04.2010, 04:12

Forum Jump:


Users browsing this thread: 1 Guest(s)