Team problems
#1

hey guys im having a little problem so i have my automatic gates with one team but when it have me in team it open but if i put two players in the team it only open for ultimate guy i puted in team i think the team can only have one player so i think if with one define or something can define team to more players so it maybe can start works

thanks for see
Reply
#2

so ppl no one? plz help me
Reply
#3

pawn Код:
if(gTeam[playerid] == team_something)
{
  open gate
}
or you could show your code
Reply
#4

public CheckGate4()
{
for(new i = 0; i < GetMaxPlayers(); i++)
if(PlayerInfo[i][pTeam] == 2 || (PlayerInfo[i][pTeam] == 100))
{
if(!IsPlayerConnected(i)) continue;
if(PlayerToPoint(10.0, i, 2335.227, 2443.460, 8.261) && OpenGate[i] == 0)
{
MoveObject(PoliciaLV2, 2335.227, 2443.460, -2.261, 5);
OpenGate[i] = 1;
}
else if(!PlayerToPoint(10.0, i, 1881.8, 2152.2, 10. && OpenGate[i] == 0)
{
MoveObject(PoliciaLV2, 2335.227, 2443.460, 8.261, 5);
OpenGate[i] = 0;
}
}
}
Reply
#5

use pawn tags
Reply
#6

Quote:
Originally Posted by Voute_Foder
public CheckGate4()
{
for(new i = 0; i < GetMaxPlayers(); i++)
if(PlayerInfo[i][pTeam] == 2 || (PlayerInfo[i][pTeam] == 100))
{
if(!IsPlayerConnected(i)) continue; - ??
if(PlayerToPoint(10.0, i, 2335.227, 2443.460, 8.261) && OpenGate[i] == 0)
{
MoveObject(PoliciaLV2, 2335.227, 2443.460, -2.261, 5);
OpenGate[i] = 1;
}
else if(!PlayerToPoint(10.0, i, 1881.8, 2152.2, 10. && OpenGate[i] == 0)
{
MoveObject(PoliciaLV2, 2335.227, 2443.460, 8.261, 5);
OpenGate[i] = 0;
}
}
}
also i dont get this line:
if(!IsPlayerConnected(i)) continue;

so basically what you are saying is : if the player isnt connected, continue?? ??
Reply
#7

Learn Pawn, then help people -.-'

pawn Код:
if(PlayerToPoint(10.0, i, 2335.227, 2443.460, 8.261) && OpenGate == 0) /*if gate is closed, open it (put value to 1)*/
    {
      MoveObject(PoliciaLV2, 2335.227, 2443.460, -2.261, 5);
     OpenGate = 1;
    }
    else if(!PlayerToPoint(10.0, i, 1881.8, 2152.2, 10.00 && OpenGate == 0)/*else if gate is closed, close it ???*/
    {
      MoveObject(PoliciaLV2, 2335.227, 2443.460, 8.261, 5);
      OpenGate = 0;
Also, your PlayerInfo value is universal for all players or what ?
You need to have it indexed by playerids, so every player will have its own info
Like:
pawn Код:
PlayerInfo[playerid][pTeam] == 2
Reply
#8

i only copied for the wiki samp it have this
Reply
#9

enum pInfo
{
pPassword[128],
pKills,
pDeaths,
pCash,
pBank,
pTeam,
pBanned,
};

new PlayerInfo[MAX_PLAYERS][pInfo];
Reply
#10

so i removed this
pawn Код:
else if(!PlayerToPoint(10.0, i, 1881.8, 2152.2, 10.00 && OpenGate == 0)/*else if gate is closed, close it ???*/
to this

pawn Код:
else if(!PlayerToPoint(10.0, i, 1881.8, 2152.2, 10.00))
but continue dont working
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)