Need help with some callbacks.
#1

Ok, i am making a ferry for my server, and i need it to where if they are on the ferry, they go with the ferry when the timer activates to move it, and charges them a fee.

I got a timer that when it goes does moveobject, but heres where i need help.
I need it so that people on the ferry go with it.
SO i need help so that when the timer activtes it sees if the person is on it (isplayernearcheckpoint or something) Sets the vehicle velocity to the same speed as the ferry, and i can figure out the rest. How can i do that.

Ps, im using an aircraft carrier as my ferry so hhow many check points or whatever would i need to set? And i need it so that it doed not think people on the docks are on the ferry.
Reply
#2

You could look into using the IsPlayerInRangeOfPoint function for the player's position check. Perhaps find the centre coordinate of the ferry and then specify a range around that?
https://sampwiki.blast.hk/wiki/IsPlayerInRangeOfPoint

If you are willing to collect a few coordinates, you could use this IsPlayerInArea function:
pawn Код:
IsPlayerInArea(playerid,Float:max_x,Float:min_x,Float:max_y,Float:min_y)
{
    new Float:X, Float:Y, Float:Z;
    GetPlayerPos(playerid, X, Y, Z);
    if(X <= max_x && X >= min_x && Y <= max_y && Y >= min_y) {
        return 1;
    }
    return 0;
}
That could be used to make sure players are on the ferry, and are not on the dock. Just a few suggestions to get the ball rolling!
Reply
#3

how about, setting there pos then SetPlayerSpecialAction(playerid,SPECIAL_ACTION_SIT TING); ?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)