03.07.2012, 01:44
pawn Код:
CMD:stretcher(playerid, params[])
{
new seatid, playerb, string[128];
if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
if(!IsALSFMD(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You aren't in the LSFMD faction.");
if(!PlayerInfo[playerid][pFacDuty]) return SendClientMessage(playerid, COLOR_GREY, "You are not on duty.");
if(sscanf(params, "ui", playerb, seatid)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /stretcher [playerid] [seatid]");
if(!IsPlayerLoggedIn(playerb)) return SendClientMessage(playerid, COLOR_GREY, "Invalid player id.");
if(!IsPlayerNearPlayer(playerid, playerb, 2)) return SendClientMessage(playerid, COLOR_GREY, "You can't put them on a stretcher from this distance.");
if(playerid == playerb) return SendClientMessage(playerid, COLOR_GREY, "You can't put your self on the stretcher.");
if(!IsLSFMDVehicle(LastCar[playerid])) return SendClientMessage(playerid, COLOR_GREY, "You need an LSFMD vehicle to put someone on a stretcher.");
if(seatid < 2 || seatid > 3) return SendClientMessage(playerid, COLOR_GREY, "You can only place people in seats 2 and 3.");
format(string, sizeof(string), "* %s grabs %s on the stretcher taking them inside the LSFMD vehicle.", RPN(playerid), RPN(playerb));
SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
PutPlayerInVehicle(playerb, LastCar[playerid], seatid);
return 1;
}