SA-MP Forums Archive
Command !! Help !! - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Command !! Help !! (/showthread.php?tid=343604)



Command !! Help !! - teomakedonija - 18.05.2012

how to make on player go to destination and press F and player teleporting to interior ?


Re: Command !! Help !! - iRage - 18.05.2012

Use OnPlayerKeyStateChange


Re: Command !! Help !! - Faisal_khan - 18.05.2012

EDIT:
pawn Код:
public OnPlayerSpawn(playerid)
{
    SetPlayerCheckpoint(playerid, x, y, z, 3.0/*size*/);
    return 1;
}

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if (IsPlayerInCheckpoint(playerid))
    {
        if (PRESSED(KEY_SECONDARY_ATTACK.))//F key or Return Key(Enter Key)
        {
            if (IsPlayerInAnyVehicle(playerid))
            {
                return 1;
            }
            else
            {
                SetPlayerPos(playerid, x, y, z);
                SetPlayerInterior(playerid, interiorid);
            }
        }
    }
    else
    {
        return 1;
    }
    return 1;
}
Change the co-ordinates to your ones.


Re: Command !! Help !! - Vince - 18.05.2012

Quote:
Originally Posted by Faisal_khan
Посмотреть сообщение
You cannot use Key_F
F (together with Return) happens to be the default key to enter a vehicle. KEY_SECONDARY_ATTACK.


Re: Command !! Help !! - Faisal_khan - 18.05.2012

Quote:
Originally Posted by Vince
Посмотреть сообщение
F (together with Return) happens to be the default key to enter a vehicle. KEY_SECONDARY_ATTACK.
Hmm... Is that so... Thanks buddy. I did not knew that.