Bonsoir à tous,
Voila, jai mit un chat admin, et j'ai ajouter une fonction (qui vien du R@S) qui permet de stocker les phrase dans un scriptfile.
Voila la commande+fonction:
if(strcmp(cmdtext, "!!", true, 2) == 0)
{
if(AdminLvL[playerid] < 1) return 1;
new tmp[255];
new tmpp[256];
new tmppp[256];
new pName[MAX_PLAYER_NAME];
new Year, Month, Day;
new Hour, Minute;
gettime(Hour, Minute);
getdate(Year, Month, Day);
tmp = strtok (cmdtext, idx);
GetPlayerName(playerid, pName, sizeof(pName));
if (strlen (tmp) == 0)
{
SendClientMessage(playerid, COLOR_ORANGE, "Utilisation: !! (texte)");
return 1;
}
if (strlen (cmdtext[3]) != 0)
{
format(tmpp, sizeof(tmpp), "[Admin Chat] %s: %s", pName, cmdtext[3]);
SendAdminChat(vertfluo, tmpp);
format(tmpp, sizeof(tmpp), "[%02d/%02d/%02d][%02dh%02d][Admin Chat] %s: %s", Day, Month, Year, Hour, Minute,pName, cmdtext[3]);
}
ACL(tmppp);
return 1 ;
}
ACL(string[])
{
new tmp[256];
format(tmp, sizeof(tmp), "%s \r\n",string);
new File:hFile;
hFile = fopen("LOGS/Adminchat.txt", io_append);
fwrite(hFile, tmp);
fclose(hFile);
}
Le probleme c'est que la phrase avec la date et l'heure ne veut pas s'afficher dans le log. Si je choisi d'enregistrer la phrase SANS la date, ca marche ...
(je précise, la date c'est uniquement pour le log, pas ingame ..)
Voila si vous trouvé la solution .. :)
MErci
++
nikko