Only id 0 unfreezes.
#1

Hey Guys,

I got a problem. Ive made a race and at the start everyone is freezed then it says 3 2 1 and at GO everyone should be unfreezed. But only id 0 gets unfreezed...

Plz help.

Code:
pawn Код:
public racestart3()
for(new i,g=GetMaxPlayers(); i < g; i ++)
{
    GameTextForAll("GO",1000,5);
    TogglePlayerControllable(i,1);
    return 1;
}
Reply
#2

Quote:
Originally Posted by [ECR
SancheZ ]
Hey Guys,

I got a problem. Ive made a race and at the start everyone is freezed then it says 3 2 1 and at GO everyone should be unfreezed. But only id 0 gets unfreezed...

Plz help.

Code:
pawn Код:
public racestart3()
for(new i,g=GetMaxPlayers(); i < g; i ++)
{
    GameTextForAll("GO",1000,5);
    TogglePlayerControllable(i,1);
    return 1;
}
try:

pawn Код:
public racestart3()
for(new i=0;i<MAX_PLAYERS; i++)
{
    GameTextForAll("GO",1000,5);
    TogglePlayerControllable(i,1);
    return 1;
}

Reply
#3

Quote:
Originally Posted by 0ne
Quote:
Originally Posted by [ECR
SancheZ ]
Hey Guys,

I got a problem. Ive made a race and at the start everyone is freezed then it says 3 2 1 and at GO everyone should be unfreezed. But only id 0 gets unfreezed...

Plz help.

Code:
pawn Код:
public racestart3()
for(new i,g=GetMaxPlayers(); i < g; i ++)
{
    GameTextForAll("GO",1000,5);
    TogglePlayerControllable(i,1);
    return 1;
}
try:

pawn Код:
public racestart3()
for(new i=0;i<MAX_PLAYERS; i++)
{
    GameTextForAll("GO",1000,5);
    TogglePlayerControllable(i,1);
    return 1;
}

Nah still not...
Reply
#4

do a command like:

new InRace[MAX_PLAYERS];

when he joins race

InRace[playerid] = 1; and then on the callback


pawn Код:
public racestart3()
{
    for(new i; i<MAX_PLAYERS; i++)
    {
      if(InRace[i] == 1)
      {
        GameTextForAll("GO",1000,5);
        TogglePlayerControllable(i,1);
      }
    }
}
Reply
#5

Код:
public racestart3()
{
	for(new i,g=GetMaxPlayers(); i < g; i++) if(IsPlayerConnected(i) && !IsPlayerNPC(i))
	{
		GameTextForPlayer(i,"GO",1000,5);
		TogglePlayerControllable(i,1);
		// return 1; it stops the loop so only works on id 0
	}
	return 1;
}
Reply
#6

Quote:
Originally Posted by 0ne
do a command like:

new InRace[MAX_PLAYERS];

when he joins race

InRace[playerid] = 1; and then on the callback


pawn Код:
public racestart3()
{
    for(new i; i<MAX_PLAYERS; i++)
    {
      if(InRace[i] == 1)
      {
        GameTextForAll("GO",1000,5);
        TogglePlayerControllable(i,1);
      }
    }
}
Thanks, works

Sorry Jeff, didnt tested yours cause the one from 0ne already worked.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)