Author Topic: moveplayer  (Read 1492 times)

0 Members and 1 Guest are viewing this topic.

Offline Nedi

  • Major(1)
  • Posts: 47
moveplayer
« on: January 25, 2013, 02:26:35 pm »
Hi

I have something like this:
Code: [Select]
var
X, Y: Single;

function OnPlayerCommand(ID: Byte; Text: string): boolean;
begin
if Text = '/test' then begin
X := GetPlayerStat(1, 'X');
Y := GetPlayerStat(1, 'Y');
MovePlayer(1, GetPlayerStat(2, 'X'), GetPlayerStat(2, 'Y'));
MovePlayer(2, X, Y);

end;
Result := false;
end;
It should swap places with ID 1 player and ID 2 player but it doesn't.
Player 1 is teleported to player 2 but player 2 is teleported to random place.
What's the problem?

Offline Falcon`

  • Flagrunner
  • ****
  • Posts: 792
  • A wanted lagger
Re: moveplayer
« Reply #1 on: January 25, 2013, 04:00:22 pm »
If you're not paying for something, you're not the customer; you're the product being sold.
- Andrew Lewis

Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.

Offline Nedi

  • Major(1)
  • Posts: 47
Re: moveplayer
« Reply #2 on: January 25, 2013, 04:13:35 pm »
Thanks for your reply.

Will it be fixed? I need it very much. :<

Offline Falcon`

  • Flagrunner
  • ****
  • Posts: 792
  • A wanted lagger
Re: moveplayer
« Reply #3 on: January 25, 2013, 05:03:41 pm »
Not in upcoming release for sure.
If you're not paying for something, you're not the customer; you're the product being sold.
- Andrew Lewis

Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.

Offline TheOne

  • Soldier
  • **
  • Posts: 208
Re: moveplayer
« Reply #4 on: January 26, 2013, 04:41:19 am »
Hey.
As usual, use workarounds. For MovePlayer I suggest to move the second call of the procedure to AppOnIdle (set some global variables to those coordinates).
Also you'll need to take care of random Weapon- and Flag-drops (depending on your use of course) - this might be inspiration there: http://forums.soldat.pl/index.php?topic=41552.msg502962#msg502962

Offline ExHunter

  • Inactive Soldat Developer
  • Soldier
  • ******
  • Posts: 154
  • Speedy go!
Re: moveplayer
« Reply #5 on: October 08, 2014, 05:44:20 pm »
Tried your script Nedi now, works now. No workaround anymore required.

Test it in 1.6.8b2.. It will be released somewhen this week.
« Last Edit: October 08, 2014, 05:48:44 pm by ExHunter »