SetVehicleNumberPlate
#1

Quote:

Please use this function with care and don't go assigning custom numberplates to vehicles that don't have plates (like planes/boats etc), as this would result in unneeded processing time on the client.

Referring to the above quote, wouldn't it be much better if the function had built in error checking to prevent this?
Reply
#2

It would, but I guess it's up to you to create a function that checks to see what vehicle they are in, and tell them they can not change it, otherwise, let them.
Reply
#3

simply just
pawn Код:
for(new v = 0; v < MAX_VEHICLES; v++)
    {
        if(IsAPlane(GetVehicleModel(v))) continue;
        if(IsABoat(GetVehicleModel(v))) continue;
//do stuff
stock IsAPlane(modelid)
{
    switch(modelid)
    {
        case 593,592,577,563,553,548,520,519,513,512,511,
        497,488,487,476,469,460,447,425,417,493,484,453: return 1;
        default: return 0;
    }
    return 0;
}
stock IsABoat(modelid)
{
    switch(modelid)
    {
        case 472,473,595,493,430,453,484,446,452,454: return 1;
        default: return 0;
    }
    return 0;
}
Reply
#4

@The_Gangstas, his asking for a built in error checker not a scripting way of doing it and I'm pretty sure he knows how to do that.
Reply
#5

Yea, I didn't even think about this Jay_, +1 to this.
Reply
#6

It should simply return 1 if plate could be set and 0 if not.
Reply
#7

Indeed, I find it quite annoying that server developers always have to find a workaround for everything, while it could be simply hardcorded making life much easier / faster.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)