new vehicle_shar[MAX_PLAYERS],
Text3D:vehicle_3dtext[MAX_VEHICLES];
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);
new Text3D:vehicletext;
vehicle_shar[playerid] = AddStaticVehicle(487, X, Y, Z, A, -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( vehicletext, 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]]);
DestroyDynamicObject(objectshar[playerid]);
DestroyVehicle(vehicle_shar[playerid]);
}
return 1;
}