eject help is player in a player vehicle
#3

if(ID == IsPlayerInVehicle(playerid)) - is wrong becose you check if selected id/target is equally to you(playerid)

pawn Код:
command(ej, playerid, params[])
{
    new ID;
    if(sscanf(params,"u",ID)) return  SendClientMessage(playerid,AC,"Usage: /ej [playerid]");
    else if(!IsPlayerConnected(ID)) return SendClientMessage(playerid,-1,"ERROR:This player isn't connected");
    else
    {
        if(IsPlayerInVehicle(ID))
        {
            new Float:xposs, Float:y, Float:z;
            RemovePlayerFromVehicle(ID);
            GetPlayerPos(ID, xposs, y, z);
            SetPlayerPos(ID, xposs, y, z+3);
            SendClientMessage(ID, GREY,"You Have Been Ejected From The Vehcile.");
            SendClientMessage(playerid, COLOR_RED, "Player Ejected.");
        }
        else SendClientMessage(playerid, COLOR_RED, "The Player That You Are Trying To Eject Isn't In Your Vehicle.");
    }
    return 1;
}
Reply


Messages In This Thread
eject help is player in a player vehicle - by HardBoy - 07.11.2012, 09:40
Re: eject help is player in a player vehicle - by cosbraa - 07.11.2012, 09:44
Re: eject help is player in a player vehicle - by doreto - 07.11.2012, 09:47
Re: eject help is player in a player vehicle - by HardBoy - 07.11.2012, 10:06
Re: eject help is player in a player vehicle - by HardBoy - 07.11.2012, 10:08

Forum Jump:


Users browsing this thread: 1 Guest(s)