[Help Needed] LSPD Gate
#1

Код:
// LSPD Gate Mapped by 12kelvin12 and scripted by Tom.1412
// Don't remove credits or claim it as yours.
#include <a_samp>
#include <streamer>
#define FILTERSCRIPT
#define Message 0xFFFFFFAA
new lspdgate1;
new lspdgate2;
forward GateClose0(playerid);
forward PDEXIT2(playerid);
forward PDEXIT3(playerid);

forward loadobjects();

public OnFilterScriptInit()
{
	loadobjects();

	return 1;
}

public OnFilterScriptExit()
{
	return 1;
}


public loadobjects()
{
	print("\n--------------------------------------");
	print("  LOL ");
	print("--------------------------------------\n");
	lspdgate1 = CreateObject(988, 1539.6418457031, -1630.5640869141, 12, 0, 0, 270);
	lspdgate2 = CreateObject(988, 1539.6505126953, -1625.1252441406, 12, 0, 0, 270);
	CreateObject(988, 1539.64, -1630.56, 12.00,   0.00, 0.00, 270.00);
	CreateObject(988, 1539.65, -1625.13, 12.00,   0.00, 0.00, 270.00);
	CreateObject(987, 1539.64, -1605.85, 12.45,   0.00, 0.00, 269.92);
	CreateObject(987, 1539.67, -1602.37, 12.45,   0.00, 0.00, 269.92);
	CreateObject(987, 1551.62, -1602.35, 12.45,   0.00, 0.00, 180.62);
	CreateObject(987, 1563.53, -1602.30, 12.45,   0.00, 0.00, 180.62);
	CreateObject(987, 1575.55, -1602.38, 12.45,   0.00, 0.00, 179.62);
	CreateObject(987, 1587.46, -1602.35, 12.45,   0.00, 0.00, 180.09);
	CreateObject(987, 1599.42, -1602.31, 12.45,   0.00, 0.00, 180.34);
	CreateObject(987, 1608.04, -1602.35, 12.45,   0.00, 0.00, 180.09);
	CreateObject(987, 1607.93, -1614.21, 12.45,   0.00, 0.00, 89.76);
	CreateObject(987, 1607.95, -1626.13, 12.45,   0.00, 0.00, 89.76);
	CreateObject(987, 1607.94, -1638.01, 12.45,   0.00, 0.00, 89.76);
	CreateObject(987, 1596.01, -1638.84, 12.45,   0.00, 0.00, 4.11);
	CreateObject(970, 1551.56, -1617.62, 13.10,   0.00, 0.00, 0.00);
	CreateObject(970, 1559.90, -1617.63, 13.10,   0.00, 0.00, 0.00);
	CreateObject(970, 1564.02, -1617.65, 13.10,   0.00, 0.00, 0.00);
	CreateObject(970, 1568.04, -1617.64, 13.10,   0.00, 0.00, 0.00);
	CreateObject(970, 1572.17, -1617.65, 13.10,   0.00, 0.00, 0.00);
	CreateObject(970, 1575.64, -1617.66, 13.10,   0.00, 0.00, 0.00);
	CreateObject(3934, 1565.68, -1645.19, 27.40,   0.00, 0.00, 359.22);
	CreateObject(970, 1555.74, -1617.63, 13.10,   0.00, 0.00, 0.00);
	CreateObject(987, 1539.35, -1645.23, 12.45,   0.00, 0.00, 356.74);
	CreateObject(987, 1539.44, -1633.30, 12.45,   0.00, 0.00, 269.92);
	CreateObject(987, 1539.81, -1610.50, 12.45,   0.00, 0.00, 269.92);
	CreateObject(987, 1539.44, -1633.30, 12.45,   0.00, 0.00, 269.92);
	CreateObject(987, 1539.44, -1633.30, 12.45,   0.00, 0.00, 269.92);
	CreateObject(987, 1539.44, -1633.30, 12.45,   0.00, 0.00, 269.92);
	CreateObject(987, 1539.44, -1633.30, 12.45,   0.00, 0.00, 269.92);
	CreateObject(987, 1539.44, -1633.30, 12.45,   0.00, 0.00, 269.92);
	return 1;
}

public GateClose0(playerid)
{
    MoveObject(lspdgate1, 1539.6418457031, -1630.5640869141, 12, 2);
	MoveObject(lspdgate2, 1539.6505126953, -1625.1252441406, 12, 2);
	SetTimer("GateClose02", 3400, 0);
	return 1;
}
public PDEXIT2(playerid)
{
	MoveObject(lspdgate1, 1539.6505126953, -1634.3499755859, 12, 2);
	MoveObject(lspdgate2, 1539.6505126953, -1621, 12, 2);
	SetTimer("PDEXIT3", 3400, 0);
	return 1;
}

