C|R|I|M|E WORLD
Нуль
- Регистрация
- 9 Мар 2012
- Сообщения
- 3
- Лучшие ответы
- 0
- Репутация
- 0
Здраствуйте поситители сайта Павно.Вот решил выложить на сайт команду /vban.Бан на время.Кому понравиться огромная просьба ставить +
PHP:
if(strcmp(cmd, "/vban", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if (PlayerInfo[playerid][pAdmin] >= 1)
{
tmp = strtok(cmdtext,idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "Использование: /ban [id] [Количество дней] [причина]");
return 1;
}
giveplayerid = ReturnUser(tmp);
if(IsPlayerConnected(giveplayerid))
{
tmp = strtok(cmdtext, idx);
if (!strlen(tmp)) return SendClientMessage(playerid, COLOR_WHITE, "Использование: /ban [id] [Количество дней] [причина]");
new days = strval(tmp);
new reason[128];
reason = bigstr(cmdtext, idx);
if (!strlen(reason)) return SendClientMessage(playerid, COLOR_WHITE, "Использование: /ban [id] [Количество дней] [причина]");
new ip[15];
GetPlayerIp(giveplayerid,ip,15);
GetPlayerName(playerid, sendername, sizeof(sendername));
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
new year1, month1, day1, hour1, minute1, second1;
getdate(year1, month1, day1);
gettime(hour1, minute1, second1);
new year,month,day;
getdate(year, month, day);
day += days;
if (IsMonth31(month))
{
if (day > 31)
{
month += 1;
if (month > 12)
{
year += 1;
while(day > 31) day -= 31;
}
else while(day > 31) day -= 31;
}
}
else if (!IsMonth31(month))
{
if (day > 30)
{
month += 1;
if (month > 12)
{
year += 1;
while(day > 30) day -= 30;
}
else while(day > 30) day -= 30;
}
}
else if (!IsMonth31(month) && IsMonth29(year) && month == 2)
{
if (day > 29)
{
month += 1;
if (month > 12)
{
year += 1;
while(day > 29) day -= 29;
}
else while(day > 29) day -= 29;
}
}
else if (!IsMonth31(month) && !IsMonth29(year) && month == 2)
{
if (day > 28)
{
month += 1;
if (month > 12)
{
year += 1;
while(day > 28) day -= 28;
}
else while(day > 28) day -= 28;
}
}
PlayerInfo[giveplayerid][pLocked] = 1;
format(string,256," Администратор %s забанил %s на %d дней, причина: %s.",sendername,giveplayer,days,reason);
SendClientMessageToAll(COLOR_LIGHTRED,string);
format(string,256,"%s, продолжительность: %d, причина: %s, дата разбана:(%d.%d.%d)",sendername,days,reason, day, month, year);
BanEx(giveplayerid, string);
}
else
{
format(string, sizeof(string), " * %d не активный игрок.", giveplayerid);
SendClientMessage(playerid, COLOR_GREY, string);
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Вы не администратор!");
return 1;
}
}
return 1;
}