dsd
Дебютант
Есть команда, посадить игрока за нарушение оффлайн. Не могу никак додуматься, как сделать так, что бы при входе на сервер, игрок которого посадили оффлайн получил уведомление об этом. Что-то вроде: Вы были изолированы администратором "Имя_Фамилия". Причина: "Текст".
HTML:
else if(strcmp(cmd, "/offprison", true) == 0)
{
if (PlayerInfo[playerid][pAdmin] >= 3)
{
//new barbos;
//barbos = GetPlayerName(playerid, PlayerInfo[playerid][pNames], MAX_PLAYER_NAME);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_GREY, "Ââåäèòå: /offprison [Nick_Name] [âðåìÿ] [ïðè÷èíà]");
format(string, sizeof(string), "%s.ini", tmp);
if(fexist(string))
{
new yamomoto[256];
yamomoto = strtok(cmdtext, idx);
new money = strval(yamomoto);
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;
format(string, sizeof(string), "%s.ini", tmp);
new File = ini_openFile(string);
ini_setString(File,"PrisonAdmin",giveplayerid);
ini_setInteger(File,"Text",5);
ini_setInteger(File,"HospitalTime",0);
ini_setInteger(File,"Jailed",4);
ini_setInteger(File,"JailTime",money*60);
ini_setString(File,"PrisonReason",result);
ini_setString(File,"ReasonPlayer",result);
ini_closeFile(File);
format(string, sizeof(string), "Àäìèíèñòðàòîð %s èçîëèðîâàë(à) %s íà %d ìèíóò(û). Ïðè÷èíà: %s", sendername, giveplayerid, money, result);
SendClientMessageToAll(COLOR_LIGHTRED,string);
}
else
{
format(string, sizeof(string), "Ôàéë àêêàóíòà íå íàéäåí.");
SendClientMessage(playerid, COLOR_GREY, string);
}
}
return 1;
}