public PDEXIT3()
{
    MoveObject(lspdgate1, 1539.6418457031, -1630.5640869141, 12, 2);
	MoveObject(lspdgate2, 1539.6505126953, -1625.1252441406, 12, 2);
	return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
	if(!strcmp(cmdtext, "/gateopen", true))
	{
		MoveObject(lspdgate1, 1539.6418457031, -1634.3499755859, 12, 2);
		MoveObject(lspdgate2, 1539.6418457031, -1621, 12, 2);
		SetTimer("GateClose0", 3400, 0);
		}
		else
		{
		SendClientMessage(playerid, Message,"You are not a Police Officer");
		}
	return 1;
	}
Now when I use normal admin commands, I get that error... "You are not a police officer".

What's up with this / used in a filterscript / based on LARP.
Reply
#2

You have to have something like this in there:
Код:
 if(IsACop(playerid) && PlayerInfo[playerid][pRank] >= 7 || IsSpecial(playerid) || PlayerInfo[playerid][pAdmin] >= 5
Not exactly it i know but it is something of that sort.
Reply
#3

Quote:
Originally Posted by UnknownGamer
Посмотреть сообщение
Код:
	if(!strcmp(cmdtext, "/gateopen", true))
	{
		MoveObject(lspdgate1, 1539.6418457031, -1634.3499755859, 12, 2);
		MoveObject(lspdgate2, 1539.6418457031, -1621, 12, 2);
		SetTimer("GateClose0", 3400, 0);
		}
		else
		{
		SendClientMessage(playerid, Message,"You are not a Police Officer");
		}
	return 1;
	}
Replace that......With this:

Код:
 	
if(!strcmp(cmdtext, "/gateopen", true))
	{
     if(PlayerInfo[playerid][pAdmin] >= 4 || IsAPDMember(playerid) || IsAFreecop(playerid))
		{
		   	//if (IsPlayerInRangeOfPoint(playerid, 15,1589.053344,-1638.123168,14.122960))
			{
                                MoveObject(lspdgate1, 1539.6418457031, -1634.3499755859, 12, 2);
				MoveObject(lspdgate2, 1539.6418457031, -1621, 12, 2);
				SetTimer("GateClose0", 3400, 0);
			}
			else
			{
				SendClientMessage(playerid, COLOR_GREY,"* You are not a police officer!");

				return 1;
			}
		}
Reply
#4

Hey man, i too cant understand that gates system, i am tryed a lot of them xD Ramiraz can u show me How i can open gates only if i am in Yamaguchi faction?

Here is FS Code, it works, but...for all players.

Код:
#include <a_samp>

#define FILTERSCRIPT
new yamaguchigates1;

public OnFilterScriptInit()
{
    yamaguchigates1 = CreateObject(980, 785.09997558594, -1152.4000244141, 25.299999237061, 0, 0, 270, 100.0);
    return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp(cmdtext, "/go", true)){
        if(IsPlayerInRangeOfPoint(playerid, 15, 785.09997558594, -1152.4000244141, 25.299999237061)){
            MoveObject(yamaguchigates1, 785.40002441406, -1162.9000244141, 25.39999961853, 3.0, 0.0, 0.0, 270);
            return 1;
        }
    }
    else if(strcmp(cmdtext, "/close", true)){
        if(IsPlayerInRangeOfPoint(playerid, 15, 785.09997558594, -1152.4000244141, 25.299999237061)){
            MoveObject(yamaguchigates1, 785.09997558594, -1152.4000244141, 25.299999237061, 3.0, 0.0, 0.0, 270);
            return 1;
        }
    }
    return 0;
}
public OnFilterScriptExit()
{
    return 1;
}
Just show me one time how and where i need to type faction ID or name, i dont know. then i understand in next time and i dont need more ask questions about this difficult gates ; ( Or edit a code so it can work only for yamaguchi. Please..
Reply
#5

Код:
C:\Users\matthew\Desktop\CnR1.1\filterscripts\LSPD_Gate.pwn(94) : error 017: undefined symbol "PlayerInfo"
C:\Users\matthew\Desktop\CnR1.1\filterscripts\LSPD_Gate.pwn(94) : warning 215: expression has no effect
C:\Users\matthew\Desktop\CnR1.1\filterscripts\LSPD_Gate.pwn(94) : error 001: expected token: ";", but found "]"
C:\Users\matthew\Desktop\CnR1.1\filterscripts\LSPD_Gate.pwn(94) : error 029: invalid expression, assumed zero
C:\Users\matthew\Desktop\CnR1.1\filterscripts\LSPD_Gate.pwn(94) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
Still errors.
Reply
#6

Down to 1 error, How would I fix this, It's to do with the 'else'. Line 52084

Код:
C:\Users\matthew\Desktop\CnR1.1\gamemodes\larp.pwn(52084) : error 029: invalid expression, assumed zero
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Код:
	if(!strcmp(cmdtext, "/gateopen", true))
	{
     if(PlayerInfo[playerid][pAdmin] >= 4 || IsAPDMember(playerid) || IsAFreecop(playerid))
		{
		   	//if (IsPlayerInRangeOfPoint(playerid, 15,1589.053344,-1638.123168,14.122960))
			{
				MoveObject(lspdgate1, 1539.6418457031, -1634.3499755859, 12, 2);
				MoveObject(lspdgate2, 1539.6418457031, -1621, 12, 2);
				SetTimer("GateClose0", 3400, 0);
			}
			else
			{
				SendClientMessage(playerid, COLOR_GREY,"* You are not a police officer!");
				}
			return 1;
			}
		}
Reply
#7

Try this instead



Quote:
Originally Posted by UnknownGamer
Посмотреть сообщение
Down to 1 error, How would I fix this, It's to do with the 'else'. Line 52084

Код:
			}
			else
			{
				SendClientMessage(playerid, COLOR_GREY,"* You are not a police officer!");
			        return 1;
			}
		}
