Jump to content

Cannot implicitly convert type 'GTANetworkAPI.Player'


SGH

Recommended Posts

Hello fellow Ragers.

 

I am raging now, as I cannot seem to resolve this line of code. For the love of god, someone help advise me here. I was following a tutorial and everything matches 100% however I cannot get this player.GetData parameter to work.

ERROR:
 

Severity	Code	Description	Project	File	Line	Suppression State
Error	CS0029	Cannot implicitly convert type 'GTANetworkAPI.Player' to 'FBRP.PlayerData.Data'	FBRP	D:\Program Files\RAGEMP_serv\server-files\dotnet\resources\FBRP\FBRP\PlayerData\Core.cs	81	Active

 

CODE:
 

        [ServerEvent(Event.PlayerConnected)]
        public async void OnPlayerConnected(Player player)
        {
            Data temp = player.GetData<Player>(Data.DataIdentifier); //FIX ME

			if(await temp.AccountExists())
            {
				player.SendChatMessage("Account Exists!");
            }
            else
            {
				player.SendChatMessage("Account does not exist!");
            }
        }

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...