Author Topic: Moveplayer  (Read 1728 times)

0 Members and 1 Guest are viewing this topic.

Offline skrX

  • Soldier
  • **
  • Posts: 112
  • x ye.
Moveplayer
« on: December 18, 2013, 01:26:50 pm »
Script Name: Moveplayer
Script Description: simple mover for admins
Author(s): skrX, DarkCrusade
Core Version: 2.7.6

features:

/move [Id] [direction] [distance]

Code: [Select]
This command will teleport target ID into a certain direction. 7 units for [Distance] are 1 meter in Soldat.

Directions:
Left:    <
Right:    >
Up:    ^
Down:    v

Example: '/move 3 > 70' will move ID 3 10 metres to the right.

/flag [Id] [Team] 

Code: [Select]
Teleport target ID to target object.

Example: '/flag 3 2' will teleport player 3 to Bravo's flag.

/warp [Id]

Code: [Select]
This mean bitch of a command will warp target ID.
credits to darkcrusade, it was his idea, section of code.
« Last Edit: March 27, 2014, 11:05:14 am by skrX »

Offline Bonecrusher

  • Global Moderator
  • Veteran
  • *****
  • Posts: 1397
  • High above
    • Zabijaka.pl
Re: MovePlayer
« Reply #1 on: December 18, 2013, 02:31:07 pm »
Follow up script request: /save and autoload for climb. It was bugged with the previous moveplayer, wonder how its gonna work now.

Im chill like that

DarkCrusade

  • Guest
Re: MovePlayer
« Reply #2 on: December 18, 2013, 04:02:09 pm »
For something like what you have in mind, MovePlayer is simply bad for known reasons. However, I recall one of Avarax's functions which does what you want without any problems. Explanation: it actually spawns the player where you want him to spawn by deactivating all player spawns except for one which you move to target location, spawn the player and reset it all as though nothing ever happened. :)

Offline TheOne

  • Soldier
  • **
  • Posts: 208
Re: MovePlayer
« Reply #3 on: December 26, 2013, 08:48:15 pm »
The problem I see with this is that we have to perform actions before and after the player respawns (Set/Reset spawns). That can't be done with OnPlayerRespawn only (as far as I know, if you modify spawns in that procedure, it won't affect the player as he already respawned).
We also do not know, when the next respawn will happen, so we can't count on AppOnIdle for modifying spawns.
The common way is to use /setteam to respawn the player. As it should be done on every spawn though, this would cause a lot of spam on your server and probably made players feel uncomfortable (they spawn in base and directly respawn at the saved location).
I heard the scriptcore was going to have BeforePlayerRespawn and AfterPlayerRespawn? I can't remember for which server version and whether it's implemented already.

Offline ExHunter

  • Inactive Soldat Developer
  • Soldier
  • ******
  • Posts: 154
  • Speedy go!
Re: MovePlayer
« Reply #4 on: December 26, 2013, 08:59:07 pm »
The problem I see with this is that we have to perform actions before and after the player respawns (Set/Reset spawns). That can't be done with OnPlayerRespawn only (as far as I know, if you modify spawns in that procedure, it won't affect the player as he already respawned).
We also do not know, when the next respawn will happen, so we can't count on AppOnIdle for modifying spawns.
The common way is to use /setteam to respawn the player. As it should be done on every spawn though, this would cause a lot of spam on your server and probably made players feel uncomfortable (they spawn in base and directly respawn at the saved location).
I heard the scriptcore was going to have BeforePlayerRespawn and AfterPlayerRespawn? I can't remember for which server version and whether it's implemented already.

ScriptCore 3 supports those things already:
http://devs.soldat.pl/index.php/TActivePlayer.OnBeforeRespawn
http://devs.soldat.pl/index.php/TActivePlayer.OnAfterRespawn

But for a proper script you gotta wait for next release/beta, since other really important event procedures are in the current version bugged (but already fixed).

As for MovePlayer.. I've also lurked myself into it, but it drags me from one point to another - so don't expect a fix soon (or at all for now.. D: )