27.12.2014, 19:48
Basically I want a command like /vehiclead [text] while in a vehicle, will create a textdraw and attach it to the rear of the vehicle...
new car;
new Text3D:draw;
car = CreateVehicle(411, x, y, z, a, -1, -1, -1); //the car
Create3DTextLabel("yourtext", 0x00FF00FF, x, y, z, 40, 0, 0); //adding textlabel
Attach3DTextLabelToVehicle(car, draw); //attaching text label to vehicle!
Basically I want a command like /vehiclead [text] while in a vehicle, will create a textdraw and attach it to the rear of the vehicle...
|
enum VINFO
{
Text3D:v_Text, // Text label
v_OwnerID, // OwnerID of the vehicle
bool:v_Used // Marks if used
}
new VehicleData[MAX_VEHICLES][VINFO];
// Destroy vehicle when player disconnects
public OnPlayerDisconnect(playerid, reason)
{
for(new i = 0; i < MAX_VEHICLES; i++)
{
if(VehicleData[i][v_Used] && VehicleData[i][v_OwnerID] == playerid)
{
DestroyVehicle(i);
Delete3DTextLabel(VehicleData[i][v_OwnerID]);
VehicleData[i][v_OwnerID] = false;
}
}
}
// Add a new vehicle also creates and attaches 3D Text label.
AddVehicle(ownerid, modelid, Float:x, Float:y, Float:z, Float:angle, color1, color2, respawn_delay, Float:offsetx, Float:offsety, Float:offsetz, text[], color, virtualworld = 0, Float:DrawDistance = 100.0, testLOS, = 1)
{
vid = CreateVehicle(modelid, Float:x, Float:y, Float:z, Float:angle, color1, color2, respawn_delay);
if(vid == INVALID_VEHICLE_ID) return INVALID_VEHICLE_ID;
VehicleData[vid][v_OwnerID] = ownerid;
VehicleData[vid][v_Used] = true;
VehicleData[vid][v_Text] = Create3DTextLabel(text, color, 0.0, 0.0, 0.0, DrawDistance, virtualworld, testLOS);
Attach3DTextLabelToVehicle(VehicleData[vid][v_Text], vid, offsetx, offsety, offsetz);
return vid;
}
format(string, sizeof(string), "%s", params); VehSign[veh] = 1; vcallsign[veh] = Create3DTextLabel(string, COLOR_WHITE, 0, 0, 0, 10, 0, 0); //adding textlabel Attach3DTextLabelToVehicle(vcallsign[veh], veh, -0.5, -2.8, 0); //attaching text label to vehicle!
OnVehicleSpawn if(VehSign[vehicleid]) { Delete3DTextLabel(vcallsign[vehicleid]); }
Kinda lost you back there;
I have this Код:
format(string, sizeof(string), "%s", params); VehSign[veh] = 1; vcallsign[veh] = Create3DTextLabel(string, COLOR_WHITE, 0, 0, 0, 10, 0, 0); //adding textlabel Attach3DTextLabelToVehicle(vcallsign[veh], veh, -0.5, -2.8, 0); //attaching text label to vehicle! I tried this: Код:
OnVehicleSpawn if(VehSign[vehicleid]) { Delete3DTextLabel(vcallsign[vehicleid]); } |