13.06.2013, 02:33
Eu tentei fazer vбrios tipos aqui, jб compilou tudo certo, mais depois bugam, e eu nгo to com muito tempo pra mexer com chat lнder. Entгo vim aqui apelar pra ajuda de vocкs, quem poder me ajudar, eu agradeзo.
if(strcmp(cmd, "/lc", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pPosto] < 5)
{
SendClientMessage(playerid, COLOR_GREY, "Vocк nгo й um Lider.");
return 1;
}
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[51];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
CheckText(playerid,result);
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "USE: /lc [Texto]");
return 1;
}
if(strlen(result) >= 50) { SendClientMessage(playerid,COLOR_GREY,"O mбximo de caracteres й de 50."); return 1; }
new Fala[100];
if(PlayerInfo[playerid][pPosto] == 5)
{
format(Fala,sizeof(Fala),"Sub Lнder %s, %s: %s",NomeORG(playerid),sendername,result);
for(new Ele=0; Ele<MAX_PLAYERS; Ele++)
{
if(PlayerInfo[Ele][pPosto] > 4)
{
SendClientMessage(Ele,COLOR_YELLOW2,Fala);
}
}
}
if(PlayerInfo[playerid][pPosto] == 6)
{
format(Fala,sizeof(Fala),"Lнder %s, %s: %s",NomeORG(playerid),sendername,result);
for(new Ele=0; Ele<MAX_PLAYERS; Ele++)
{
if(PlayerInfo[Ele][pPosto] > 4)
{
SendClientMessage(Ele,COLOR_YELLOW2,Fala);
}
}
}
}
return 1;
}
if(strcmp(cmd, "/lchat", true) == 0 || strcmp(cmd, "/liderchat", true) == 0)
{
if(PlayerInfo[playerid][pMuted] == 1)
{
SendClientMessage(playerid, COLOR_YELLOW, "Vocк nгo pode falar, pois foi calado");
return true;
}
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_YELLOW, "USE: /lchat [ Digite ]");
return true;
}
if(TentouDivulgar(result))
{
if(cdivulgar[playerid] >= 4)
{
SendClientMessage(playerid, COLOR_LIGHTBLUE,"Aqui vocк nгo pode anunciar servidores!");
SendClientMessage(playerid, COLOR_LIGHTBLUE,"Seu servidor й uma merda, nгo divulgue-o aqui!");
SendClientMessage(playerid, COLOR_LIGHTBLUE,"Seu noob peguei esse IP e vou divulgar nesse server tambйm, uaheuhaeuhaeahe!");
PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0);
Kick(playerid);
}
GetPlayerName(playerid, playername, MAX_PLAYER_NAME);
format(string, 128, "AdmAviso: [%d]%s tentou divulgar: %s.",playerid,playername,result);
ABroadCast(COLOR_YELLOW,string,1);
DivulgouLog(string);
cdivulgar[playerid] += 1;
return true;
}
if (PlayerInfo[playerid][pCargo] == 5)
{
format(string, sizeof(string), "*Sub-Lнder %s: %s", PlayerName(playerid), result);
ABroadCast(COLOR_YELLOW, string, 1);
}
else if (PlayerInfo[playerid][pCargo] == 6)
{
format(string, sizeof(string), "*Lнder %s: %s", PlayerName(playerid), result);
ABroadCast(COLOR_YELLOW, string, 1);
}
format(string, sizeof(string), "[%d/%d/%d] [%d:%d:%d] *%d : %s: %s", v[2], v[1], v[0], v[3], v[4], v[5] , PlayerInfo[playerid][pCargo], sendername, result);
liderchatLog(string);
}
return true;
}