public OnPlayerText(playerid, text[])
{
new string[128], nomej[MAX_PLAYER_NAME];
GetPlayerName(playerid, nomej, sizeof(nomej));
switch(Profissao[playerid])
{
case 0:{format(string, sizeof(string),"[Civil] %s [%d] diz: %s", nomej, playerid, text),SendClientMessageToAll(-1, string);}
case 1 .. 2:{format(string, sizeof(string),"[PolicialMilitar] %s [%d] diz: %s", nomej, playerid, text),SendClientMessageToAll(0x00FFFFAA, string);}
case 3 .. 4:{format(string, sizeof(string),"[ComandoVermelho] %s [%d] diz: %s", nomej, playerid, text),SendClientMessageToAll(0xFF0000AA, string);}
case 5 .. 6:{format(string, sizeof(string),"[PCC] %s [%d] diz: %s", nomej, playerid, text),SendClientMessageToAll(0xFF8000AA, string);}
case 7 .. 8:{format(string, sizeof(string),"[ADMIN] %s [%d] diz: %s", nomej, playerid, text),SendClientMessageToAll(0xFF80FFAA, string);}
case 9 .. 10:{format(string, sizeof(string),"[GrooveStreet] %s [%d] diz: %s", nomej, playerid, text),SendClientMessageToAll(0x00FF00AA, string);}
}
return 0;
}
new Float:Pos[3], string[128];
GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
format(string, sizeof(string), "%s [ %d ]: %s", Nome(playerid), playerid, text);
for(new i; i < MAX_PLAYERS; i++)
{
if(IsPlayerInRangeOfPoint(i, 10.0, Pos[0], Pos[1], Pos[2]))
{
SendClientMessage(i, -1, string);
}
}
case 1 .. 2:
case 2 .. 3:
if(1 <= Profissao[playerid] <= 2)
switch(Profissao[playerid])
{
case 0:
case 1:
}
PHP Code:
PHP Code:
PHP Code:
|
public OnPlayerText(playerid, text[])
{
new string[128], nomej[MAX_PLAYER_NAME];
GetPlayerName(playerid, nomej, sizeof(nomej));
switch(Profissao[playerid])
{
case 0: format(string, sizeof(string),"[Civil] %s [%d] diz: %s", nomej, playerid, text);
case 1 .. 2: format(string, sizeof(string),"[PolicialMilitar] %s [%d] diz: %s", nomej, playerid, text);
case 3 .. 4: format(string, sizeof(string),"[ComandoVermelho] %s [%d] diz: %s", nomej, playerid, text);
case 5 .. 6: format(string, sizeof(string),"[PCC] %s [%d] diz: %s", nomej, playerid, text);
case 7 .. 8: format(string, sizeof(string),"[ADMIN] %s [%d] diz: %s", nomej, playerid, text);
case 9 .. 10: format(string, sizeof(string),"[GrooveStreet] %s [%d] diz: %s", nomej, playerid, text);
}
for(new i; i < MAX_PLAYERS; i++) if(IsPlayerInRangeOfPoint(i, 10.0, Pos[0], Pos[1], Pos[2])) SendClientMessage(i, 0x00FF00AA, string);
// Foreach й melhor, caso use a include, substitua o
// for(new i; i < MAX_PLAYERS; i++)
// por: foreach(Player, i)
return 0;
}