[Help] Faction command restrictions. - 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: [Help] Faction command restrictions. (
/showthread.php?tid=488586)
[Help] Faction command restrictions. -
BornHuman - 18.01.2014
I have this under my /gate command:
Код:
if(Faction[playerid] >= 1)
Is their anyway I could get it so only factions 1 and 2 can do it? Or maybe 1 between 3? I wanted SFPD and Government to be able to open it (1 and 2) but not Citizens or SFES (0 and 3) Anyway to do this?
Код:
CMD:gate(playerid)
{
if(Faction[playerid] >= 1)
{
if(IsPlayerInRangeOfPoint(playerid, 20.0, -1631.0911,688.6709,7.1875) && gStatus == false)
{
MoveDynamicObject(SFPDGate1, -1639.82, 688.49, 6.37, 2.9);
MoveDynamicObject(SFPDGate2, -1639.82, 688.49, 6.37, 2.9);
gStatus = true;
}
else if(IsPlayerInRangeOfPoint(playerid, 20.0, -1631.0911,688.6709,7.1875) && gStatus == true)
{
MoveDynamicObject(SFPDGate1, -1623.43, 688.50, 6.37, 2.9);
MoveDynamicObject(SFPDGate2, -1631.32, 688.49, 6.37, 2.9);
gStatus = false;
}
return 1;
}
return SendClientMessage(playerid, COLOR_NEWBIE, "You don't have access to this gate!");
}
Re: [Help] Faction command restrictions. -
Smally - 18.01.2014
pawn Код:
//Change
if(Faction[playerid] >= 1)
//to
if(Faction[playerid] == 1 || Faction[playerid] == 2)
Re: [Help] Faction command restrictions. -
BornHuman - 18.01.2014
Quote:
Originally Posted by Smally
pawn Код:
//Change if(Faction[playerid] >= 1) //to if(Faction[playerid] == 1 || Faction[playerid] == 2)
|
Thx bbycakes.
REP +