public OnPlayerText(playerid, text[])
{
new str[128];
format(str, sizeof(str), "%s fala: %s", ReturnUser(Name), text[0]);
for (new d = 0; r < MAX_PLAYERS; d++)
{
if(IsPlayerConnected(d))
{
if(IsPlayerInRangeOfPoint(d, 10.0, x, y, z))
{
SendClientMessage(d, -1, str);
}
}
return 0;
}
return 1;
}
if(IsPlayerInRangeOfPoint(d, 10.0, x, y, z))
{
SendClientMessage(d, -1, str);
return 1;
}
public OnPlayerText(playerid, text[])
{
new str[128];
format(str, sizeof(str), "%s fala: %s", ReturnUser(Name), text[0]);
for (new d = 0; r < MAX_PLAYERS; d++)
{
if(IsPlayerConnected(d))
{
if(IsPlayerInRangeOfPoint(d, 10.0, x, y, z))
{
SendClientMessage(d, -1, str);
}
}
}
return false;
}
public OnPlayerText(playerid, text[])
{
new str[128];
format(str, sizeof(str), "%s fala: %s", ReturnUser(Name), text[0]);
for (new d = 0; r < MAX_PLAYERS; d++)
{
if(IsPlayerConnected(d))
{
if(IsPlayerInRangeOfPoint(d, 10.0, x, y, z))
{
SendClientMessage(d, -1, str);
return 0; // ignorar o texto padrгo e enviar a uma mensagem costumizada.
}
}
return 0;
}
return 1;
}
public OnPlayerText(playerid, text[])
{
static
Float:sx[3],
Nome[24],
str[128],
i
;
i = 0;
str[0] = '\0';
Nome[0] = '\0';
format(str, sizeof(str), "%s fala: %s", (GetPlayerName(playerid, Nome, 24), Nome), text[0]);
GetPlayerPos(playerid, sx[0], sx[1], sx[2]);
for( i = GetMaxPlayers(); i > -1; --i){
if(IsPlayerConnected(i)){
if(IsPlayerInRangeOfPoint(, 10.0, sx[0], sx[1], sx[2])){
SendClientMessage(i, -1, str);
}
}
}
return 0;
}
public OnPlayerText(playerid, text[])
{
static a , Float:pos[3];
a = GetMaxPlayers();
GetPlayerPos(playerid,pos[0],pos[1],pos[2]);
format(text, 128, "%s fala: %s", ReturnUser(Name), text); // economizando variбveis.
for (; a > -1; --a)
{
if(!IsPlayerInRangeOfPoint(a, 10.0, pos[0],pos[1],pos[2])) continue; // sem necessidade de checar se estб conectado, isto sу irб funcionar caso esteja conectado.
SendClientMessage(a, -1, text);
}
return 0; // para nгo repetir o texto.
}
Parabйns, pessoal ta sabendo usar o return dentro de loop's.
PHP код:
|
// sem necessidade de checar se estб