Help is needed!
#1

Hello SA-MP community.
I need a way of making a player unable to move (W,A,S,D keys and the arrows) but be able to move the moues around.
For example a TogglePlayerControlable but a one that allows you to move your mouse.
Thanks in regards, Marco.
Reply
#2

I think there is no way for it....
I will notify u once i get a solution
Reply
#3

Thanks, waiting for a response.
Reply
#4

Rather than using TogglePlayerControllable, you can store the player's position and repeatedly set it back to that position in a quick timer.

pawn Код:
forward public PlayerFrozenCheck(playerid);

new Float: playersFrozenPosition[MAX_PLAYERS][4], playerFrozenTimer[MAX_PLAYERS];

public OnPlayerConnect(playerid)
{
    playerFrozenTimer[playerid] = SetTimerEx("PlayerFrozenCheck", 200, 1, "i", playerid);
    return 1;
}

public OnPlayerDisconnect(playerid)
{
    KillTimer(playerFrozenTimer[playerid]);
    return 1;
}

public PlayerFrozenCheck(playerid)
{
    if(playersFrozenPosition[playerid][0] != -65535)
    {
        SetPlayerPos(playerid, playersFrozenPosition[playerid][0], playersFrozenPosition[playerid][1], playersFrozenPosition[playerid][2]);
        SetPlayerFacingAngle(playerid, playersFrozenPosition[playerid][3]);
        SetCameraBehindPlayer(playerid);
    }

    return 1;
}

TogglePlayerFrozen(playerid, bool: toggle)
{
    if(toggle)
    {
        GetPlayerPos(playerid, playersFrozenPosition[playerid][0], playersFrozenPosition[playerid][1], playersFrozenPosition[playerid][2]);
        GetPlayerFacingAngle(playerid, playersFrozenPosition[playerid][3]);
    }
    else
    {
        playersFrozenPosition[playerid][0] = -65535;
    }
}
Reply
#5

When you go, set velocity to 0.0 or clear animations.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)