28.11.2012, 10:25
Here's the command using ZCMD and sscanf! You require them in your script to use this command!
pawn Код:
COMMAND:eject(playerid, params[])
{
if (IsPlayerConnected(playerid))
{
new player,string[80];
if(sscanf(params,"u",player)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /eject [playerid/partofname]]");
if(!IsPlayerConnected(player)) return SendClientMessage(playerid, COLOR_GREY, "Invalid Player. That Player is not connected to the server.");
if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to be in a vehicle to use this command.");
if(!IsPlayerInAnyVehicle(player)) return SendClientMessage(playerid, COLOR_GREY, "That player is not in any vehicle.");
new vid = GetPlayerVehicleID(playerid),pid = GetPlayerVehicleID(player),pname[MAX_PLAYERS],plname[MAX_PLAYERS];
if(vid != pid) return SendClientMessage(playerid, COLOR_GREY, "That player needs to be in your vehicle to eject them.");
GetPlayerName(playerid, pname, sizeof(pname)),GetPlayerName(player, plname, sizeof(plname));
format(string, sizeof(string), "* You have been ejected by %s from their vehicle.", pname);
SendClientMessage(player,COLOR_YELLOW,string);
format(string, sizeof(string), "* You have ejected %s from your vehicle.", plname);
SendClientMessage(playerid,COLOR_YELLOW,string);
}
return 1;
}