09.11.2012, 00:11
(
Последний раз редактировалось smiiir; 27.01.2013 в 22:13.
)
Resolvido.
if(strcmp(cmd, "/radio", true) == 0 || strcmp(cmd, "/r", true) == 0)
{
if(PlayerInfo[playerid][pMuted] == 1)
{
SendClientMessage(playerid, TEAM_CYAN_COLOR, "Vocк nгo pode falar, pois foi calado");
return 1;
}
if(IsPlayerConnected(playerid))
{
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_R, "USE: (/r)adio [radio chat]");
return 1;
}
if(PlayerInfo[playerid][pMembro] == 25 || PlayerInfo[playerid][pLider] == 25)
{
if(PlayerInfo[playerid][pCargo] == 6) { format(string, sizeof(string), "** Comandante %s: %s, over. **", sendername, result); }
else if(PlayerInfo[playerid][pCargo] == 5) { format(string, sizeof(string), "** Capitгo %s: %s, over. **", sendername, result); }
else if(PlayerInfo[playerid][pCargo] == 4) { format(string, sizeof(string), "** Tenente %s: %s, over. **", sendername, result); }
else if(PlayerInfo[playerid][pCargo] == 3) { format(string, sizeof(string), "** Sargento %s: %s, over. **", sendername, result); }
else if(PlayerInfo[playerid][pCargo] == 2) { format(string, sizeof(string), "** Cabo %s: %s, over. **", sendername, result); }
else if(PlayerInfo[playerid][pCargo] == 1) { format(string, sizeof(string), "** Cadete %s: %s, over. **", sendername, result); }
else
{
format(string, sizeof(string), "** Guarda %s: %s, over. **", sendername, result);
}
SendFamilyMessage(1,COLOR_R,string);
printf("%s", string);
format(string, sizeof(string), "* %s falou algo no rбdio.", sendername);
ProxDetector(20.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
return 1;
}
if(strcmp(cmd, "/departamento", true) == 0 || strcmp(cmd, "/d", true) == 0)
{
if(IsPlayerConnected(playerid))
{
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_DEPARTAMENTO, "USE: (/d)epartamento [Texto]");
return 1;
}
else if(PlayerInfo[playerid][pMembro] == 25 || PlayerInfo[playerid][pLider] == 25)
{
if(PlayerInfo[playerid][pCargo] == 6) { format(string, sizeof(string), "** Fuzileiros Lнder %s: %s, cвmbio. **", sendername, result); }
else if(PlayerInfo[playerid][pCargo] == 5) { format(string, sizeof(string), "** FN %s: %s, cвmbio. **", sendername, result); }
else if(PlayerInfo[playerid][pCargo] == 4) { format(string, sizeof(string), "** FN %s: %s, cвmbio. **", sendername, result); }
else if(PlayerInfo[playerid][pCargo] == 3) { format(string, sizeof(string), "** FN %s: %s, cвmbio. **", sendername, result); }
else if(PlayerInfo[playerid][pCargo] == 2) { format(string, sizeof(string), "** FN %s: %s, cвmbio. **", sendername, result); }
else if(PlayerInfo[playerid][pCargo] == 1) { format(string, sizeof(string), "** FN %s: %s, cвmbio. **", sendername, result); }
else
{
format(string, sizeof(string), "** FN %s: %s, cвmbio. **", sendername, result);
}
SendFamilyMessage(2, COLOR_DEPARTAMENTO, string);
SendFamilyMessage(1, COLOR_DEPARTAMENTO, string);
SendFamilyMessage(3, COLOR_DEPARTAMENTO, string);
SendFamilyMessage(16, COLOR_DEPARTAMENTO, string);
SendFamilyMessage(7, COLOR_DEPARTAMENTO, string);
SendFamilyMessage(11, COLOR_DEPARTAMENTO, string);
SendFamilyMessage(4, COLOR_DEPARTAMENTO, string);
printf("%s", string);
return 1;
}
if(strcmp(cmd, "/radio", true) == 0 || strcmp(cmd, "/r", true) == 0)
{
if(PlayerInfo[playerid][pMuted] == 1)
{
SendClientMessage(playerid, TEAM_CYAN_COLOR, "Vocк nгo pode falar, pois foi calado");
return 1;
}
if(IsPlayerConnected(playerid))
{
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_R, "USE: (/r)adio [radio chat]");
return 1;
}
if(PlayerInfo[playerid][pMembro] == 25 || PlayerInfo[playerid][pLider] == 25)
{
if(PlayerInfo[playerid][pCargo] == 6) { format(string, sizeof(string), "** Comandante %s: %s, over. **", sendername, result); }
else if(PlayerInfo[playerid][pCargo] == 5) { format(string, sizeof(string), "** Capitгo %s: %s, over. **", sendername, result); }
else if(PlayerInfo[playerid][pCargo] == 4) { format(string, sizeof(string), "** Tenente %s: %s, over. **", sendername, result); }
else if(PlayerInfo[playerid][pCargo] == 3) { format(string, sizeof(string), "** Sargento %s: %s, over. **", sendername, result); }
else if(PlayerInfo[playerid][pCargo] == 2) { format(string, sizeof(string), "** Cabo %s: %s, over. **", sendername, result); }
else if(PlayerInfo[playerid][pCargo] == 1) { format(string, sizeof(string), "** Cadete %s: %s, over. **", sendername, result); }
else
{
format(string, sizeof(string), "** Guarda %s: %s, over. **", sendername, result);
}
SendFamilyMessage(25,COLOR_R,string);
printf("%s", string);
format(string, sizeof(string), "* %s falou algo no rбdio.", sendername);
ProxDetector(20.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
return 1;
}
if(strcmp(cmd, "/departamento", true) == 0 || strcmp(cmd, "/d", true) == 0)
{
if(IsPlayerConnected(playerid))
{
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_DEPARTAMENTO, "USE: (/d)epartamento [Texto]");
return 1;
}
else if(PlayerInfo[playerid][pMembro] == 25 || PlayerInfo[playerid][pLider] == 25)
{
if(PlayerInfo[playerid][pCargo] == 6) { format(string, sizeof(string), "** Fuzileiros Lнder %s: %s, cвmbio. **", sendername, result); }
else if(PlayerInfo[playerid][pCargo] == 5) { format(string, sizeof(string), "** FN %s: %s, cвmbio. **", sendername, result); }
else if(PlayerInfo[playerid][pCargo] == 4) { format(string, sizeof(string), "** FN %s: %s, cвmbio. **", sendername, result); }
else if(PlayerInfo[playerid][pCargo] == 3) { format(string, sizeof(string), "** FN %s: %s, cвmbio. **", sendername, result); }
else if(PlayerInfo[playerid][pCargo] == 2) { format(string, sizeof(string), "** FN %s: %s, cвmbio. **", sendername, result); }
else if(PlayerInfo[playerid][pCargo] == 1) { format(string, sizeof(string), "** FN %s: %s, cвmbio. **", sendername, result); }
else
{
format(string, sizeof(string), "** FN %s: %s, cвmbio. **", sendername, result);
}
SendFamilyMessage(2, COLOR_DEPARTAMENTO, string);
SendFamilyMessage(1, COLOR_DEPARTAMENTO, string);
SendFamilyMessage(3, COLOR_DEPARTAMENTO, string);
SendFamilyMessage(25 COLOR_DEPARTAMENTO, string);
SendFamilyMessage(16, COLOR_DEPARTAMENTO, string);
SendFamilyMessage(7, COLOR_DEPARTAMENTO, string);
SendFamilyMessage(11, COLOR_DEPARTAMENTO, string);
SendFamilyMessage(4, COLOR_DEPARTAMENTO, string);
printf("%s", string);
return 1;
}