Gate's For Specific Faction ?
#1

How Would I make a gate open for only one faction this is what i have

Код:
public OnPlayerCommandText(playerid, cmdtext[])//
{
	if (strcmp("/AGate1O", cmdtext, true, 10) == 0)
	{
		MoveObject(AGate1, 3648.7119140625, -651.322265625, -1.7251167297363, 3.5);
		SendClientMessage(playerid, 0xB8860BAA, "The Admin Island Gate Has been opened please use /AGate1C to Close it");
		return 1;
	}
	if (strcmp("/AGate1C", cmdtext, true, 10) == 0)
	{
	  MoveObject(AGate1, 3648.7119140625, -651.322265625, 9.5248832702637, 3.5);
	  SendClientMessage(playerid, 0xB8860BAA, "Thank you the Admin Island Gate has been Closed");
	  return 1;
	} if (strcmp("/MGOPEN1", cmdtext, true, 10) == 0 && pGang[playerid]==2)
	{
		MoveObject(CGate1, 2832.1252441406, -1555.6474609375, 10.096872329712, 3.5);
		SendClientMessage(playerid, 0xB8860BAA, "The Maldini Family Gate Has Open");
		return 1;
	}
	if (strcmp("/MGCLOSE1", cmdtext, true, 10) == 0 && pGang[playerid]==2)
	{
	  MoveObject(CGate1, 2830.5666503906, -1565.1704101563, 10.096872329712, 3.5);
	  SendClientMessage(playerid, 0xFFFFFFAA, "Thank you The Maldini Family Gate Has Closed");
	  return 1;
	}
	return 0;
}
and This is the error i get when i try to compile

Код:
C:\Users\GIO\Desktop\Roleplay\filterscripts\MattAI.pwn(95) : error 028: invalid subscript (not an array or too many subscripts): "pGang"
C:\Users\GIO\Desktop\Roleplay\filterscripts\MattAI.pwn(95) : warning 215: expression has no effect
C:\Users\GIO\Desktop\Roleplay\filterscripts\MattAI.pwn(95) : error 001: expected token: ";", but found "]"
C:\Users\GIO\Desktop\Roleplay\filterscripts\MattAI.pwn(95) : error 029: invalid expression, assumed zero
C:\Users\GIO\Desktop\Roleplay\filterscripts\MattAI.pwn(95) : fatal error 107: too many error messages on one line

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


4 Errors.
i Dont know what to do Can Some one help i need it to be a filterscript , the game mode it's for is a larp edit, sorta any ways if that makes a diffrence i dont know lol so help please ?
Reply
#2

Код:
public OnPlayerCommandText(playerid, cmdtext[])//
{
	if (strcmp("/AGate1O", cmdtext, true, 10) == 0)
	{
		MoveObject(AGate1, 3648.7119140625, -651.322265625, -1.7251167297363, 3.5);
		SendClientMessage(playerid, 0xB8860BAA, "The Admin Island Gate Has been opened please use /AGate1C to Close it");
		return 1;
	}
	if (strcmp("/AGate1C", cmdtext, true, 10) == 0)
	{
	  MoveObject(AGate1, 3648.7119140625, -651.322265625, 9.5248832702637, 3.5);
	  SendClientMessage(playerid, 0xB8860BAA, "Thank you the Admin Island Gate has been Closed");
	  return 1;
	} if (strcmp("/MGOPEN1", cmdtext, true, 10) == 0)
	{
      if(pGang[playerid]==2) {
		MoveObject(CGate1, 2832.1252441406, -1555.6474609375, 10.096872329712, 3.5);
		SendClientMessage(playerid, 0xB8860BAA, "The Maldini Family Gate Has Open");
        } else { SendClientMessage(playerid, 0xB8860BAA, "You Can't Open This Gate"); }
		return 1;
	}
	if (strcmp("/MGCLOSE1", cmdtext, true, 10) == 0) { 
    if(pGang[playerid]==2) {
	  MoveObject(CGate1, 2830.5666503906, -1565.1704101563, 10.096872329712, 3.5);
	  SendClientMessage(playerid, 0xFFFFFFAA, "Thank you The Maldini Family Gate Has Closed");
      } else { SendClientMessage(playerid, 0xB8860BAA, "You Can't Open This Gate"); }
	  return 1;
	}
	return 0;
}
Reply
#3

