How to enter Building with "F"
#1

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.
Reply
#2

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;
}
Reply
#3

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;
}
Reply
#4

what is the code to enter the Building ?
Reply
#5

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

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.
Reply
#7

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


Forum Jump:


Users browsing this thread: 1 Guest(s)