:)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
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.
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
Waiting
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;
}
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"
Quote from: Beary on Dec 05, 2015, 10:12 AMQuote 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?
Quote from: KAKAN on Dec 05, 2015, 12:10 PMQuote from: Beary on Dec 05, 2015, 10:12 AMQuote 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
Well no shit. The event is called when you move. How do you expect it to do something when you're not?
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.
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?
The onPlayerGameKeysChange might help.
Untested:
function onPlayerGameKeysChange( player, old, new )
{
if( new == 0 && old > 0 )
Message( "You stopped" );
}
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 :)