If that won't work, then send us your definition of "pGang" (new pGang...)
Reply
#4

Yeah Didnt work Here's the whole FS

Код:
// This is a comment
// uncomment the line below if you want to write a filterscript
//#define FILTERSCRIPT

#include <a_samp>
new AGate1;
new CGate1;
new pGang;


#define FILTERSCRIPT
#define COLOR_GOLD 0xB8860BAA


#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
CGate1 = CreateObject(969, 2830.5666503906, -1565.1704101563, 10.096872329712, 0, 0, 250.82507324219);
AGate1 = CreateObject(8378, 3648.7121582031, -651.32238769531, 9.5248832702637, 0, 0, 268.68994140625);
return 1;
}

public OnFilterScriptExit()
{
	return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])//
{
	if (strcmp("/AGate1O", cmdtext, true, 10) == 0)
	{
		MoveObject(AGate1, 3648.7119140625, -651.322265625, -1.7251167297363, 3.5);
		SendClientMessage(playerid, 0xB8860BAA, "The Admin Island Gate Has been opened please use /AGate1C to Close it");
		return 1;
	}
	if (strcmp("/AGate1C", cmdtext, true, 10) == 0)
	{
	  MoveObject(AGate1, 3648.7119140625, -651.322265625, 9.5248832702637, 3.5);
	  SendClientMessage(playerid, 0xB8860BAA, "Thank you the Admin Island Gate has been Closed");
	  return 1;
	} if (strcmp("/MGOPEN1", cmdtext, true, 10) == 0)
	{
      if(pGang[playerid]==2) {
		MoveObject(CGate1, 2832.1252441406, -1555.6474609375, 10.096872329712, 3.5);
		SendClientMessage(playerid, 0xB8860BAA, "The Maldini Family Gate Has Open");
        } else { SendClientMessage(playerid, 0xB8860BAA, "You Can't Open This Gate"); }
		return 1;
	}
	if (strcmp("/MGCLOSE1", cmdtext, true, 10) == 0) {
    if(pGang[playerid]==2) {
	  MoveObject(CGate1, 2830.5666503906, -1565.1704101563, 10.096872329712, 3.5);
	  SendClientMessage(playerid, 0xFFFFFFAA, "Thank you The Maldini Family Gate Has Closed");
      } else { SendClientMessage(playerid, 0xB8860BAA, "You Can't Open This Gate"); }
	  return 1;
	}
	return 0;
}
#endif
Reply
#5

i gave u a right code , but i think ur script is made wrong way
Reply
#6

Alright any One Know How To Fix it This The Whol Thins Is In My Last Post And Here Agian

Код:
// This is a comment
// uncomment the line below if you want to write a filterscript
//#define FILTERSCRIPT

#include <a_samp>
new AGate1;
new CGate1;
new pGang;


#define FILTERSCRIPT
#define COLOR_GOLD 0xB8860BAA


