TotalCraftGames Posted May 17, 2015 Share Posted May 17, 2015 (edited) C#:Error CS0208: Cannot take the address of, get the size of, or declare a pointer to a managed type ('GTA.Ped') (CS0208) unsafe {Ped *tPed = &pedEmployed;Function.Call (Hash.SET_PED_AS_NO_LONGER_NEEDED,tPed);}ORunsafe {Function.Call (Hash.SET_PED_AS_NO_LONGER_NEEDED,&pedEmployed);}//but this worksunsafe{int a = 10;int *b = &a;} How to send a pointer?? Edited May 17, 2015 by TotalCraftGames Link to comment Share on other sites More sharing options...
Inco Posted May 17, 2015 Share Posted May 17, 2015 Already here: ped.MarkAsNoLongerNeeded(); P.S. If you want call some ped, vehicle etc native function then you should pass it handle (pedEmployed.Handle). TotalCraftGames 1 Link to comment Share on other sites More sharing options...
TotalCraftGames Posted May 17, 2015 Author Share Posted May 17, 2015 Already here: ped.MarkAsNoLongerNeeded(); P.S. If you want call some ped, vehicle etc native function then you should pass it handle (pedEmployed.Handle). Oh, thanks for your help! Link to comment Share on other sites More sharing options...
c39687 Posted May 17, 2015 Share Posted May 17, 2015 (edited) well to understand that parameter you have to have the types.h file from the scripthookv sdk... typedef int Ped; Try making an int* and like inco said, reference the handle property of the GTA.Ped instance. You are trying to make a pointer to a scripthookdotnet class. This is not how peds are represented in the game. It is just a wrapper class to make coding your script in c# easy . (All it does is keep reference to the ped's handle and wraps calls to ped related natives using this handle). In GTA, peds are handles, which are just integers. And some natives use pointers to this int value. Edited May 17, 2015 by c39687 TotalCraftGames 1 Link to comment Share on other sites More sharing options...
TotalCraftGames Posted May 17, 2015 Author Share Posted May 17, 2015 well to understand that parameter you have to have the types.h file from the scripthookv sdk... typedef int Ped; Try making an int* and like inco said, reference the handle property of the GTA.Ped instance. You are trying to make a pointer to a scripthookdotnet class. This is not how peds are represented in the game. It is just a wrapper class to make coding your script in c# easy . (All it does is keep reference to the ped's handle and wraps calls to ped related natives using this handle). In GTA, peds are handles, which are just integers. And some natives use pointers to this int value. Thank you, now I'll know. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now