SA-MP Forums Archive
/goout problem - 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: /goout problem (/showthread.php?tid=433707)



/goout problem - CrayZee09 - 28.04.2013

I've posted in the minor problem section but i got no answer.

When i type /enter in the arrest place (LSPD) i go in the jail, it's OK. But when i type /goout i get somewhere but i don't want to get there ( i get in the LSPD but no /exit command in there). I set the coordinates to setint 0 and teleport outside, where i typed /enter (arrest place, lspd) but now, when i type /goout i get somewhere in farm2 , and i'm falling until i hit the ground and SMASH!!!

Help please.


Re: /goout problem - Black Axe - 28.04.2013

Mostly - It would be a co-ordinates problem - Go to the exit location you want.

And use /save.

Then open up savedpositions.txt at your GTA:SA directory.

Then open up your script - Search for the "/goout" commands - And find the LSPD exit code.

Delete the old exit TP [SetPlayerPos] and add the new one you got in savedpositions.txt.


Re: /goout problem - CrayZee09 - 28.04.2013

I said that i did this! And now i got in the mid-air, somewhere in farm2....

Код:
    if(strcmp(cmd, "/goout", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
			if(PlayerToPoint(4.0,playerid,1779.3185,-1576.1315,1734.9430))
			{
                if(PlayerInfo[playerid][pLeader] == 1 || PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 2 || PlayerInfo[playerid][pMember] == 2 || PlayerInfo[playerid][pLeader] == 3 || PlayerInfo[playerid][pMember] == 3 || PlayerInfo[playerid][pJob] == 2)
				{
					SetPlayerPos(playerid, 1527.5209,-1677.8536,5.8906);
				}
				SetPlayerInterior(playerid,0);
				PlayerInfo[playerid][pInt] = 0;
			}
			else
			{
				SendClientMessage(playerid, COLOR_GRAD1, "Nu esti in jail");
			}
		}
		return 1;
	}



Re: /goout problem - Black Axe - 28.04.2013

PHP код:
    if(strcmp(cmd"/goout"true) == 0)
    {
        if(
IsPlayerConnected(playerid))
        {
            if(
IsPlayerInRangeOfPoint(playerid4.01779.3185,-1576.1315,1734.9430))
            {
                        if(
PlayerInfo[playerid][pLeader] == || PlayerInfo[playerid][pMember] == || PlayerInfo[playerid][pLeader] == || PlayerInfo[playerid][pMember] == || PlayerInfo[playerid][pLeader] == || PlayerInfo[playerid][pMember] == || PlayerInfo[playerid][pJob] == 2)
                {
                    
SetPlayerPos(playerid1527.5209,-1677.8536,5.8906);
                    
SetPlayerInterior(playerid,0);
                    
PlayerInfo[playerid][pInt] = 0;
                }    
                else
                {
                    
SendClientMessage(playeridCOLOR_GRAD1"Nu esti in jail");
                }    
            }
        }    
        return 
1;
    } 
Give this code a try.


Re: /goout problem - RVRP - 28.04.2013

I'm going to take a stab at it and say your issue is in your third if statement. You claim that in order for the player's position to be set they must be a pLeader or pMember level 1, 2, or 3. If you the player is not one of those, it will simply set the player's interior to 0 while they are still in the police department. This results in you simply falling from the position the LSPD interior is actually at (up in the sky over the farm).

tl;dr: if the player is not a pLeader or pMember, they are going to fall onto the farm. If you don't want that to happen, remove the if(PlayerInfo[playerid][pLeader].... statement. I'm not sure why you have it anyways.

By the way, you should change the if statement to the following:

pawn Код:
if(PlayerInfo[playerid][pLeader] >= 1 || PlayerInfo[playerid][pMember] >= 1)



Re: /goout problem - Black Axe - 28.04.2013

Quote:

if(PlayerInfo[playerid][pLeader] >= 1 || PlayerInfo[playerid][pMember] >= 1)

That code would apply to each single faction with the ID above 1 - He only wants it with ID 1 / 2/ 3.


Re: /goout problem - CrayZee09 - 28.04.2013

NG/FBI/PD are 1/2/3. I would try your code, Black Axe. Keep in contact

It works, thank you. Where was the problem?


Re: /goout problem - RVRP - 28.04.2013

Quote:
Originally Posted by Black Axe
Посмотреть сообщение
That code would apply to each single faction with the ID above 1 - He only wants it with ID 1 / 2/ 3.
Despite what the case is, it can easily be changed. I'm just struggling to understand why he would use such repetitive code.

Код:
if(PlayerInfo[playerid][pLeader] > 0  && PlayerInfo[playerid][pLeader] < 4|| PlayerInfo[playerid][pMember] > 0 && PlayerInfo[playerid][pMember] < 4 || PlayerInfo[playerid][pJob] == 2)
Quote:
Originally Posted by CrayZee09
Посмотреть сообщение
NG/FBI/PD are 1/2/3. I would try your code, Black Axe. Keep in contact
What Black Hawk posted will not help you a single bit. Do I need to walk you through the anatomy of code? The way the code is now, these are the results:

If player is a member or leader of 1, 2, 3
- Player will be set at the position you listed, with the interior 0.

If player is NOT a member or leader of 1, 2, 3
- Player will be set at interior 0.

If you are trying to LEAVE the LSPD and you change the interior WITHOUT changing the position (because you aren't a member/leader of 1, 2, or 3), it will result in falling onto the farm.

Instead of just jumping to the first person who posts code (even if it's no better than what you've written), why don't you make an effort to read posts and learn from your mistakes?

Once again, I revert to my original question: "Why are there restrictions on who can leave?" Maybe I am mistaken, but you are looking for a code that allows anyone to leave aren't you? If you aren't, then feel free to ignore everything I have posted and just use what Black Hawk posted. If this is the case though, I am questioning humanity about your inability to figure out that issue on your own.

Please be more descriptive in the original post.


Re: /goout problem - CrayZee09 - 28.04.2013

No, when you type /enter in front of LSPD you enter in LSPD, when you type /exit you get back in front of lspd.
When you go in the parking, after 2 barriers you find /arrest place. You type /enter and you go to jail place. Then you must type /goout to get out. No player can get in because of 2 barriers. And /goout prevent getting out from jail.


Re: /goout problem - RVRP - 28.04.2013

Quote:
Originally Posted by CrayZee09
Посмотреть сообщение
No, when you type /enter in front of LSPD you enter in LSPD, when you type /exit you get back in front of lspd.
When you go in the parking, after 2 barriers you find /arrest place. You type /enter and you go to jail place. Then you must type /goout to get out. No player can get in because of 2 barriers. And /goout prevent getting out from jail.
This has confirmed my worst of thoughts. Then yes, all you need to do is move the interior functions within the if statement checking the player's pLeader/pMember value.

Use the code Black Hawk has posted.

Once again, the reason you are falling from the farm is because you are setting the player's interior to 0 without changing the player's position. Essentially they are falling from the LSPD interior position on the map (which is very high in the sky).