_ReZaK_
Умник
Команда для полиции чтоб затащить преступника в служебное авто для мода GF
PHP:
if(strcmp(cmd, "/incar", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(!IsACop(playerid)) { return 1; }
new vid = GetPlayerVehicleID(playerid);
if(IsPlayerInVehicle(playerid, vid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
new model = GetVehicleModel(vid);
if(model == 427 || model == 470 || model == 490 || model == 497 || model == 596 || model == 597 || model == 598)
{
tmp = strtok(cmdtext, idx);
giveplayerid = ReturnUser(tmp);
if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_GRAD1, " Используйте: /incar [playerid] [пассажирское место(2 или 3)]");
tmp = strtok(cmdtext, idx);
new seat = strval(tmp);
if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_GRAD1, " Используйте: /incar [playerid] [пассажирское место(2 или 3)]");
if(giveplayerid != INVALID_PLAYER_ID)
{
if(PlayerTied[giveplayerid] != 1 && PlayerCuffed[giveplayerid] != 2) return SendClientMessage(playerid, COLOR_GRAD1, " * На преступника нужно сначала надеть наручники!");
if(seat < 2 || seat > 3) return SendClientMessage(playerid, COLOR_GRAD1, " * Пассажирское место должно быть 2 или 3 ");
if(IsPlayerInAnyVehicle(giveplayerid)) return SendClientMessage(playerid, COLOR_GRAD1, " * Преступник уже в машине");
if(PlayerCuffed[playerid] > 0) return SendClientMessage(playerid, COLOR_GRAD1, " * Вы не можете затащить в машину");
if(!ProxDetectorS(8.0, playerid, giveplayerid)) return SendClientMessage(playerid,COLOR_GRAD1, " * Вы слишком далеко от игрока");
if(GetDistanceBetweenPlayers(playerid,giveplayerid) > 5) return SendClientMessage(playerid,COLOR_GRAD1, " * Вы слишком далеко от игрока");
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), " %s посадил Вас в машину", sendername);
SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), " Вы посадили %s в машину", giveplayer);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), " %s заламывает руку %s и садит в машину", sendername ,giveplayer);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
GameTextForPlayer(giveplayerid, "~r~dragged in car", 2500, 3);
PutPlayerInVehicle(giveplayerid,vid,seat);
return 1;
}
}
else { SendClientMessage(playerid, COLOR_GRAD1, " * Вы не в патрульном ТС"); return 1; }
}
else { SendClientMessage(playerid, COLOR_GRAD1, " * Вы должны быть в ТС и на водительском месте"); return 1; }
}
return 1;
}
