How do I create a spot to enter a certain interior...
#1

I am trying to allow players to enter a Sherrifs Station (INT 5- 322.197998,302.497985,999.148437) when they are near the point 627.4248, -571.8760, 17.8942 by pressing the vehicle enter key.

How do I do this for my GM? If someone could please write out how to do this that would be great!

Thanks: jakejohnsonusa
Reply
#2

Here you go

http://lmgtfy.com/?q=How+to+make+ent...and+exits+samp
Reply
#3

Thanks But I'm not a good scripter and that confused me even more... Would someone write this for me please. I usually +1 REP people who help me.

BTY sgtjones12 +1 Thanks for the tip...
Reply
#4

Quote:
Originally Posted by jakejohnsonusa
Посмотреть сообщение
Thanks But I'm not a good scripter and that confused me even more... Would someone write this for me please. I usually +1 REP people who help me.

BTY sgtjones12 +1 Thanks for the tip...
Thank you and Sure I will try to break the tutorial down for you. Are you using strcmp or ZCMD?
Reply
#5

strcmp. And thanks that would be awesome!
Reply
#6

Alright here is the code below
Код:
//Add the commands below under public OnPlayerCommandText as you see.

public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/enter", cmdtext, true, 10) == 0)
    {
        if(IsPlayerInRangeOfPoint(playerid, 2.0, 627.4248, -571.8760, 17.8942))
        {
            SetPlayerPos(playerid, -322.197998,302.497985,999.148437);
            SetPlayerInterior(playerid, 5); // interior id
            SetPlayerVirtualWorld(playerid, 0); // change this if you want to any VirtualWorld
            SetCameraBehindPlayer(playerid);
        }
        return 1;
    }
    if (strcmp("/exit", cmdtext, true, 10) == 0)
    {
        if(IsPlayerInRangeOfPoint(playerid,2.0, -322.197998,302.497985,999.148437))
        {
            SetPlayerPos(playerid, 627.4248, -571.8760, 17.8942);
            SetPlayerInterior(playerid, 0);//leave 0
            SetPlayerVirtualWorld(playerid, 0); // leave 0
            SetCameraBehindPlayer(playerid);
            return 1;
        }
    }
    return 0;
}
Reply
#7

Thx will test soon...
Reply
#8

Is there a way to make it the enter vehicle exit vehicle key instead of /enter /exit?
Reply
#9

Quote:
Originally Posted by jakejohnsonusa
Посмотреть сообщение
Is there a way to make it the enter vehicle exit vehicle key instead of /enter /exit?
I have seen servers with the Enter/Exit Vehicle key aka "F" as the command to enter a door but i am not sure how to do that but i will ask someone ok.
Reply
#10

PHP код:
#include <a_samp>

#define PRESSED(%0) \
    
(((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))

public 
OnPlayerKeyStateChange(playeridnewkeysoldkeys)
{
    if (
PRESSED(KEY_SECONDARY_ATTACK))
    {
        if(
IsPlayerInRangeOfPoint(playerid2.0627.4248, -571.876017.8942))
        {
            
SetPlayerPos(playerid, -322.197998,302.497985,999.148437);
            
SetPlayerInterior(playerid5); 
            
SetPlayerVirtualWorld(playerid0); 
            
SetCameraBehindPlayer(playerid);
        }
        else if(
IsPlayerInRangeOfPoint(playerid,2.0, -322.197998,302.497985,999.148437))
        {
            
SetPlayerPos(playerid627.4248, -571.876017.8942);
            
SetPlayerInterior(playerid0);
            
SetPlayerVirtualWorld(playerid0);
            
SetCameraBehindPlayer(playerid);
        }
    }
    return 
1;

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)