Всем привет сегодня хочу дать вам команду алкотест! Скринов нету так-как на себе нельзя проверить!
Вот код
Вот код
Код:
if(strcmp(cmd,"/alcotest",true)==0)
{
if(IsPlayerConnected(playerid))
{
if(!IsACop(playerid))
{
SendClientMessage(playerid, COLOR_GREY, "Вы не сотрудник полиции!");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_ISPOLZUY, "Используйте: /alcotest [ид игрока]");
return 1;
}
giveplayerid = ReturnUser(tmp);
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
if (ProxDetectorS(8.0, playerid, giveplayerid))
{
if(giveplayerid == playerid){SendClientMessage(playerid, COLOR_GREY, "Вы не можете провести тест самому себе!");return 1;}
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
new text1[20];
if(PlayerDrunk[giveplayerid] > 1) { text1 = "пьян"; } else { text1 = "трезв"; }
format(string, sizeof(string), "|__________ Тест %s на алкогольное опьянение __________|", giveplayer);
SendClientMessage(playerid, COLOR_WHITE, string);
format(string, sizeof(string), "Результат теста: Водитель %s", text1);
SendClientMessage(playerid, COLOR_GREY, string);
format(string, sizeof(string), "* %s проводит тест %s на алкогольное опьянение", sendername ,giveplayer);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
else
{
SendClientMessage(playerid, COLOR_GREY, "Игрок далеко от вас!");
return 1;
}
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, "Игрок не в сети!");
return 1;
}
}
return 1;
}
Последнее редактирование модератором: