29.01.2017, 14:56
hello
how can i attach 3d text label to all cars in my mode?
thanks
how can i attach 3d text label to all cars in my mode?
thanks
native STREAMER_TAG_3D_TEXT_LABEL CreateDynamic3DTextLabel(const text[], color, Float:x, Float:y, Float:z, Float:drawdistance, attachedplayer = INVALID_PLAYER_ID, attachedvehicle = INVALID_VEHICLE_ID, testlos = 0, worldid = -1, interiorid = -1, playerid = -1, Float:streamdistance = STREAMER_3D_TEXT_LABEL_SD, STREAMER_TAG_AREA areaid = STREAMER_TAG_AREA -1, priority = 0);
Loop through all vehicles and use preferably a streamer (****** 'samp streamer plugin') and add a text label to them by attaching them to the vehicle:
Код:
native STREAMER_TAG_3D_TEXT_LABEL CreateDynamic3DTextLabel(const text[], color, Float:x, Float:y, Float:z, Float:drawdistance, attachedplayer = INVALID_PLAYER_ID, attachedvehicle = INVALID_VEHICLE_ID, testlos = 0, worldid = -1, interiorid = -1, playerid = -1, Float:streamdistance = STREAMER_3D_TEXT_LABEL_SD, STREAMER_TAG_AREA areaid = STREAMER_TAG_AREA -1, priority = 0); |
new VehicleTextLabels[MAX_VEHICLES];
// under a command or something
for(new i; i < GetVehiclePoolSize(); i++) {
if(IsValidVehicle(i)) {
VehicleTextLabels[i] = CreateDynamic3DTextLabel("text goes here", 0xFFFFFFFF, 0.0, 0.0, 0.0, 30.0, .attachedvehicle = i);
}
}
DeleteDynamic3DTextLabel(VehicleTextLabels[vehicleid]);
public OnVehicleCreated(vehicleid)
{
VehicleTextLabels[vehicleid] = CreateDynamic3DTextLabel("text goes here", 0xFFFFFFFF, 0.0, 0.0, 0.0, 30.0, .attachedvehicle = vehicleid);
return 1;
}
public OnVehicleDestroyed(vehicleid)
{
DeleteDynamic3DTextLabel(VehicleTextLabels[vehicleid]);
VehicleTextLabels[vehicleid] = -1;
return 1;
}
public OnVehicleCreated(vehicleid)
{
if(GetVehicleModel(vehicleid) == 596)
{
VehicleTextLabels[vehicleid] = CreateDynamic3DTextLabel("text goes here", 0xFFFFFFFF, 0.0, 0.0, 0.0, 30.0, .attachedvehicle = vehicleid);
}
return 1;
}
With the method he is using, this would go in a command or wherever else you want to add the labels:
pawn Код:
pawn Код:
pawn Код:
pawn Код:
|