#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
CreateObject(7581, 2954.9135742188, -1699.3406982422, 21.309501647949, 0, 0, 169.43994140625);
CreateObject(2910, 2819.9013671875, -1727.201171875, -2.3682813644409, 15.391845703125, 0, 258.76098632813);
CreateObject(2910, 2847.9016113281, -1608.0629882813, -13.593277931213, 23.331848144531, 0, 246.85107421875);
CreateObject(7588, 2933.4360351563, -1697.9735107422, 24.619644165039, 0, 0, 167.45495605469);
CreateObject(12814, 2906.75390625, -1661.3994140625, 12.200897216797, 0, 332.20458984375, 346.10229492188);
CreateObject(12814, 2893.7006835938, -1708.9216308594, 12.200897216797, 0, 332.19909667969, 346.10229492188);
CreateObject(12814, 2892.3876953125, -1727.251953125, 12.200897216797, 0, 332.20458984375, 346.10229492188);
CreateObject(7585, 3043.2885742188, -1692.6450195313, 26.684509277344, 0, 0, 169.43664550781);
CreateObject(7584, 3056.7429199219, -1700.7574462891, 87.859222412109, 0, 0, 286.55493164063);
CreateObject(7590, 2908.8415527344, -1791.1253662109, 21.926216125488, 0, 0, 0);
CreateObject(3749, 2864.2744140625, -1735.8238525391, 15.578338623047, 0, 0, 258.76098632813);
CreateObject(3749, 2897.9133300781, -1629.4136962891, 15.328338623047, 0, 0, 246.84631347656);
CreateObject(7892, 3043.0454101563, -1692.3605957031, 39.314811706543, 0, 0, 169.90995788574);
CreateObject(7586, 3012.869140625, -1710.0164794922, 43.916549682617, 0, 0, 348.08999633789);
CreateObject(987, 2762.4487304688, -1591.2882080078, 12.499895095825, 0, 0, 258.76498413086);
CreateObject(987, 2769.4484863281, -1557.1546630859, 19.54990196228, 0, 0, 258.76098632813);
CreateObject(987, 2778.6130371094, -1527.0833740234, 22.699899673462, 0, 5.9549865722656, 260.74597167969);
CreateObject(987, 2777.0390625, -1535.9423828125, 21.699899673462, 0, 5.95458984375, 260.74401855469);
CreateObject(987, 2779.4240722656, -1519.9608154297, 22.21838760376, 0, 7.9400024414063, 358.01501464844);
CreateObject(987, 2814.4118652344, -1520.6391601563, 15.092781066895, 0, 0, 0);
CreateObject(987, 2820.0786132813, -1520.60546875, 10.24280166626, 0, 0, 0);
CreateObject(987, 2820.4533691406, -1520.6789550781, 15.24280166626, 0, 0, 0);
CreateObject(987, 2817.4865722656, -1594.5395507813, 10.103660583496, 0, 0, 65.505004882813);
CreateObject(6959, 2937.2712402344, -1770.6962890625, 20.517595291138, 0, 0, 0);
CreateObject(6959, 2941.6743164063, -1758.6201171875, 20.367586135864, 0, 0, 0);
CreateObject(6959, 2965.4189453125, -1636.2730712891, 20.367586135864, 0, 0, 0);
CreateObject(6959, 2943.3383789063, -1637.8336181641, 18.617586135864, 0, 0, 326.25);
CreateObject(691, 2955.0068359375, -1644.3518066406, 20.586336135864, 0, 0, 0);
CreateObject(691, 2949.310546875, -1640.7221679688, 20.586336135864, 0, 0, 0);
CreateObject(691, 2943.5349121094, -1636.8552246094, 20.586336135864, 0, 0, 0);
CreateObject(691, 2937.2844238281, -1633.1467285156, 20.586336135864, 0, 0, 0);
CreateObject(691, 2930.8757324219, -1628.9645996094, 20.586336135864, 0, 0, 0);
CreateObject(691, 2938.142578125, -1624.6860351563, 20.586336135864, 0, 0, 0);
CreateObject(691, 2944.3110351563, -1626.5751953125, 20.586336135864, 0, 0, 0);
CreateObject(691, 2951.0334472656, -1629.3337402344, 20.586336135864, 0, 0, 0);
CreateObject(691, 2947.2353515625, -1626.6499023438, 20.586336135864, 0, 0, 0);
CreateObject(691, 2956.30859375, -1629.4697265625, 20.586336135864, 0, 0, 0);
CreateObject(987, 2822.8132324219, -1583.923828125, 7.2036628723145, 0, 0, 65.50048828125);
CreateObject(1652, 2876.4287109375, -1733.01953125, 14.002889633179, 0.4998779296875, 344.63317871094, 348.78295898438);
CreateObject(8390, 2989.576171875, -1881.0615234375, 44.392871856689, 0, 0, 270.67492675781);
CreateObject(1652, 2890.1149902344, -1735.8110351563, 17.877880096436, 0.4998779296875, 344.63012695313, 348.78295898438);
CreateObject(1652, 2875.1467285156, -1743.2369384766, 14.027912139893, 0, 15.144653320313, 168.42041015625);
CreateObject(1652, 2888.0913085938, -1745.8581542969, 17.702917098999, 0, 15.144653320313, 168.42041015625);
CreateObject(982, 2914.55859375, -1764.0643310547, 21.454570770264, 358.23498535156, 0, 1.9849853515625);
CreateObject(982, 2915.1774902344, -1789.3187255859, 22.204578399658, 358.23120117188, 0, 0.9830322265625);
CreateObject(982, 2915.255859375, -1814.8917236328, 23.004570007324, 357.94567871094, 0, 359.27279663086);
CreateObject(982, 2914.8913574219, -1840.4438476563, 23.904567718506, 357.94555664063, 0, 359.26940917969);
CreateObject(982, 2914.6638183594, -1861.1511230469, 24.904567718506, 357.94555664063, 0, 359.26940917969);
CreateObject(981, 3056.6513671875, -1882.6773681641, 25.088184356689, 0, 0, 268.68997192383);
CreateObject(3664, 2927.9577636719, -1900.8914794922, 63.891990661621, 0, 0, 91.310028076172);
CreateObject(3852, 2929.2670898438, -1901.1090087891, 58.89741897583, 0, 0, 272.42498779297);
CreateObject(13645, 2928.4724121094, -1901.1575927734, 61.202777862549, 0, 0, 91.310028076172);
CreateObject(3334, 2767.697265625, -1610.3781738281, 19.499805450439, 0, 0, 0);

