26.08.2015, 15:36
Well, the flag ID is 2914, all you'd do really is:
new Flag[MAX_PLAYERS]; or something if you're doing one flag for each player in a hydra, you'd put that at the top of your script. If not, just skip that bit, and put: new Flag; in the OnPlayerEnterVehicle Callback.
After that, you create the object and assign it to the flag variable, with: Flag (Optionally Flag[playerid]) = CreateObject(2914, All the other things needed);
And then AttachObject(Flag, vehicleid, everything else);
That's how I think it'd go.
As the person above said though, OnPlayerEnterVehicle is a bad place to be doing this. Also, with your current code, it'll try adding the flag to every vehicle the player enters.
new Flag[MAX_PLAYERS]; or something if you're doing one flag for each player in a hydra, you'd put that at the top of your script. If not, just skip that bit, and put: new Flag; in the OnPlayerEnterVehicle Callback.
After that, you create the object and assign it to the flag variable, with: Flag (Optionally Flag[playerid]) = CreateObject(2914, All the other things needed);
And then AttachObject(Flag, vehicleid, everything else);
That's how I think it'd go.
As the person above said though, OnPlayerEnterVehicle is a bad place to be doing this. Also, with your current code, it'll try adding the flag to every vehicle the player enters.