Code
else if(strcmp(cmd, "/eject", true) == 0)
{
new State;
if(IsPlayerInAnyVehicle(playerid))
{
State=GetPlayerState(playerid);
if(State!=PLAYER_STATE_DRIVER) return SendClientMessage(playerid,COLOR_GREY,"Вы не водитель!");
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_WHITE, "::: Введите: /eject [id]");
new playa;
playa = ReturnUser(tmp);
new test;
test = GetPlayerVehicleID(playerid);
if(IsPlayerConnected(playa))
{
if(playa != INVALID_PLAYER_ID)
{
if(playa == playerid) { SendClientMessage(playerid, COLOR_GREY, "Вы не можете выкинуть из машины себя!"); return 1; }
if(IsPlayerInVehicle(playa,test))
{
new PName[MAX_PLAYER_NAME];
GetPlayerName(playerid,PName,sizeof(PName));
GetPlayerName(playa, giveplayer, sizeof(giveplayer));
format(string, sizeof(string), "Вы выкинули из машины %s!", giveplayer);
SendClientMessage(playerid, 0x6495EDFF, string);
format(string, sizeof(string), "Вас выкинул из машины %s!", PName);
SendClientMessage(playa, 0x6495EDFF, string);
RemovePlayerFromVehicle(playa);
}
else
{
SendClientMessage(playerid, COLOR_GREY, "Не рядом с вами!");
return 1;
}
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, "[Ошибка] Игрок не найден!");
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, "Вы должны быть в машине!");
}
}
return 1;
}