[Include] GetVehicleName - Simple, Easy & Efficient function.
#7

Quote:
Originally Posted by Ralfie
View Post
An array with the names is better.
Thanks anyway.

Quote:
Originally Posted by M4D
View Post
Nice job but this function can post on Useful Functions Topic !

anyway good job !
Thanks.

Quote:
Originally Posted by Kyance
View Post
"new vehname[1500];"
oh god.

18 is enough.
Lol, edited.

Quote:
Originally Posted by dominik523
View Post
This isn't really for an include, it's for useful snippets of code.
But, nice work I guess.
Thanks.

Quote:
Originally Posted by Gammix
View Post
zcmd and sscanf, i dont see any implementation of those includes.
Using array for this purpose is completly efficient. I dont know why would anyone call this efficient.

You havent made any checks either if the vehicle is valid!

In your example, the syntax says, /car [veh ID]. Then why would you limit the usage for vehicle id b/w 400 - 611! It must be modelid. As well for the function.
OR you must use something like this:
pawn Code:
stock GetVehicleName(vehicleid)
{
       new name[18];
       switch(GetVehicleModel(vehicleid))
       {
....
Still example script and this include works fine and faster.

EDIT: Now I understood what are you talking about zcmd & sscanf.
I tested that filterscript, so I needed zcmd & sscanf to create an example command.
Pastebin & Solidfiles link has been re-uploaded.
Thanks!
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)