07.04.2013, 18:18
pawn Код:
CMD:veh(playerid, params[])
{
if(!IsCnRAdmin(playerid)) return SendClientMessage(playerid, COLOR_RED, "You Must Be An Admin To Spawn This Vehicle.");
if(isDead[playerid] == 1) return SendClientMessage(playerid, COLOR_RED, "You Cannot Use This Command When Dead.");
if(GetPlayerInterior(playerid) != 0) return SendClientMessage(playerid, COLOR_RED, "You Cannot Use This Command In An Interior.");
new carName[32];
if(sscanf(params, "s[32]", carName)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /veh (Vehicle Name)");
if(BlockVeh == 1) return SendClientMessage(playerid, COLOR_RED, "This Command Is DISABLED.");
if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_RED, "You Are Already In A Vehicle.");
if(ReturnVehicleID(carName) == INVALID_VEHICLE_ID) return SendClientMessage(playerid, COLOR_RED, "Invalid Vehicle Model.");
if(IsVehicleForbidden(ReturnVehicleID(carName))) return SendClientMessage(playerid, COLOR_RED, "You Must Be An Admin To Spawn This Vehicle.");
new Float:pPos[4], vid;
GetPlayerPos(playerid, pPos[0], pPos[1], pPos[2]);
GetPlayerFacingAngle(playerid, pPos[3]);
vid = CreateVehicle(ReturnVehicleID(carName), pPos[0], pPos[1], pPos[2] + 1.00, pPos[3], 0, 0, 60);
PutPlayerInVehicle(playerid, vid, 0);
return 1;
}