В public OnPlayerCommandText(playerid, cmdtext[])
Code: Select all
if(strcmp(cmd, "/kick", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_CMD, "[INFO] {FFFFFF} /kick [playerid/PartOfName] [reason]");
return 1;
}
giveplayerid = ReturnUser(tmp);
if (PlayerInfo[playerid][pAdmin] >= 1)
{
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
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_CMD, "[INFO] {FFFFFF} /kick [playerid/PartOfName] [reason]");
return 1;
}
format(string, sizeof(string), "{4f7942}Название Сервера{FFFFFF}: %s кикнут администратором %s, причина: %s", giveplayer, sendername, (result));
if(PlayerInfo[giveplayerid][pSex] == 1)
{
format(string, sizeof(string), "{4f7942}Название Сервера{FFFFFF}: %s кикнут администратором %s, причина: %s", giveplayer, sendername, (result));
}
else if(PlayerInfo[giveplayerid][pSex] == 2)
{
format(string, sizeof(string), "{4f7942}Название Сервера{FFFFFF}: %s кикнута администратором %s, причина: %s", giveplayer, sendername, (result));
}
SendClientMessageToAll(COLOR_LIGHTRED, string);
////////////////////////////////////dialog/////////////
new year, month,day;
getdate(year, month, day);
new coordsstring3[512];
new msg3[] = "{FF0000}__________________________________\n\n\t{FF0000}Имя: {FFFFFF}%s\n\t{FF0000}Кикнул(а): {FFFFFF}%s\n\t{FF0000}Дата кика: {FFFFFF}(%d.%d.%d)\n\t{FF0000}Причина: {FFFFFF}%s\n\t{FF0000}Чтобы выйти введите: {FFFFFF}/q\n\t{FF0000}Форум: {FFFFFF}Название Сайта\n\n{FF0000}__________________________________";
format(coordsstring3, sizeof coordsstring3, msg3, giveplayer,sendername,day,month,year,result);
ShowPlayerDialog(giveplayerid,82,DIALOG_STYLE_MSGBOX,"- Вы кикнуты -",coordsstring3,"Выход","");
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Kick(giveplayerid);
return 1;
}
}
}
else
{
format(string, sizeof(string), "Недостаточно прав для использования команды.", giveplayerid);
SendClientMessage(playerid, COLOR_GRAD1, string);
}
}
return 1;
}