22.11.2011, 07:59
My question is:
How can i make that only faction 2 can open Gate2
And faction 1 still gate1, They shouldn't be able to open both.
Only 1 gate each
Would also be appriciated if you would explain how to do that for more then 2 gates like future for example 10 gates. (no need to show it, just explain )
But it needs to stay with the same command.(/open and /close)
Thanks in Advance!
How can i make that only faction 2 can open Gate2
And faction 1 still gate1, They shouldn't be able to open both.
Only 1 gate each
Would also be appriciated if you would explain how to do that for more then 2 gates like future for example 10 gates. (no need to show it, just explain )
But it needs to stay with the same command.(/open and /close)
Thanks in Advance!
PHP код:
if (!strcmp("/open", cmdtext))
{
if(PlayerInfo[playerid][pFaction] != 255 && DynamicFactions[PlayerInfo[playerid][pFaction]][fType] == 1)
{
if(PlayerInfo[playerid][pFaction] != 255 && DynamicFactions[PlayerInfo[playerid][pFaction]][fType] == 2)
if(IsPlayerInRangeOfPoint(playerid, 10.0, 1128.59997559, -1740.90002441, 9.50000000))
{
MoveObject(Gate, 1128.59997559, -1740.90002441, 9.50000000, 1); //fType 1
MoveObject(Gate2, 1412.40002441, -1646.69995117, 15.10000038,1); //fType 2
SendClientMessage(playerid, 0xEF994300, "Opening Gate.");
return 1;
}
}
}
if (!strcmp("/close", cmdtext))
{
if(PlayerInfo[playerid][pFaction] != 255 && DynamicFactions[PlayerInfo[playerid][pFaction]][fType] == 1)
{
if(PlayerInfo[playerid][pFaction] != 255 && DynamicFactions[PlayerInfo[playerid][pFaction]][fType] == 2)
if(IsPlayerInRangeOfPoint(playerid, 10.0, 1128.59997559, -1740.90002441, 15.19999981))
{
MoveObject(Gate, 1128.59997559, -1740.90002441, 15.19999981, 1); // fType 1
MoveObject(Gate2, 1412.4200, -1646.6995, 9.500038,1); // fType 2
SendClientMessage(playerid, 0xEF994300, "Closing Gate.");
return 1;
}
}
}