marin1223 Posted November 25, 2018 Posted November 25, 2018 Am incercat sa fac un admin chat dar nu merge... CMD:adminchat(playerid, params[]) { new mesaj[128], string[128]; if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_ERROR, "Nu esti admin."); if(sscanf(params, "s[128]", mesaj)) return SendClientMessage(playerid, COLOR_SYN, "Foloseste: /adminchat <mesaj>"); { if(PlayerInfo[playerid][pAdmin] > 1 && PlayerInfo[playerid][pAdmin] < 5)format(string, sizeof(string), "Admin %s[lv %d]: %s", GetName(playerid), PlayerInfo[playerid][pAdmin], mesaj); AdminChat(COLOR_AC, string, 1); } return 1; } function AdminChat(color, mesaj[], lv) { foreach(new i : Player) { if(PlayerInfo[pAdmin] >= lv) { SendClientMessage(i, color, mesaj); } } return 1; }
0 AlexxAdv Posted November 25, 2018 Posted November 25, 2018 Iti lipseste multe la functie, iar comanda nu inteleg de ce trebuie sa aiba adminul mai mare decat 1 si mai mic decat 5 atat timp cand ai verificare daca este admin. Ti-am modificat eu codul tau, poftim https://pastebin.com/e80zKTfL
0 marin1223 Posted November 26, 2018 Author Posted November 26, 2018 La 25.11.2018 la 10:32, AlexxAdv a spus: Iti lipseste multe la functie, iar comanda nu inteleg de ce trebuie sa aiba adminul mai mare decat 1 si mai mic decat 5 atat timp cand ai verificare daca este admin. Ti-am modificat eu codul tau, poftim https://pastebin.com/e80zKTfL Acum am observat si eu greseala de la functie. mersi. T/C rezolvat.
Question
marin1223
Am incercat sa fac un admin chat dar nu merge...
CMD:adminchat(playerid, params[])
{
new mesaj[128], string[128];
if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_ERROR, "Nu esti admin.");
if(sscanf(params, "s[128]", mesaj)) return SendClientMessage(playerid, COLOR_SYN, "Foloseste: /adminchat <mesaj>");
{
if(PlayerInfo[playerid][pAdmin] > 1 && PlayerInfo[playerid][pAdmin] < 5)format(string, sizeof(string), "Admin %s[lv %d]: %s", GetName(playerid), PlayerInfo[playerid][pAdmin], mesaj);
AdminChat(COLOR_AC, string, 1);
}
return 1;
}
function AdminChat(color, mesaj[], lv)
{
foreach(new i : Player)
{
if(PlayerInfo[pAdmin] >= lv)
{
SendClientMessage(i, color, mesaj);
}
}
return 1;
}
2 answers to this question
Recommended Posts