16.06.2013, 22:14
(
Последний раз редактировалось Ananisiki; 15.12.2013 в 18:54.
)
^^^^^^^^
stock RandomPlayer()
{
new count;
for(new i=0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i)) Count++;
}
new Result = Random(Count);
if(IsPlayerConnected(Result)) return Result;
else RandomPlayer();
}
This is not help! Is a request !!
pawn Код:
|
stock RandomPlayer()
{
new ConnectedPlayers[MAX_PLAYERS];
new count;
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
ConnectedPlayers[count] = i;
count++;
}
}
if(count > 0) return ConnectedPlayers[random(count)];
return INVALID_PLAYER_ID;
}
stock RandomPlayer()
{
new ConnectedPlayers[MAX_PLAYERS];
new count;
foreach(new i : Player)
{
ConnectedPlayers[count] = i;
count++;
}
if(count > 0) return ConnectedPlayers[random(count)];
return INVALID_PLAYER_ID;
}
stock RandomPlayer()
{
new ConnectedPlayers[MAX_PLAYERS];
new count;
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
ConnectedPlayers[count] = i;
count++;
SendClientMessage(i,0xF80000,"You've been chosen as a bonus player.");
}
}
if(count > 0) return ConnectedPlayers[random(count)];
return INVALID_PLAYER_ID;
}