Vehicle Plate
#1

Hello, i searched every where but none of them were helpful. so what i'm asking is, if some one
can show me how to create a plate which wil contain "LS-[veh ID]"
For example, i spawned vehicle id 1, so the plate will be "LS-01",
Or vehicle id 25 the plate will be "LS-25".

Thanks for the helpers!
Reply
#2

pawn Код:
public OnVehicleStreamIn( vehicleid, forplayerid )
{
    new string[ 16 ];
    format( string, sizeof( string ), "LS - %d", vehicleid );
    SetVehicleNumberPlate( vehicleid, string );
    return 1;
}
Reply
#3

You forgot to respawn vehicle. Else those codes will not be seeable. I just think it, or maybe it's fixed.
Reply
#4

Actually, I was wondering too about this and I wasn't sure if I should or not.
pawn Код:
public OnVehicleStreamIn( vehicleid, forplayerid )
{
    new string[ 16 ];
    format( string, sizeof( string ), "LS - %d", vehicleid );
    SetVehicleNumberPlate( vehicleid, string );
    SetVehicleToRespawn( vehicleid );
    return 1;
}
if the first one doesn't work try with respawning as aco_SRBIJA mentioned
Reply
#5

Quote:
Originally Posted by aco_SRBIJA
Посмотреть сообщение
You forgot to respawn vehicle. Else those codes will not be seeable. I just think it, or maybe it's fixed.
you're right, it didn't work ffs
Reply
#6

Now it's all ok
Reply
#7

Quote:
Originally Posted by Dwane
Посмотреть сообщение
Actually, I was wondering too about this and I wasn't sure if I should or not.
pawn Код:
public OnVehicleStreamIn( vehicleid, forplayerid )
{
    new string[ 16 ];
    format( string, sizeof( string ), "LS - %d", vehicleid );
    SetVehicleNumberPlate( vehicleid, string );
    SetVehicleToRespawn( vehicleid );
    return 1;
}
if the first one doesn't work try with respawning as aco_SRBIJA mentioned
lol removed all my cars
Reply
#8

Weird.
On vehicle spawn it set the plate and respawn the vehicle id.
There is no reason to remove your cars.
Reply
#9

Quote:
Originally Posted by Dwane
Посмотреть сообщение
Weird.
On vehicle spawn it set the plate and respawn the vehicle id.
There is no reason to remove your cars.
I added it under OnVehicleSpawn, here.

Код:
public OnVehicleSpawn(vehicleid)
{
	VehicleSecurity[vehicleid] = 0;
	new id = GetVehicleID(vehicleid);
	if(IsValidVehicle(id))
	{
		if(VehicleColor[id][0] >= 0 && VehicleColor[id][1] >= 0)
		ChangeVehicleColor(vehicleid, VehicleColor[id][0], VehicleColor[id][1]);
		LinkVehicleToInterior(vehicleid, VehicleInterior[id]);
		SetVehicleVirtualWorld(vehicleid, VehicleWorld[id]);
		for(new i=0; i < sizeof(VehicleMods[]); i++)
		{
			AddVehicleComponent(vehicleid, VehicleMods[id][i]);
		}
		ChangeVehiclePaintjob(vehicleid, VehiclePaintjob[id]);
	}
	return 1;
}
public OnVehicleStreamIn( vehicleid, forplayerid )
{
    new string[ 16 ];
    format( string, sizeof( string ), "LS - %d", vehicleid );
    SetVehicleNumberPlate( vehicleid, string );
    SetVehicleToRespawn( vehicleid );
    return 1;
}
Reply
#10

Then add it under the command you create vehicles.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)