SA-MP Forums Archive
Hq [Help] [+Rep] - 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: Hq [Help] [+Rep] (/showthread.php?tid=540120)



Hq [Help] [+Rep] - Kaylen - 02.10.2014

How to make hitman Hq or Door in pawn ?
i have the interior , exterior and checkpoint when i type /showmehq
when i go to the exterior and type /enter it said nothing

What i need to make it works ?
pawn Код:
// Hitman HQ
    if(IsPlayerInRangeOfPoint(playerid, 2.0,  1938.545898, 165.629531, 37.281250))
    {
        if(PlayerInfo[playerid][pFaction] == 4 || PlayerInfo[playerid][pLeader] == 4)
        {
            SetPlayerVirtualWorld(playerid, 666420);
            PlayerInfo[playerid][pVW] = 666420;
            SetPlayerInterior(playerid, 42);
            PlayerInfo[playerid][pInt] = 42;
            SetPlayerPos(playerid, 1277.019165, -758.428771, 5080.750000);
            SetPlayerFacingAngle(playerid, 358.16);
            SetCameraBehindPlayer(playerid);

            TogglePlayerControllable(playerid, 0);
            for(new o = 0; o < 6; o++)
            {
                TextDrawShowForPlayer(playerid, ObjectsLoadingTD[o]);
            }
            SetPVarInt(playerid, "LoadingObjects", 1);
            SetTimerEx("SafeLoadObjects", 3000, 0, "d", playerid);
            SendClientMessage(playerid, COLOR_WHITE, "You can /order weaponry in the armory room.");
        }
    }




// Hitman HQ
    if(IsPlayerInRangeOfPoint(playerid, 2.0, 1277.019165, -758.428771, 5080.750000) && (GetPlayerVirtualWorld(playerid) == 666420))
    {
        if(PlayerInfo[playerid][pFaction] == 4 || PlayerInfo[playerid][pLeader] == 4)
        {
            SetPlayerVirtualWorld(playerid, 0);
            PlayerInfo[playerid][pVW] = 0;
            SetPlayerInterior(playerid, 0);
            PlayerInfo[playerid][pInt] = 0;
            SetPlayerPos(playerid, 1938.545898, 165.629531, 37.281250);
            SetPlayerFacingAngle(playerid, 338.54);
            SetCameraBehindPlayer(playerid);
        }
    }



Re: Hq [Help] [+Rep] - Youssef214 - 02.10.2014

Please Explain more, how it doesn't work?


Re: Hq [Help] [+Rep] - Kaylen - 02.10.2014

Quote:
Originally Posted by Youssef214
Посмотреть сообщение
Please Explain more, how it doesn't work?
When i go to the exterior and type /enter not work


Re: Hq [Help] [+Rep] - Youssef214 - 02.10.2014

Make A message that tells you that you are not near these positions: IsPlayerInRangeOfPoint(playerid, 2.0, 1938.545898, 165.629531, 37.281250) In your exterior code, then try to use the command


Re: Hq [Help] [+Rep] - Kaylen - 02.10.2014

Sorry What do you want from me to do again ?


Respuesta: Hq [Help] [+Rep] - ghost556 - 03.10.2014

Try this, i believe he meant if the player is not near the correct coordinates defined by the 'IsPlayerInRangeOfPoint' function it will send them a message saying that the player is not near a entrance/exit
Код:
CMD:enter(playerid, params[])
{
// Hitman HQ
    if(IsPlayerInRangeOfPoint(playerid, 2.0,  1938.545898, 165.629531, 37.281250))
    {
        if(PlayerInfo[playerid][pFaction] == 4 || PlayerInfo[playerid][pLeader] == 4)
        {
            SetPlayerVirtualWorld(playerid, 666420);
            PlayerInfo[playerid][pVW] = 666420;
            SetPlayerInterior(playerid, 42);
            PlayerInfo[playerid][pInt] = 42;
            SetPlayerPos(playerid, 1277.019165, -758.428771, 5080.750000);
            SetPlayerFacingAngle(playerid, 358.16);
            SetCameraBehindPlayer(playerid);

            TogglePlayerControllable(playerid, 0);
            for(new o = 0; o < 6; o++)
            {
                TextDrawShowForPlayer(playerid, ObjectsLoadingTD[o]);
            }
            SetPVarInt(playerid, "LoadingObjects", 1);
            SetTimerEx("SafeLoadObjects", 3000, 0, "d", playerid);
            SendClientMessage(playerid, COLOR_WHITE, "You can /order weaponry in the armory room.");
        }
        else SendClientMessage(playerid, COLOR_WHITE, "You need to be a hitman to use this door."); // Sending a message telling the player that they are not in the right faction
    }
    else SendClientMessage(playerid, COLOR_WHITE, "You are not near a door you can enter."); // Sending a message telling the player that they are not near a enterable property/door
    return 1;
}

