01.01.2013, 03:39
I create a timer for the gates for Admins.
If player is Admin or Rcon Admin it open the gate.
If it is not. It will not open.
It works fine for me.
But. This code only works on other ids except for ID 0.
If player is Admin or Rcon Admin it open the gate.
If it is not. It will not open.
It works fine for me.
But. This code only works on other ids except for ID 0.
pawn Код:
public GateCheck()
{
foreach(new i : Player)
{
if(IsPlayerInRangeOfPoint(i, 16.0, 259.10000610352,3114.411,3.5999999046326))
{
if(sInfo[AllowPlayers] == 1) //if player allow to enter admin area
{
if(pInfo[i][Admin] == 0) //checks if player is not admin
{
MoveObject(agate, 259.10000610352, 3114.411, -2, 4.00);
}
else if(pInfo[i][Admin] >= 1 || IsPlayerAdmin(i)) //else if player is admin (rcon admin)
{
MoveObject(agate, 259.10000610352, 3114.411, -2, 4.00);
}
}
if(pInfo[i][Admin] >= 1 || IsPlayerAdmin(i)) //checks if player is admin (rcon admin)
{
MoveObject(agate, 259.10000610352, 3114.411, -2, 4.00);
}
}
else
{
if(sInfo[AllowPlayers] == 1) //if player allow to enter admin area
{
if(pInfo[i][Admin] == 0) //checks if player is not admin
{
MoveObject(agate, 259.10000610352, 3114.411, 3.5999999046326, 4.00);
}
else if(pInfo[i][Admin] >= 1 || IsPlayerAdmin(i)) //checks if player is admin (rcon admin)
{
MoveObject(agate, 259.10000610352, 3114.411, 3.5999999046326, 4.00);
}
}
if(pInfo[i][Admin] >= 1 || IsPlayerAdmin(i)) //if player is admin (rcon admin)
{
MoveObject(agate, 259.10000610352, 3114.411, 3.5999999046326, 4.00);
}
}
if(IsPlayerInRangeOfPoint(i, 16.0, 264.62, 3254.86, 2.37))
{
if(sInfo[AllowPlayers] == 1) //i've to explain it? i already explain it
{
if(pInfo[i][Admin] == 0) //read the above explanation
{
MoveObject(agate1, 264.62, 3254.86, -3.5, 4.00);
}
else if(pInfo[i][Admin] >= 1 || IsPlayerAdmin(i)) //read the above explanation
{
MoveObject(agate1, 264.62, 3254.86, -3.5, 4.00);
}
}
if(pInfo[i][Admin] >= 1 || IsPlayerAdmin(i)) //^^
{
MoveObject(agate1, 264.62, 3254.86, -3.5, 4.00);
}
}
else
{
if(sInfo[AllowPlayers] == 1) //^^
{
if(pInfo[i][Admin] == 0) //^^
{
MoveObject(agate1, 264.62, 3254.86, 2.37, 4.00);
}
else if(pInfo[i][Admin] >= 1 || IsPlayerAdmin(i)) //^^
{
MoveObject(agate1, 264.62, 3254.86, 2.37, 4.00);
}
}
if(pInfo[i][Admin] >= 1 || IsPlayerAdmin(i)) //^
{
MoveObject(agate1, 264.62, 3254.86, 2.37, 4.00);
}
}
}
return 1;
}