public OnPlayerText(playerid, text[]) { if(text[0] == '.') { if(!IsPlayerConnected(playerid)) return SendClientMessage(playerid, -1, "[x] Vocк tem que estar logado para usar o chat do clг!"); format(pFile, sizeof(pFile), "clas/%s.ini", PlayerName(playerid)); if(dini_Exists(pFile)) { if(strcmp(dini_Get(pFile, "cla"), "Nenhum", false)) { new tmp[128] ; strmid(tmp, text, 1, strlen(text)); if(!strlen(tmp)) { SendClientMessage(playerid, COR_BRANCO, "[ > ] Uso correto: . [texto]"); return 0; } else { for(new c = 0; c < MAX_PLAYERS; c++) { if(IsPlayerConnected©) { format(gFile, sizeof(gFile), "clas/%s.ini", PlayerName©); if(strcmp(dini_Get(gFile, "cla"), "Nenhum", false)) { if(strcmp(dini_Get(gFile, "cla"), dini_Get(pFile, "cla"), true) == 0) { format(gstring, sizeof(gstring), "( C/C ) %s: %s", PlayerName(playerid), tmp); SendClientMessage(c, 0x00FF00AA, gstring); } } } } return 0; } } } } return 1; }
new bool: pLogged[MAX_PLAYERS]; // global public OnPlayerText(playerid, text[]) { if(!pLogged[playerid]) return 0; return 1; }
new bool:Logado[MAX_PLAYERS] = false;
public onPlayerSpawn(playerid)
{
if(Logado[playerid] == false)
{
Logado[playerid] = true;
}
}
public OnPlayerText(playerid, text[])
{
if(text[0] == '.')
{
if(Logado[playerid] == false) return SendClientMessage(playerid, -1, "[x] Vocк tem que estar logado para usar o chat do clг!");
format(pFile, sizeof(pFile), "clas/%s.ini", PlayerName(playerid));
if(dini_Exists(pFile))
{
if(strcmp(dini_Get(pFile, "cla"), "Nenhum", false))
{
new
tmp[128]
;
strmid(tmp, text, 1, strlen(text));
if(!strlen(tmp))
{
SendClientMessage(playerid, COR_BRANCO, "[ > ] Uso correto: . [texto]");
return 0;
}
else
{
for(new c = 0; c < MAX_PLAYERS; c++)
{
if(IsPlayerConnected(c))
{
format(gFile, sizeof(gFile), "clas/%s.ini", PlayerName(c));
if(strcmp(dini_Get(gFile, "cla"), "Nenhum", false))
{
if(strcmp(dini_Get(gFile, "cla"), dini_Get(pFile, "cla"), true) == 0)
{
format(gstring, sizeof(gstring), "( C/C ) %s: %s", PlayerName(playerid), tmp);
SendClientMessage(c, 0x00FF00AA, gstring);
}
}
}
}
return 0;
}
}
}
}
return 1;
}
new bool:Logado[MAX_PLAYERS]; public OnPlayerSpawn(playerid) { if(Logado[playerid] == false) Logado[playerid] = true; return 1; } public OnPlayerDisconnect(playerid, reason) { if(Logado[playerid] == true) Logado[playerid] = false; return 1; } public OnPlayerText(playerid, text[]) { if(Logado[playerid] == false) { SendClientMessage(playerid, -1, "[x] Vocк tem que estar logado para usar o chat!"); return 0; } if(text[0] == '.') { format(pFile, sizeof(pFile), "clas/%s.ini", PlayerName(playerid)); if(dini_Exists(pFile)) { if(strcmp(dini_Get(pFile, "cla"), "Nenhum", false)) { new tmp[128] ; strmid(tmp, text, 1, strlen(text)); if(!strlen(tmp)) { SendClientMessage(playerid, COR_BRANCO, "[ > ] Uso correto: . [texto]"); return 0; } else { for(new c = 0; c < MAX_PLAYERS; c++) { if(IsPlayerConnected©) { format(gFile, sizeof(gFile), "clas/%s.ini", PlayerName©); if(strcmp(dini_Get(gFile, "cla"), "Nenhum", false)) { if(strcmp(dini_Get(gFile, "cla"), dini_Get(pFile, "cla"), true) == 0) { format(gstring, sizeof(gstring), "( C/C ) %s: %s", PlayerName(playerid), tmp); SendClientMessage(c, 0x00FF00AA, gstring); } } } } return 0; } } } } return 1; }
new bool:Logado[MAX_PLAYERS]; public OnPlayerConnect(playerid) { Logado[playerid] = false; return 1; } public OnPlayerSpawn(playerid) { Logado[playerid] = true; return 1; }
Olб Kanuy, infelizmente tambйm nгo funcionou, era pra ser uma coisa tгo simples mas nгo funciona kk
|
Como exatamente vocк usa o chat para falar? Precisamos saber. Vocк disse que й em dialog?
|
new bool:pUSARCHATCLAN[MAX_PLAYERS]; public OnPlayerConnect(playerid) { pUSARCHATCLAN[playerid] = false; return 1; } public OnPlayerSpawn(playerid) { pUSARCHATCLAN[playerid] = true; return 1; } public OnPlayerText(playerid, text[]) { if(pUSARCHATCLAN[playerid] == false) return SendClientMessage(playerid, -1, "Nгo й possivel usar o chat"); return 0; }