SA-MP Forums Archive
Help me please - 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: Help me please (/showthread.php?tid=398790)



Help me please - Laure - 11.12.2012

Ok here what i want is a player can enter Dynamic houses, businesses on hitting a key like i hit enter and i enter the house or business i am in front of i have no idea how do i do it so expect some hints from you guys.

Thanks in advance.


Re: Help me please - RajatPawar - 11.12.2012

There are a lot of tutorials for this, tons. Use the search option before posting.


Re: Help me please - Laure - 11.12.2012

I got no idea of what do i do to search this thing.


Re: Help me please - Spotlight - 11.12.2012

Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if ((oldkeys & KEY_SECONDARY_ATTACK) && !(newkeys & KEY_SECONDARY_ATTACK)){//If the player presses enter button
       if(IsPlayerInRangeOfPoint(playerid, 3.0, X, Y, Z)) //Change X, Y and Z to the position of your desired 'enter position'
       {
        SetPlayerVirtualWorld(playerid, 1); //change 1 to whatever you like
        SetPlayerInterior(playerid, <interior number>); //change <inter.. to the interior number
        SetPlayerPos(playerid, X, Y, Z); //Change xyz to the interior position
        SendClientMessage(playerid,0xFFFFFFFF,"You have entered the house!");
       }
    }
    return 1;
}
Hope this helps!