GetVehicleNumberPlate -
[DOG]irinel1996 - 30.05.2012
GetVehicleNumberPlate
[*] Introduction
Hello, I made a system to save the number plates in one of my gamemodes, and I had to script this function... so I share it with you since SA-MP doesn't include it by itself, I also saw many people asking for it. It's a short code, don't fight me.
[*] How do I use it?
This include has only one function:
- GetVehicleNumberPlate(vehicleid)
Parameters:
Код:
vehicleid -> the ID of the vehicle you want to get the number plate.
Return Values:
Код:
Returns the number plate as a string.
Click
here to see an example of use.
[*] Download
Get it now from Pastebin!
Thanks to ****** for updating the code.
That's all Folks!
Re: GetVehicleNumberPlate -
fiki574 - 30.05.2012
Many mistakes with "}" and ";"! Would give you shitload of errors! Fix that on teh Pastebin!
OT: Nice!
Re: GetVehicleNumberPlate -
MP2 - 30.05.2012
Only hooking OnFilterScriptInit if FILTERSCRIPT is defined isn't a great idea. Not everyone defines it. Just hook them both - only one will be called.
Also the loop needs changing to < MAX_VEHICLES+1.
Vehicle IDs start at 1 and there are 2000.
Re: GetVehicleNumberPlate -
[DOG]irinel1996 - 31.05.2012
Quote:
Originally Posted by fiki574_CRO
Many mistakes with "}" and ";"! Would give you shitload of errors! Fix that on teh Pastebin!
OT: Nice!
|
Can you tell me where exactly please? I can't see any mistakes of this type.
______________________
Quote:
Originally Posted by MP2
Only hooking OnFilterScriptInit if FILTERSCRIPT is defined isn't a great idea. Not everyone defines it. Just hook them both - only one will be called.
Also the loop needs changing to < MAX_VEHICLES+1.
Vehicle IDs start at 1 and there are 2000.
|
Didn't know that about hooking.
And yes, I didn't notice that I should add +1.

Thank you!
Best regards!
Re: GetVehicleNumberPlate -
MP2 - 31.05.2012
Also numberplates can be 32 characters long, so you need a 33 cell array, not 24!
Re: GetVehicleNumberPlate -
Marricio - 31.05.2012
When the vehicle destroys reset the variable, otherwise it will bug with another vehicles with the same ID.
Respuesta: Re: GetVehicleNumberPlate -
[DOG]irinel1996 - 01.06.2012
Quote:
Originally Posted by MP2
Also numberplates can be 32 characters long, so you need a 33 cell array, not 24!
|
Set a number plate of 11 characters and take a look in game at the number plate. -.-
No sense?
Re: GetVehicleNumberPlate -
maramizo - 13.12.2012
Not bad.
It's sad though that SA:MP developers couldn't create something like this themselves.
Re: GetVehicleNumberPlate -
ofekw2 - 13.12.2012
Very Nice i like It!!
Re: GetVehicleNumberPlate -
Lordzy - 14.12.2012
Quote:
Originally Posted by maramizo
Not bad.
It's sad though that SA:MP developers couldn't create something like this themselves.
|
They can but they're giving others a chance to create them.
OT:Not bad, keep going.