Reply
#8

Quote:
Originally Posted by Liepaajnieks
Посмотреть сообщение
Hey man, i too cant understand that gates system, i am tryed a lot of them xD Ramiraz can u show me How i can open gates only if i am in Yamaguchi faction?

Here is FS Code, it works, but...for all players.

Код:
#include <a_samp>

#define FILTERSCRIPT
new yamaguchigates1;

public OnFilterScriptInit()
{
    yamaguchigates1 = CreateObject(980, 785.09997558594, -1152.4000244141, 25.299999237061, 0, 0, 270, 100.0);
    return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp(cmdtext, "/go", true)){
        if(IsPlayerInRangeOfPoint(playerid, 15, 785.09997558594, -1152.4000244141, 25.299999237061)){
            MoveObject(yamaguchigates1, 785.40002441406, -1162.9000244141, 25.39999961853, 3.0, 0.0, 0.0, 270);
            return 1;
        }
    }
    else if(strcmp(cmdtext, "/close", true)){
        if(IsPlayerInRangeOfPoint(playerid, 15, 785.09997558594, -1152.4000244141, 25.299999237061)){
            MoveObject(yamaguchigates1, 785.09997558594, -1152.4000244141, 25.299999237061, 3.0, 0.0, 0.0, 270);
            return 1;
        }
    }
    return 0;
}
public OnFilterScriptExit()
{
    return 1;
}
Just show me one time how and where i need to type faction ID or name, i dont know. then i understand in next time and i dont need more ask questions about this difficult gates ; ( Or edit a code so it can work only for yamaguchi. Please..
As for this just add "if(IsPlayerAYamaguchiMember(playerid))" under each command. You might have to define Yamaguchi member though if you dont have it already.
Reply
#9

I dont know what exatcly i need define, i get theese errors
Код:
error 017: undefined symbol "IsPlayerAYamaguchiMember"
error 017: undefined symbol "IsPlayerAYamaguchiMember"
Here full code
Код:
#include <a_samp>
#include <a_players>
#define YamaguchiMember
#define FILTERSCRIPT
new yamaguchigates1;

public OnFilterScriptInit()
{
    print("\n******************************************************");
    print("*                                                                                              *");
    print("* Simple Movable Gates Filterscript                                                 *");
    print("*                                                                                              *");
    print("******************************************************\n");
    
    yamaguchigates1 = CreateObject(980, 785.09997558594, -1152.4000244141, 25.299999237061, 0, 0, 270, 100.0);
    return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp(cmdtext, "/go", true)){
    if(IsPlayerAYamaguchiMember(playerid))
          if(IsPlayerInRangeOfPoint(playerid, 15, 785.09997558594, -1152.4000244141, 25.299999237061)){
            MoveObject(yamaguchigates1, 785.40002441406, -1162.9000244141, 25.39999961853, 3.0, 0.0, 0.0, 270);
            return 1;
        }
    }
    else if(strcmp(cmdtext, "/close", true)){
    if(IsPlayerAYamaguchiMember(playerid))
        if(IsPlayerInRangeOfPoint(playerid, 15, 785.09997558594, -1152.4000244141, 25.299999237061)){
            MoveObject(yamaguchigates1, 785.09997558594, -1152.4000244141, 25.299999237061, 3.0, 0.0, 0.0, 270);
            return 1;
        }
    }
    return 0;
}
public OnFilterScriptExit()
{
    return 1;
}
Reply
#10

Put this at the top with all the other Forwards. forward IsAYamagchiMember(playerid);

And put this close to your gates

Код:
public IsAYamaguchiMember(playerid)
{
	if(IsPlayerConnected(playerid))
	{
	    new leader = PlayerInfo[playerid][pLeader];
	    new member = PlayerInfo[playerid][pMember];
	    if(member==1)
		{
		    return 1;
		}
		else if(leader==1)
		{
		    return 1;
		}
	}
	return 0;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)