help | text on the vehicle
#1

I get this code.

Код:
public OnVehicleSpawn(vehicleid)
{
	// AddStaticVehicle(522,660.0554,1719.1187,6.5642,12.7699,8,82); //
  if(GetVehicleModel(vehicleid) == 522)
  {
    Car3DText = "text";
    new Text3D:Created3D = Create3DTextLabel(Car3DText,COLOR_GREEN,0.0,0.0,0.0,50,0,0);
    Attach3DTextLabelToVehicle(Created3D,vehicleid,0.0,0.0,0.0);
  }
  return 1;
}
but only when i blow the vehicle and he respawn again i see the text on the vehicle
( the vehicles located at OnGameModeInit )
What i need to do to see the vehicle when i enter the game and not when i blow the car and he respawn again to his location?
Reply
#2

Try to put label creating and attaching under game mode init.
Reply
#3

In OnGameModeInit after AddStaticVehicle lines add

pawn Код:
for(new vehicleid=1; vehicleid < MAX_VEHICLES; vehicleid++)
{
  if(GetVehicleModel(vehicleid) == 522)
  {
    Car3DText = "text";
    new Text3D:Created3D = Create3DTextLabel(Car3DText,COLOR_GREEN,0.0,0.0,0.0,50,0,0);
    Attach3DTextLabelToVehicle(Created3D,vehicleid,0.0,0.0,0.0);
  }
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)