Vice City: Multiplayer

Server Development => Scripting and Server Management => Snippet Showroom => Topic started by: EK.IceFlake on Jul 15, 2015, 05:05 PM

Title: VMToName
Post by: EK.IceFlake on Jul 15, 2015, 05:05 PM
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;
}
Title: Re: VMToName
Post by: Thijn on Jul 15, 2015, 05:53 PM
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);
    }
}
Title: Re: VMToName
Post by: EK.IceFlake on Jul 15, 2015, 05:55 PM
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.
Title: Re: VMToName
Post by: 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.
Title: Re: VMToName
Post by: MatheuS on Jul 15, 2015, 08:06 PM
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