How to apply a command to only 1 interior?
#1

Hi people,

I've added a small line of coding to a filterscript. This script stops the person from /taxi (teleport) out of jail.

Within the taxi script I have put:
Код:
			
	    if(GetPlayerInterior(playerid) == 3) // Jail interior ID
	        {
	         format(string,sizeof(string),"ERROR: No taxi for you sunshine!"); // jail message
                 return SendClientMessage(playerid, 0xFF0000AA, string);
		}
The only problem is, other interior locations have the same ID. http://weedarr.wikidot.com/interior


Would I have to swap this " if interior 3" to "if in jail" ??


if so, how would I get the status (if jailed is true) ?? (I'm using LAdmin)


Thanks for any help
Reply
#2

pawn Код:
if(PlayerInfo[playerid][Jailed]!=0)
Should work for LAdmin.
Reply
#3

How would I use this inside a seperate filterscript? (ie. taxi.pwn)


or would I be better adding a line to Ladmin script?
Reply
#4

Yes, this works too:


Add this at TOP of Taxi:
pawn Код:
new PlayerIsJailed[MAX_PLAYERS];
Add this at bottom of Taxi code:
pawn Код:
forward PlayerGetsJailedFromLAdmin(playerid);
public PlayerGetsJailedFromLAdmin(playerid)
{
    PlayerIsJailed[playerid]=1;
    return 1;
}

forward PlayerGetsUNJailedFromLAdmin(playerid);
public PlayerGetsUNJailedFromLAdmin(playerid)
{
    PlayerIsJailed[playerid]=0;
    return 1;
}
Add this at your command where you block the taxi:
pawn Код:
if(PlayerIsJailed[playerid]==1)
Add this at OnPlayerConnect in TAXI:
pawn Код:
PlayerIsJailed[playerid]=0;

Add this where the player gets jailed (Ladmin):
pawn Код:
CallRemoteFunction("PlayerGetsJailedFromLAdmin", "d",playerid);
Add this where the player gets UNjailed (Ladmin):
pawn Код:
CallRemoteFunction("PlayerGetsUNJailedFromLAdmin", "d",playerid);

I hope it works, just give it a try!
Reply
#5

In the filterscript: CallRemoteFunction
Create a public function which returns PlayerInfo[Jailed]!
Reply
#6

Wow Jeffry, Your on the ball, I`ll give you that! Thanks for the great help. I will try it all in a moment
Reply
#7

Check the post again, I've forgot 2 things. Added now.
I hope it works.
Reply
#8

Quote:

C:\Program Files\Rockstar Games\GTA San Andreas\samp03asvr_R8_win32\filterscripts\ladmin4v 2.pwn(2) : fatal error 100: cannot read from file: "lethaldudb2"

But the files in:
Quote:

C:\Program Files\Rockstar Games\GTA San Andreas\samp03asvr_R8_win32\includes\lethaldudb2

What's going on there then? O_o I copied the folder direct from the LAdmin RAR.
Reply
#9

Nooono, put the include at:

Quote:

C:\Program Files\Rockstar Games\GTA San Andreas\samp03asvr_R8_win32\pawno\includes\HERE

Reply
#10

Quote:

C:\Program Files\Rockstar Games\GTA San Andreas\samp03asvr_R8_win32\includes\lethaldudb2.I NC

It's already there :O (Sorry I Missed out the ".inc" in my post)



idiot me! just realised pawno haha
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)