Vice City: Multiplayer

Server Development => Scripting and Server Management => Topic started by: Beary on Dec 04, 2015, 05:48 PM

Title: need help
Post by: Beary on Dec 04, 2015, 05:48 PM
:)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
Title: Re: need help
Post by: KAKAN on Dec 05, 2015, 07:07 AM
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.
Title: Re: need help
Post by: Beary on Dec 05, 2015, 07:41 AM
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
Title: Re: need help
Post by: ℛḝξ☂ on Dec 05, 2015, 08:41 AM
Waiting
Title: Re: need help
Post by: KAKAN on Dec 05, 2015, 09:36 AM
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;
}
Title: Re: need help
Post by: 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"
Title: Re: need help
Post by: 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?
Title: Re: need help
Post by: Beary on Dec 05, 2015, 12:24 PM
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
Title: Re: need help
Post by: Thijn on Dec 05, 2015, 01:56 PM
Well no shit. The event is called when you move. How do you expect it to do something when you're not?
Title: Re: need help
Post by: KAKAN on Dec 05, 2015, 02:01 PM
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.
Title: Re: need help
Post by: Beary on Dec 06, 2015, 01:54 AM
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?
Title: Re: need help
Post by: aXXo on Dec 07, 2015, 06:54 PM
The onPlayerGameKeysChange might help.
Untested:

function onPlayerGameKeysChange( player, old, new )
{
if( new == 0 && old > 0 )
Message( "You stopped" );
}
Title: Re: need help
Post by: Beary on Dec 10, 2015, 12:55 AM
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 :)