VMToName

Started by EK.IceFlake, Jul 15, 2015, 05:05 PM

Previous topic - Next topic

EK.IceFlake

Here is a better implementation of names from custom vehicles
*This needs to be edited*
function VMToName(vm) (vm < 6000) ? return GetVehicleNameFromModel(vm) : switch(vm)
{
    case 6000: return "GASH plane";
    case 6001: return "SA Police";
    //...
    default: return null;
}

Thijn

Another horrible snippet. Why over complicate it, and make it hard to read in the process?
function VMToName(vm)
{
    switch (vm) {
        case 6000: return "GASH plane";
        case 6001: return "SA Police";
        //...
        default: return GetVehicleNameFromModel(vm);
    }
}

EK.IceFlake

Quote from: Thijn on Jul 15, 2015, 05:53 PMAnother horrible snippet. Why over complicate it, and make it hard to read in the process?
function VMToName(vm)
{
    switch (vm) {
        case 6000: return "GASH plane";
        case 6001: return "SA Police";
        //...
        default: return GetVehicleNameFromModel(vm);
    }
}
Who reads it anyways? They just go on and use it. I like it the way it is.

Thijn

Quote from: NE.CrystalBlue on Jul 15, 2015, 05:55 PMWho reads it anyways? They just go on and use it. I like it the way it is.
Which is my point. How do you expect people to learn scripting when they will just copy paste scripts because they're too hard to understand.
Snippets are for people who are new to scripting, and need help with basic things.

MatheuS

Quote from: Thijn on Jul 15, 2015, 06:20 PM
Quote from: NE.CrystalBlue on Jul 15, 2015, 05:55 PMWho reads it anyways? They just go on and use it. I like it the way it is.
Which is my point. How do you expect people to learn scripting when they will just copy paste scripts because they're too hard to understand.
Snippets are for people who are new to scripting, and need help with basic things.

I think he used it to be different this -> http://forum.vc-mp.org/?topic=1041.0
if( !sucess ) tryAgain();
Thanks to the VCMP community. It was the happiest period of my life.