08.04.2014, 12:43
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
but just copy & paste is not good, provide some code next time
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;
}