new vehicle_shar[MAX_PLAYERS],
Text3D:vehicle_3dtext[MAX_VEHICLES];
CMD:vozdush(playerid)
{
if(!PI[playerid][pShar]) return ErrorMessage(playerid, "У вас нету воздушного шара. Купить его можно в /donate");
CreateVozdushShar(playerid,19338);
return true;
}
stock CreateVozdushShar(playerid,idobj)
{
if(GetPlayerState(playerid)!=1)
return ErrorMessage(playerid, "Вы уже находитесь в транспорте!");
if(GetPlayerInterior(playerid) > 0)
return ErrorMessage(playerid, "Использовать в интерьере нельзя!");
if(PI[playerid][plveh]!=-1)
DestroyVehicle(PI[playerid][plveh]);
new Float:X, Float:Y, Float:Z, Float:A;
GetPlayerPos(playerid, X, Y, Z);
GetPlayerFacingAngle(playerid, A);
vehicle_shar[playerid] = CreateVehicle(487, X, Y, Z, A, -1, -1, -1);
LinkVehicleToInterior(vehicle_shar[playerid], 100);
VehInfo[vehicle_shar[playerid]][vLock] = false;
VehInfo[vehicle_shar[playerid]][vEngine] = false;
VehInfo[vehicle_shar[playerid]][vLamp] = false;
VehInfo[vehicle_shar[playerid]][vFuel] = 200.0;
DestroyDynamicObject(objectshar[playerid]);
objectshar[playerid] = CreateDynamicObject(idobj, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, -1, -1, -1, 300.000000);
AttachDynamicObjectToVehicle(objectshar[playerid], vehicle_shar[playerid], 0.000000, -0.000000, -1.000000, 0.000000, 0.000000, -0.000000);
PutPlayerInVeh(playerid, vehicle_shar[playerid], 0);
vehicle_3dtext[vehicle_shar[playerid]] = Create3DTextLabel(""SERVER"Воздушный шар 'IceLand'\n\n{FFBF00}Войти: {FFFFFF}'F'\n\n{FFBF00}Чтобы занять пассажирское место: {FFFFFF}`G`", -1, 7.77, 7.77, 7.77, 300.0, 0, 1 ); // Создаём текст
Attach3DTextLabelToVehicle(vehicle_3dtext[vehicle_shar[playerid]], vehicle_shar[playerid], 0.0, 0.0, 2.0 );
return true;
}
public OnPlayerExitVehicle(playerid, vehicleid)
{
if(GetPlayerVehicleID(playerid) == vehicle_shar[playerid]) {
VehInfo[vehicle_shar[playerid]][vLock] = false;
VehInfo[vehicle_shar[playerid]][vEngine] = false;
VehInfo[vehicle_shar[playerid]][vLamp] = false;
VehInfo[vehicle_shar[playerid]][vFuel] = 200.0;
Delete3DTextLabel(vehicle_3dtext[vehicle_shar[playerid]]);
vehicle_3dtext[vehicle_shar[playerid]] = Text3D:INVALID_3DTEXT_ID;
DestroyDynamicObject(objectshar[playerid]);
DestroyVehicle(vehicle_shar[playerid]);
vehicle_shar[playerid] = INVALID_VEHICLE_ID;
}
return 1;
}