CGate1 = CreateObject(969, 2830.5666503906, -1565.1704101563, 10.096872329712, 0, 0, 250.82507324219);
AGate1 = CreateObject(8378, 3648.7121582031, -651.32238769531, 9.5248832702637, 0, 0, 268.68994140625);
return 1;
}

public OnFilterScriptExit()
{
	return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])//
{
	if (strcmp("/AGate1O", cmdtext, true, 10) == 0)
	{
		MoveObject(AGate1, 3648.7119140625, -651.322265625, -1.7251167297363, 3.5);
		SendClientMessage(playerid, 0xB8860BAA, "The Admin Island Gate Has been opened please use /AGate1C to Close it");
		return 1;
	}
	if (strcmp("/AGate1C", cmdtext, true, 10) == 0)
	{
	  MoveObject(AGate1, 3648.7119140625, -651.322265625, 9.5248832702637, 3.5);
	  SendClientMessage(playerid, 0xB8860BAA, "Thank you the Admin Island Gate has been Closed");
	  return 1;
	} if (strcmp("/MGOPEN1", cmdtext, true, 10) == 0)
	{
      if(pGang[playerid]==2) {
		MoveObject(CGate1, 2832.1252441406, -1555.6474609375, 10.096872329712, 3.5);
		SendClientMessage(playerid, 0xB8860BAA, "The Maldini Family Gate Has Open");
        } else { SendClientMessage(playerid, 0xB8860BAA, "You Can't Open This Gate"); }
		return 1;
	}
	if (strcmp("/MGCLOSE1", cmdtext, true, 10) == 0) {
    if(pGang[playerid]==2) {
	  MoveObject(CGate1, 2830.5666503906, -1565.1704101563, 10.096872329712, 3.5);
	  SendClientMessage(playerid, 0xFFFFFFAA, "Thank you The Maldini Family Gate Has Closed");
      } else { SendClientMessage(playerid, 0xB8860BAA, "You Can't Open This Gate"); }
	  return 1;
	}
	return 0;
}
#endif
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)