need help

Started by Beary, Dec 04, 2015, 05:48 PM

Previous topic - Next topic

Beary

:)Hello everyone, I'm making my script to have trouble.

function onPlayerMove

function onPlayerMove( player, lastX, lastY, lastZ, newX, newY, newZ )
{
if ( player.moving)
{
Message("moving");
}
else if ( player.Stop)
{
Message("Stop");
}
}

When a player moves, sending a message "mobile"When players to rest, send a message "stop"
I hope so, but there is no such code, who can help me? Very thanks

KAKAN

In what do you need help with?
function onPlayerMove( player, lastX, lastY, lastZ, newX, newY, newZ ){
if( newX >lastX || newY > lastY || newZ > lastZ ) Message("You're currently moving");
else Message("You have stopped");
}

It'll message you on each step you take, be careful.
oh no

Beary

Quote from: KAKAN on Dec 05, 2015, 07:07 AMIn what do you need help with?
function onPlayerMove( player, lastX, lastY, lastZ, newX, newY, newZ ){
if( newX >lastX || newY > lastY || newZ > lastZ ) Message("You're currently moving");
else Message("You have stopped");
}

It'll message you on each step you take, be careful.

Thank you very much, but when I stop didn't work

else Message("You have stopped");not work

ℛḝξ☂

I may be a slow walker but I am always walking.

KAKAN

Use this:-
function onPlayerMove( player, lastX, lastY, lastZ, newX, newY, newZ ){
if( newX >lastX || newY > lastY || newZ > lastZ ) Message("You're currently moving");
else if( newX == lastX || newY == lastY || newZ == lastZ ) Message("You have stopped");
else return 1;
}
oh no

Beary

Quote from: KAKAN on Dec 05, 2015, 09:36 AMUse this:-
function onPlayerMove( player, lastX, lastY, lastZ, newX, newY, newZ ){
if( newX >lastX || newY > lastY || newZ > lastZ ) Message("You're currently moving");
else if( newX == lastX || newY == lastY || newZ == lastZ ) Message("You have stopped");
else return 1;
}


And before the same, sometimes working "stop"

KAKAN

Quote from: Beary on Dec 05, 2015, 10:12 AM
Quote from: KAKAN on Dec 05, 2015, 09:36 AMUse this:-
function onPlayerMove( player, lastX, lastY, lastZ, newX, newY, newZ ){
if( newX >lastX || newY > lastY || newZ > lastZ ) Message("You're currently moving");
else if( newX == lastX || newY == lastY || newZ == lastZ ) Message("You have stopped");
else return 1;
}


And before the same, sometimes working "stop"
WTH do you mean?
oh no

Beary

Quote from: KAKAN on Dec 05, 2015, 12:10 PM
Quote from: Beary on Dec 05, 2015, 10:12 AM
Quote from: KAKAN on Dec 05, 2015, 09:36 AMUse this:-
function onPlayerMove( player, lastX, lastY, lastZ, newX, newY, newZ ){
if( newX >lastX || newY > lastY || newZ > lastZ ) Message("You're currently moving");
else if( newX == lastX || newY == lastY || newZ == lastZ ) Message("You have stopped");
else return 1;
}


And before the same, sometimes working "stop"
WTH do you mean?
You can try to see
He doesn't always Send Stop Message   Not always work

Thijn

Well no shit. The event is called when you move. How do you expect it to do something when you're not?

KAKAN

Quote from: Thijn on Dec 05, 2015, 01:56 PMWell no shit. The event is called when you move. How do you expect it to do something when you're not?
Oh yea, I forgot about it.
Perhaps, my code is fine.
oh no

Beary

Quote from: Thijn on Dec 05, 2015, 01:56 PMWell no shit. The event is called when you move. How do you expect it to do something when you're not?
Well I'm a little ignored. So is there any way to do it like this?

aXXo

The onPlayerGameKeysChange might help.
Untested:

function onPlayerGameKeysChange( player, old, new )
{
if( new == 0 && old > 0 )
Message( "You stopped" );
}

Beary

Quote from: aXXo on Dec 07, 2015, 06:54 PMThe onPlayerGameKeysChange might help.
Untested:

function onPlayerGameKeysChange( player, old, new )
{
if( new == 0 && old > 0 )
Message( "You stopped" );
}

He's working! Thank you very much :)