SA-MP Forums Archive
Help open to all - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Help open to all (/showthread.php?tid=102835)



Help open to all - SlashPT - 17.10.2009

ppl i have a problem with my gates a i have all timers news and allthings but when im near one gate it open all gates here is my code:

pawn Код:
public gate(playerid)
{
  for(new i = 0; i < GetMaxPlayers(); i++)
  if(PlayerInfo[playerid][pTeam] == 3 || (PlayerInfo[playerid][pAdmin] == 10))
  {
 
        {

    if(PlayerToPoint(6.5, i, 1954.939453, 1747.778320, 13.000000) && OpenGate[i] == 0 || OpenGate[playerid] == 1)
    {
      MoveObject(Portao12, 1954.939453, 1747.778320, 1.000000, 7.5);
      OpenGate[i] = 1;
    }
    else if(!PlayerToPoint(6.5, i, 1954.939453, 1747.778320, 13.000000) && OpenGate[i] == 0 || OpenGate[playerid] == 1)
    {
      MoveObject(Portao12, 1954.939453, 1747.778320, 13.000000, 7.5);
      OpenGate[i] = 0;
    }
  }
}
}

public gate2(playerid)
{
  for(new i = 0; i < GetMaxPlayers(); i++)
  if(PlayerInfo[playerid][pTeam] == 3 || (PlayerInfo[playerid][pAdmin] == 10))
  {
 
        {

    if(PlayerToPoint(6.5, i, 2293.847,2948.374,5.768) && OpenGate[i] == 0 || OpenGate[playerid] == 1)
    {
      MoveObject(Portao13, 2293.847,2510.374,5.768, 7.5);
      OpenGate[i] = 1;
    }
    else if(!PlayerToPoint(6.5, i, 2293.847,2948.374,5.768) && OpenGate[i] == 0 || OpenGate[playerid] == 1)
    {
      MoveObject(Portao13, 2293.847,2948.374,5.768, 7.5);
      OpenGate[i] = 0;
    }
  }
}
}



Re: Help open to all - dice7 - 17.10.2009

pawn Код:
if(PlayerToPoint(6.5, i, 1954.939453, 1747.778320, 13.000000) && OpenGate[i] == 0 || OpenGate[playerid] == 1)
The gate will open if its open or closed for the player or what ?
Also, are you using SetTimerEx for the timers ?


Re: Help open to all - SlashPT - 17.10.2009

nope i dont use SettimerEX


Re: Help open to all - SlashPT - 17.10.2009

idk how to use