SA-MP Forums Archive
How to enter Building with "F" - 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: How to enter Building with "F" (/showthread.php?tid=484986)



How to enter Building with "F" - Wex3go - 02.01.2014

Hello Guys Sup ?

i hope all the Member Good ..

i wanna know How to enter the Build with "Press F" , To put it in my Gamemode.


Re: How to enter Building with "F" - Konstantinos - 02.01.2014

pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if (newkeys & KEY_SECONDARY_ATTACK)
    {
        // code for entering a building with F
       
        ...
       
        // OR..
       
        // if there's already a command (such as /enter {using ZCMD}):
        cmd_enter(playerid, "");
    }
    return 1;
}



Re: How to enter Building with "F" - Sledgehammer - 02.01.2014

Put the code under the function: 'OnPlayerKeyStateChange(playerid, newkeys, oldkeys)'.

You got to define what key you want. https://sampwiki.blast.hk/wiki/Keys

I.e

pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(IsKeyJustDown(KEY_CROUCH, newkeys, oldkeys))
{
//Your code here.
}
return 1;
}



Re: How to enter Building with "F" - Wex3go - 02.01.2014

what is the code to enter the Building ?


Re: How to enter Building with "F" - Wex3go - 02.01.2014

Ok i will upload my Gamemode to put it can anyone Help me with it ?


Re: How to enter Building with "F" - Dubya - 02.01.2014

This is scripting help, not script requests... We will not lay you out with a full script on how to do this, but only show you the basics.


Re: How to enter Building with "F" - Wex3go - 02.01.2014

Duby - Sure i know , But i tried to put it and it still failed :P