$200 Steam Giftcard Raffle | Sponsored by TF1A3 ×
Jump to content
×
×
  • Create New...

SetData function


Darihonn
 Share

Recommended Posts

Hi there,

 

I'm currently trying out the different kind of options within the PedData class, but I'm kinda stuck on one small piece: changing the expiration date / status of a license.I took a look at the API Docs, but the example shown there looks incomplete to me. 

 

I tried the following code:

this._suspect = await SpawnPed(RandomUtils.GetRandomPed(), Location + 1);
this._suspect.AlwaysKeepTask = true;
this._suspect.BlockPermanentEvents = true;
this._suspect.SetIntoVehicle(this._vehicle, VehicleSeat.Driver);

var newSuspectData = new PedData();
newSuspectData.FirstName = "test";
newSuspectData.LastName = "test2";
newSuspectData.DriverLicense = new PedData.License();
newSuspectData.DriverLicense.ExpirationDate = "13/03/2022";
newSuspectData.DriverLicense.LicenseStatus = PedData.License.Status.Revoked;
_suspect.SetData(newSuspectData);

// Used to debug the status of the data.
var pedData = await _suspect.GetData();
Debug.WriteLine("" + pedData.DriverLicense.LicenseStatus);

 

The first and last name of the ped get changed, but nothing changes about the status of the license. It looks random. I even tried the following:

this._suspect = await SpawnPed(RandomUtils.GetRandomPed(), Location + 1);
this._suspectData = await this._suspect.GetData();
this._suspectData.FirstName = "test";
this._suspectData.LastName = "test";
this._suspectData.DriverLicense.ExpirationDate = "13/03/2022";
this._suspectData.DriverLicense.LicenseStatus = PedData.License.Status.Revoked;
_suspect.SetData(newSuspectData);

The same thing happens here: first and last name get changed, but status of the license is still random.

 

I'm really flabbergasted at this moment. I have spent way too much time looking at this issue so I could really use some fresh eyes. 

Link to post
Share on other sites

  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.

Important Information

Thanks for visiting GPM. As a user of the GTAPoliceMods platform, we ask that you review the Terms of Use, Privacy Policy, and Guidelines. These principles allow us to continue fostering a great community. We have placed cookies on your device to help improve your experience. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.