Wiebrendh Posted March 26, 2014 Share Posted March 26, 2014 In singeplayer is tjere an option to trigger an if statement when you kill someone, could not find sh*t on google.. *there Link to comment Share on other sites More sharing options...
LordOfTheBongs Posted March 27, 2014 Share Posted March 27, 2014 u really should download ilspy and try to figure it out obviously u would need to check more than once... so use a tick event (There's alotta gta scripts out there u can look at for examples... use ilspy to decompile .net scripts, u need to learn by looking at other people's scripts and connecting the dots) Link to comment Share on other sites More sharing options...
Wiebrendh Posted March 27, 2014 Author Share Posted March 27, 2014 (edited) u really should download ilspy and try to figure it out obviously u would need to check more than once... so use a tick event (There's alotta gta scripts out there u can look at for examples... use ilspy to decompile .net scripts, u need to learn by looking at other people's scripts and connecting the dots) Oke, i downloaded it, and it works fine But when i try to use it in here: public class NotifyKill : Script { bool KilledChar = false; public NotifyKill() { Interval = 1000; this.Tick += new EventHandler(testTick); } public void testTick(object sender, EventArgs e) { KilledChar = GTA.Native.Function.Call<bool>("IS_CHAR_DEAD"); Game.DisplayText(Convert.ToString(KilledChar)); } } But when i load the game, the bool KilledChar is already true..?? Please help Edited March 27, 2014 by Wiebrendh Link to comment Share on other sites More sharing options...
LordOfTheBongs Posted March 27, 2014 Share Posted March 27, 2014 (edited) why are u using the native when u can see the scripthookdotnet has a property in the ped class for u to use? and ur using the native wrong... look at how the scripthookdotnet uses the native and then look what ur doing this isnt even checking a ped btw... GTA.Native.Function.Call<bool>("IS_CHAR_DEAD"); i assume this code will give u access violations eventually, u usually get those when u use natives wrong anways... read this... http://www.gtamodding.com/index.php?title=IS_CHAR_DEAD so after reading i know u need to do this... GTA.Native.Function.Call<bool>("IS_CHAR_DEAD", thePedHere); u need to check what arguments are required by natives, if u use wrong u screw up the game's memory Edited March 27, 2014 by LordOfTheBongs Link to comment Share on other sites More sharing options...
Wiebrendh Posted March 28, 2014 Author Share Posted March 28, 2014 (edited) why are u using the native when u can see the scripthookdotnet has a property in the ped class for u to use? and ur using the native wrong... look at how the scripthookdotnet uses the native and then look what ur doing this isnt even checking a ped btw... GTA.Native.Function.Call<bool>("IS_CHAR_DEAD"); i assume this code will give u access violations eventually, u usually get those when u use natives wrong anways... read this... http://www.gtamodding.com/index.php?title=IS_CHAR_DEAD so after reading i know u need to do this... GTA.Native.Function.Call<bool>("IS_CHAR_DEAD", thePedHere); u need to check what arguments are required by natives, if u use wrong u screw up the game's memory When i use this, the thePedHere is under a red line.. Edited March 28, 2014 by Wiebrendh Link to comment Share on other sites More sharing options...
LordOfTheBongs Posted March 28, 2014 Share Posted March 28, 2014 (edited) why are u using the native when u can see the scripthookdotnet has a property in the ped class for u to use? and ur using the native wrong... look at how the scripthookdotnet uses the native and then look what ur doing this isnt even checking a ped btw... GTA.Native.Function.Call<bool>("IS_CHAR_DEAD"); i assume this code will give u access violations eventually, u usually get those when u use natives wrong anways... read this... http://www.gtamodding.com/index.php?title=IS_CHAR_DEAD so after reading i know u need to do this... GTA.Native.Function.Call<bool>("IS_CHAR_DEAD", thePedHere); u need to check what arguments are required by natives, if u use wrong u screw up the game's memory When i use this, the thePedHere is under a red line.. and why wouldnt it be underlined in red? u never declared this variable in your script so visual studio is telling u this... just read the error, hopefully u know how to open the error dialog in visual studio, it is pretty important because it will tell u what is wrong in your syntax here is a tip since you are new... STOP COPYING AND PASTING CODE EXAMPLES YOU FIND AND WRITE YOURSELF visual studio will teach you stuff about what your doing as u type ;D Edited March 28, 2014 by LordOfTheBongs 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