[Include] GetVehicleNumberPlate
#1

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!
Reply
#2

Many mistakes with "}" and ";"! Would give you shitload of errors! Fix that on teh Pastebin!

OT: Nice!
Reply
#3

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.
Reply
#4

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!
Reply
#5

Also numberplates can be 32 characters long, so you need a 33 cell array, not 24!
Reply
#6

When the vehicle destroys reset the variable, otherwise it will bug with another vehicles with the same ID.
Reply
#7

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?
Reply
#8

Not bad.
It's sad though that SA:MP developers couldn't create something like this themselves.
Reply
#9

Very Nice i like It!!
Reply
#10

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.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)