CMD:vida(playerid) { SetPlayerHeatlh(playerid, 100); // Isso serve para dar sangue aos players.
CMD:vida(playerid)
{
for(new x = 0; x < MAX_PLAYERS; x++) { //o "x" determina o numero de players e executara a funзгo a tds eles
SetPlayerHeatlh(x, 100);//em vez do "playerid" q seria so um(o q digitou o comando).
}
return 1;
}
for(new i = 0; i < MAX_PLAYERS; i++) // Aqui й o Loop que a Variбvel i Executara para MAX_PLAYERS ou seja, Todos os Slots do Servidor
{ // Abre Chaves
SetPlayerHealth(i, 100); // Determinarб que a Vida Mudarб para 100 Para Todos que Pertencem a Variбvel "i", ou Seja, Todos os Players
} // Fecha Chaves
if(GetDistanceBetweenPlayers(playerid, i) <= 50.0)
CMD:coletet(playerid) { if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, VERMELHO, "ERRO: Vocк nгo й um adiministrador para usar esse comando."); for(new x = 0; x < MAX_PLAYERS; x++) { SetPlayerArmour(x, 100); new nome[MAX_PLAYER_NAME], stringnome[300]; GetPlayerName(playerid, nome, sizeof(nome)); format(stringnome, sizeof(stringnome), "** O jogador %s deu colete a todos perto dele.",nome); SendClientMessageToAll(AMARELO, stringnome); } return 1; }
if(GetDistanceBetweenPlayers(playerid, i) <= 50.0)
Intao, onde eu coloco esse codigo, quero assim, pra todos perto de quem vai dar o colete.
Ajeitei o cуdigo e tб assim. Код:
CMD:coletet(playerid) { if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, VERMELHO, "ERRO: Vocк nгo й um adiministrador para usar esse comando."); for(new x = 0; x < MAX_PLAYERS; x++) { SetPlayerArmour(x, 100); new nome[MAX_PLAYER_NAME], stringnome[300]; GetPlayerName(playerid, nome, sizeof(nome)); format(stringnome, sizeof(stringnome), "** O jogador %s deu colete a todos perto dele.",nome); SendClientMessageToAll(AMARELO, stringnome); } return 1; } Код:
if(GetDistanceBetweenPlayers(playerid, i) <= 50.0) |
CMD:coletet(playerid)
{
new Float:X, Float:Y, Float:Z;
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, VERMELHO, "ERRO: Vocк nгo й um adiministrador para usar esse comando.");
GetPlayerPos(playerid, X, Y, Z);
for(new x = 0; x < MAX_PLAYERS; x++) {
if(IsPlayerInRangeOfPoint(x, 50.0, X, Y, Z))
{
SetPlayerArmour(x, 100);
new nome[MAX_PLAYER_NAME], stringnome[300];
GetPlayerName(playerid, nome, sizeof(nome));
format(stringnome, sizeof(stringnome), "** O jogador %s deu colete a todos perto dele.",nome);
SendClientMessageToAll(AMARELO, stringnome);
}
}
return 1;
}