SA-MP Forums Archive
SetVehicleNumberPlate problem - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: SetVehicleNumberPlate problem (/showthread.php?tid=206823)



SetVehicleNumberPlate problem - pantelimonfl - 04.01.2011

I use an edit of gtarp and i want to have numberplates on all ownablecars.
I tried
Код:
for(new h = 197; h < sizeof(CarInfo); h++)
	{
		SetVehicleNumberPlate(h, CarInfo[h][cLicense]);
	}
But it doesn't work.


Re: SetVehicleNumberPlate problem - iJumbo - 04.01.2011

where u put this code? what callback?


Re: SetVehicleNumberPlate problem - Kwarde - 04.01.2011

Try this: After setting the numberplate, respawn cars!
So the code will look like this:

pawn Код:
for(new h = 197; h < sizeof(CarInfo); h++)
{
    SetVehicleNumberPlate(h, CarInfo[h][cLicense]);
    SetVehicleToRespawn(h);
}
And I have an tip. If you use an 'for' thing, or an 'if' statement etc, and it has just one line, don't use brackets.
Example:

pawn Код:
for(new h = 197; h < sizeof(CarInfo); h++)
    SetVehicleNumberPlate(h, CarInfo[h][cLicense]);



Re: SetVehicleNumberPlate problem - pantelimonfl - 04.01.2011

It still doesn't work. I write in the cfg file a number and when i start the server the text that i wrote disappears.


Re: SetVehicleNumberPlate problem - Kwarde - 04.01.2011

And did you update the 'read from cfg' function (idk how it's called in GtaRP)? Just editting cfg won't work :')


Re: SetVehicleNumberPlate problem - pantelimonfl - 04.01.2011

LoadCar. It's already defined cLicense.


Re: SetVehicleNumberPlate problem - Kwarde - 04.01.2011

Oh then I don't know.
Ask the creator of GtaRP for help. He/She will probbaly know it.


Re: SetVehicleNumberPlate problem - SkizzoTrick - 04.01.2011

put this after:
OnGameModeInit or OnVehicleSpawn
pawn Код:
for(new h = 197; h < sizeof(CarInfo); h++)
{
    SetVehicleNumberPlate(h, CarInfo[h][cLicense]);
    SetVehicleToRespawn(h);
}



Re: SetVehicleNumberPlate problem - Kwarde - 04.01.2011

@SkizzoTrick:
Quote:
Originally Posted by Kwarde
Посмотреть сообщение
Try this: After setting the numberplate, respawn cars!
So the code will look like this:

pawn Код:
for(new h = 197; h < sizeof(CarInfo); h++)
{
    SetVehicleNumberPlate(h, CarInfo[h][cLicense]);
    SetVehicleToRespawn(h);
}
And I have an tip. If you use an 'for' thing, or an 'if' statement etc, and it has just one line, don't use brackets.
Example:

pawn Код:
for(new h = 197; h < sizeof(CarInfo); h++)
    SetVehicleNumberPlate(h, CarInfo[h][cLicense]);
Please, read the whole topic first.


Re: SetVehicleNumberPlate problem - SkizzoTrick - 04.01.2011

Quote:
Originally Posted by Kwarde
Посмотреть сообщение
@SkizzoTrick:

Please, read the whole topic first.
Ohh ...that posts wasn't there before my answer ,ffs,maybe my internet is low,im gonna restart the PC,sorry.