[EJECT PASSANGER ] [+REP]
#8

Quote:
Originally Posted by SPA
Посмотреть сообщение
I dont think this will eject the passangers
correct, it wasn't meant to be abel to eject a client from a vehicle.

i did say that this is a control structure to check if the client executing
this command is actuallythe driver or not.

this is only the control strudture.
i didn't understand yu correctly at first so i tought that's what you've wanted.

a finished command for something like this would look like
pawn Код:
YCMD:eject(playerid, params[], help)
{
    if(help) SendClientMessage(playerid, gray, "/eject is used to eject a player from a vehicle");
    new id;
    if(sscanf(params,"d",id)) return SendClientMessage(playerid,red,"USAGE: /eject [Player-ID]");
    if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,red,"You have to be the driver of a vehicle");
    if(id == playerid) return SendClientMessage(playerid,red,"You can't eject yourself...");
    if(GetPlayerVehicleID(playerid) != GetPlayerVehicleID(id)) return SendClientMessage(playerid,red,"That player ain't here...");
    if(!(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)) return SendClientMessage(playerid,red,"You're not the driver of this vehicle.");
   
    RemovePlayerFromVehicle(id);
    GameTextForPlayer(id,"you got ~r~ejected!",3000,3);
    SendClientMessage(playerid,-1,"you've just ejected that player.");
    return 1;
}
but just copy & paste is not good, provide some code next time
Reply


Messages In This Thread
[EJECT PASSANGER ] [+REP] - by SPA - 08.04.2014, 11:38
Re: [EJECT PASSANGER ] [+REP] - by xVIP3Rx - 08.04.2014, 11:41
Re: [EJECT PASSANGER ] [+REP] - by CutX - 08.04.2014, 11:47
Re: [EJECT PASSANGER ] [+REP] - by Abagail - 08.04.2014, 11:53
Re: [EJECT PASSANGER ] [+REP] - by CutX - 08.04.2014, 12:09
Re: [EJECT PASSANGER ] [+REP] - by SPA - 08.04.2014, 12:34
Re: [EJECT PASSANGER ] [+REP] - by SPA - 08.04.2014, 12:40
Re: [EJECT PASSANGER ] [+REP] - by CutX - 08.04.2014, 12:43
Re: [EJECT PASSANGER ] [+REP] - by ChandraLouis - 08.04.2014, 12:45
Re: [EJECT PASSANGER ] [+REP] - by xVIP3Rx - 08.04.2014, 12:45

Forum Jump:


Users browsing this thread: 1 Guest(s)