Tail Number System?
#1

So im scripting a pilots server, and ive already mapped out all the vehicles n stuff. What im wanting to do is set static tail numbers for all the aircraft on the server, i dont actually know how to set them manually...so if anyone could toss me a solution thatd be great thanks.
Reply
#2

Do you mean an actuall number on the tail of the plane? or a number system within the script for your vehicle?
Reply
#3

a number system for the vehicles. Like if you get in a plane, i want it to Give you your tail number, but i want it to be static. Like always the same. I aslo plan on implementing it into a takeoff announcing system so i gotta be able to use the tail number for that.
Reply
#4

any help would be appreciated. i dont mean too sound rude, but im being stressed for time.
Reply
#5

Try this SA:MP function. https://sampwiki.blast.hk/wiki/Attach3DTextLabelToVehicle

Also, you don't come across as rude, and your bump was fine due to it being 24+ hours.
Reply
#6

If you have got different airlines you could just use the names as acronyms plus the vehicle id if that is static.
If not, you could just save the id's when you create the vehicles, incrementing each vehicle.

Or if you don't have airlines just use an acronym made out of the model name. Examples:
SH-21 for a Shamal with the vehicle id 21 or
NE-122 for a Nevada with the id 122.

I hope this can help you.
Reply
#7

@Madd, i honestly wouldnt even know where to begin, and @Privatio, thanks, but ive already tried this option, its not quite what im after. Im trying to make it to where when you enter the plane, itll give you the tail number. but id like to be able to designate said tail number in the scripts.
Reply
#8

If you don't want to create them on runtime, just use an array, pick your favorite country and do as they do:
http://en.wikipedia.org/wiki/Aircraft_registration#List_of_countries.2Fregions_ and_their_registration_prefixes_and_patterns
pawn Код:
static const TailNumbers[MAX_AIRCRAFTS][7] = {"D-AAAA", "D-AAAB", "D-BAAA", "D-BAAB"};
Really, I don't know how you are stuck here, just be creative!

Edit:
pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if (newstate == PLAYER_STATE_DRIVER && oldstate != PLAYER_STATE_DRIVER)
    {
        new vehicleid = GetPlayerVehicleID(playerid);
        if (GetVehicleType(vehicle) == VTYPE_AIRCRAFT) // or something of that sort
        {
            new message[128];
            format(message, sizeof(message), "You have just entered the aircraft with the tailnumber: %s-%d",
                   VehAcronym(GetVehicleModel(vehicleid)), vehicleid); // in that sort of kind
            SendClientMessage(playerid, COLOR_YELLOW, message);
        }
    }
    return 1;
}
VehAcronym then returns a string like "SHA" or "NEV" maybe. But pass the string rather by reference, so you'll have error codes as well.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)