Jump to content
  • 0

pomoc Zdvojuje se text podle toho, kolik je hraču na serveru.


LemoNSK

Dotaz

Nazdar lidi, potřebuju poradit. Chci udělat event ale mě se to zdvojuje ten text když zapnu port pro každého hráče a ten kdo napíše ten přikaz tak ho to portne a do chatu napíše 2 podle toho kolik je na serveru lidí. Když to víte opravit tak prosím opravte dekuju.

for(new i=0; i<MAX_PLAYERS; i++)
{
    if(IsPlayerConnected(i))
    {

      	new pName[70];
        new string[185];
	GetPlayerName(playerid, pName, 28);
format(string, sizeof(string), "[ DOPLNKY ] RCON Administrátor %s povolil port Parkour Event (/pevent)", pName);

SendClientMessageToAll(COLOR_YELLOW, string);
ParkourP[i] = 1;
				    	}
			    	}
			    }
			    
			    case 1:
			    {
			        for(new i=0; i<MAX_PLAYERS; i++)
      				{
      					if(IsPlayerConnected(i))
				  		{
      						new pName[70];
							new string[185];
							GetPlayerName(playerid, pName, 28);
							format(string, sizeof(string), "[ DOPLNKY ] RCON Administrátor %s zakázal port Parkour Event", pName);
				    		SendClientMessageToAll(COLOR_YELLOW, string);
			        		ParkourP[i] = 0;
						}
					}
			    }
			}
 	    }
	}
Link to comment
Share on other sites

4 odpovědí na tuto otázku

Recommended Posts

  • 0
case 0:{
new pName[70];
new string[185];
GetPlayerName(playerid, pName, 28);
format(string, sizeof(string), "[ DOPLNKY ] RCON Administrátor %s povolil port Parkour Event (/pevent)", pName);

SendClientMessageToAll(COLOR_YELLOW, string);
for(new i=0; i<MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
ParkourP[i] = 1;
}
}
}
case 1:
{
new pName[70];
new string[185];
GetPlayerName(playerid, pName, 28);
format(string, sizeof(string), "[ DOPLNKY ] RCON Administrátor %s zakázal port Parkour Event", pName);
SendClientMessageToAll(COLOR_YELLOW, string);
for(new i=0; i<MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
ParkourP[i] = 0;
}
}
}
}
}
}

Děkuju mnohokrát za tvou radu! Ale stejně to píše 1 warning: 

C:\Users\Lemon\Desktop\doplnkyl.pwn(824) : warning 219: local variable "i" shadows a variable at a preceding level
Link to comment
Share on other sites

  • 0


case 0:{
new pName[70];
new string[185];
GetPlayerName(playerid, pName, 28);
format(string, sizeof(string), "[ DOPLNKY ] RCON Administrátor %s povolil port Parkour Event (/pevent)", pName);

SendClientMessageToAll(COLOR_YELLOW, string);
for(new i=0; i<MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
ParkourP[i] = 1;
}
}
}
case 1:
{
new pName[70];
new string[185];
GetPlayerName(playerid, pName, 28);
format(string, sizeof(string), "[ DOPLNKY ] RCON Administrátor %s zakázal port Parkour Event", pName);
SendClientMessageToAll(COLOR_YELLOW, string);
for(new o=0; o<MAX_PLAYERS; o++)
{
if(IsPlayerConnected(o))
{
ParkourP[o] = 0;
}
}
}
}
}
}

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...