Sweet_Bridges
Умник
Игрок в наручниках,авто рядом, в вожу /incar ID мест, пишит "Вы далеко от авто!" что не так? вот
Код:
if(strcmp(cmd, "/incar", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
giveplayerid = ReturnUser(tmp);
if (!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "Инфо: /incar [ID] [место]");
return 1;
}
tmp = strtok(cmdtext, idx);
new seat = strval(tmp);
if (!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "Инфо: /incar [ID] [место]");
return 1;
}
if(giveplayerid != INVALID_PLAYER_ID)
{
if(seat < 1 || seat > 3)
{
SendClientMessage(playerid, COLOR_GRAD1, "(( Пассажирское место должно быть от 1 до 3 ))");
return 1;
}
if(IsPlayerInAnyVehicle(giveplayerid))
{
SendClientMessage(playerid, COLOR_GREY, "Ваша цель уже в машине!");
return 1;
}
if(PlayerCuffed[playerid] > 0)
{
SendClientMessage(playerid, COLOR_GREY, "Вы не можете затащить в машину!");
return 1;
}
if (ProxDetectorS(8.0, playerid, giveplayerid))
{
if(GetDistanceBetweenPlayers(playerid,giveplayerid) < 5)
{
new Float:cx,Float:cy,Float:cz;
GetVehiclePos(gLastCar[playerid], cx,cy,cz);
if(!PlayerToPoint(5.0,playerid,cx,cy,cz))
{
SendClientMessage(playerid,COLOR_GREY, "Вы далеко от машины!");
return 1;
}
if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
{
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);
// ClearAnimations(giveplayerid);
// TogglePlayerControllable(giveplayerid, 0);
PutPlayerInVehicle(giveplayerid,gLastCar[playerid],seat);
return 1;
}
else
{
SendClientMessage(playerid, COLOR_LIGHTBLUE, "Вы не можете затащит в машину пока сами в ней¸!");
return 1;
}
}
else
{
SendClientMessage(playerid,COLOR_GREY, "Вы слишком далеко!");
return 1;
}
}
else
{
SendClientMessage(playerid,COLOR_GREY, "Вы слишком далеко!");
return 1;
}
}
}
return 1;
}