CMD:exit(playerid, params[])
{
    if(IsPlayerInRangeOfPoint(playerid, 2.0, 1277.019165, -758.428771, 5080.750000) && (GetPlayerVirtualWorld(playerid) == 666420))
    {
        if(PlayerInfo[playerid][pFaction] == 4 || PlayerInfo[playerid][pLeader] == 4)
        {
            SetPlayerVirtualWorld(playerid, 0);
            PlayerInfo[playerid][pVW] = 0;
            SetPlayerInterior(playerid, 0);
            PlayerInfo[playerid][pInt] = 0;
            SetPlayerPos(playerid, 1938.545898, 165.629531, 37.281250);
            SetPlayerFacingAngle(playerid, 338.54);
            SetCameraBehindPlayer(playerid);
        }
        else SendClientMessage(playerid, COLOR_WHITE, "You need to be a hitman to use this door."); // Sending a message telling the player that they are not in the right faction
    }
    else SendClientMessage(playerid, COLOR_WHITE, "You are not near a door you can exit."); // Sending a message telling the player that they are not near a exitable property/door
    return 1;
}



Re: Hq [Help] [+Rep] - JJack - 03.10.2014

The problem is that you didnt even create the command. Use what ghost556 has posted.
Note: You'll need ZCMD include. (If its not there I mean)


Re: Respuesta: Hq [Help] [+Rep] - Kaylen - 03.10.2014

Quote:
Originally Posted by ghost556
Посмотреть сообщение
Try this, i believe he meant if the player is not near the correct coordinates defined by the 'IsPlayerInRangeOfPoint' function it will send them a message saying that the player is not near a entrance/exit
Код:
CMD:enter(playerid, params[])
{
// Hitman HQ
    if(IsPlayerInRangeOfPoint(playerid, 2.0,  1938.545898, 165.629531, 37.281250))
    {
        if(PlayerInfo[playerid][pFaction] == 4 || PlayerInfo[playerid][pLeader] == 4)
        {
            SetPlayerVirtualWorld(playerid, 666420);
            PlayerInfo[playerid][pVW] = 666420;
            SetPlayerInterior(playerid, 42);
            PlayerInfo[playerid][pInt] = 42;
            SetPlayerPos(playerid, 1277.019165, -758.428771, 5080.750000);
            SetPlayerFacingAngle(playerid, 358.16);
            SetCameraBehindPlayer(playerid);

            TogglePlayerControllable(playerid, 0);
            for(new o = 0; o < 6; o++)
            {
                TextDrawShowForPlayer(playerid, ObjectsLoadingTD[o]);
            }
            SetPVarInt(playerid, "LoadingObjects", 1);
            SetTimerEx("SafeLoadObjects", 3000, 0, "d", playerid);
            SendClientMessage(playerid, COLOR_WHITE, "You can /order weaponry in the armory room.");
        }
        else SendClientMessage(playerid, COLOR_WHITE, "You need to be a hitman to use this door."); // Sending a message telling the player that they are not in the right faction
    }
    else SendClientMessage(playerid, COLOR_WHITE, "You are not near a door you can enter."); // Sending a message telling the player that they are not near a enterable property/door
    return 1;
}

CMD:exit(playerid, params[])
{
    if(IsPlayerInRangeOfPoint(playerid, 2.0, 1277.019165, -758.428771, 5080.750000) && (GetPlayerVirtualWorld(playerid) == 666420))
    {
        if(PlayerInfo[playerid][pFaction] == 4 || PlayerInfo[playerid][pLeader] == 4)
        {
            SetPlayerVirtualWorld(playerid, 0);
            PlayerInfo[playerid][pVW] = 0;
            SetPlayerInterior(playerid, 0);
            PlayerInfo[playerid][pInt] = 0;
            SetPlayerPos(playerid, 1938.545898, 165.629531, 37.281250);
            SetPlayerFacingAngle(playerid, 338.54);
            SetCameraBehindPlayer(playerid);
        }
        else SendClientMessage(playerid, COLOR_WHITE, "You need to be a hitman to use this door."); // Sending a message telling the player that they are not in the right faction
    }
    else SendClientMessage(playerid, COLOR_WHITE, "You are not near a door you can exit."); // Sending a message telling the player that they are not near a exitable property/door
    return 1;
}
i have enter CMD and Exit CMD i tried to put the hitman codes under the enter cmd and the exit cmd but it not works


Re: Hq [Help] [+Rep] - MichealScript - 03.10.2014

What it does when you write /enter and /exit?


Re: Hq [Help] [+Rep] - Kaylen - 03.10.2014

Quote:
Originally Posted by MichealScript
Посмотреть сообщение
What it does when you write /enter and /exit?
That all im doing , But when i go to any door or Business and type /enter it enter