Jump to content
    1. Welcome to GTAForums!

    1. GTANet.com

    1. GTA Online

      1. The Criminal Enterprises
      2. Updates
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Red Dead Online

      1. Blood Money
      2. Frontier Pursuits
      3. Find Lobbies & Outlaws
      4. Help & Support
    3. Crews

    1. Grand Theft Auto Series

      1. Bugs*
      2. St. Andrews Cathedral
    2. GTA VI

    3. GTA V

      1. Guides & Strategies
      2. Help & Support
    4. GTA IV

      1. The Lost and Damned
      2. The Ballad of Gay Tony
      3. Guides & Strategies
      4. Help & Support
    5. GTA San Andreas

      1. Classic GTA SA
      2. Guides & Strategies
      3. Help & Support
    6. GTA Vice City

      1. Classic GTA VC
      2. Guides & Strategies
      3. Help & Support
    7. GTA III

      1. Classic GTA III
      2. Guides & Strategies
      3. Help & Support
    8. Portable Games

      1. GTA Chinatown Wars
      2. GTA Vice City Stories
      3. GTA Liberty City Stories
    9. Top-Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    1. Red Dead Redemption 2

      1. PC
      2. Help & Support
    2. Red Dead Redemption

    1. GTA Mods

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Red Dead Mods

      1. Documentation
    3. Mod Showroom

      1. Scripts & Plugins
      2. Maps
      3. Total Conversions
      4. Vehicles
      5. Textures
      6. Characters
      7. Tools
      8. Other
      9. Workshop
    4. Featured Mods

      1. Design Your Own Mission
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Rockstar Games

    2. Rockstar Collectors

    1. Off-Topic

      1. General Chat
      2. Gaming
      3. Technology
      4. Movies & TV
      5. Music
      6. Sports
      7. Vehicles
    2. Expression

      1. Graphics / Visual Arts
      2. GFX Requests & Tutorials
      3. Writers' Discussion
      4. Debates & Discussion
    1. Announcements

    2. Support

    3. Suggestions

*DO NOT* SHARE MEDIA OR LINKS TO LEAKED COPYRIGHTED MATERIAL. Discussion is allowed.

Community Script Hook V .NET


crosire
 Share

Recommended Posts

i dont know if this was asked here before but its possible list the peds/vehicles from game? In c++ scripthookv we can do the following:

Any* pedsAround = new Any[102];pedsAround[0] = 50;int pedCount = PED::GET_PED_NEARBY_PEDS(playerPed, pedsAround, -1);for (int c = 0; c < pedCount; c++){...

but i was unable to find the correct types to use in the parameters

Edited by julionib
Link to comment
Share on other sites

unknown modder

can you add

 

Any NETWORK_GET_PLAYER_INDEX(Ped PedHandle) // 0xBE1C1506

this is not designed for online.

i dont know if this was asked here before but its possible list the peds/vehicles from game? In c++ scripthookv we can do the following:

Any* pedsAround = new Any[102];pedsAround[0] = 50;int pedCount = PED::GET_PED_NEARBY_PEDS(playerPed, pedsAround, -1);for (int c = 0; c < pedCount; c++){...
but i was unable to find the correct types to use in the parameters
pass the pointer to pedcount[0]

Don't think you can do that in c#. I use peds as an int

Link to comment
Share on other sites

i dont know if this was asked here before but its possible list the peds/vehicles from game? In c++ scripthookv we can do the following:

Good that you mentioned that. Wrote two functions, World.GetNearbyPeds and World.GetNearbyVehicles, but can't test them because of the recent GTA update, guess we need to wait for an update to the C++ Script Hook.

Link to comment
Share on other sites

odiomoratti

Thank you and Blade....

 

For now i'll just wait a more stable/complete version.....but it's great to see these tools already out.

Link to comment
Share on other sites

identitymatrix

 

i dont know if this was asked here before but its possible list the peds/vehicles from game? In c++ scripthookv we can do the following:

Good that you mentioned that. Wrote two functions, World.GetNearbyPeds and World.GetNearbyVehicles, but can't test them because of the recent GTA update, guess we need to wait for an update to the C++ Script Hook.

 

 

This auto patching is gonna get really tedious (thanks r*). It's probably going to break the scripthook everytime.

 

Regardless of people say, I think we need to modify the patching system so it is manual only.

Link to comment
Share on other sites

unknown modder

 

 

i dont know if this was asked here before but its possible list the peds/vehicles from game? In c++ scripthookv we can do the following:

Good that you mentioned that. Wrote two functions, World.GetNearbyPeds and World.GetNearbyVehicles, but can't test them because of the recent GTA update, guess we need to wait for an update to the C++ Script Hook.the ultimate solution would be to actually get the vehicles and peds pool in memory, but with a new patch every week no point getting yet
Link to comment
Share on other sites

 

the ultimate solution would be to actually get the vehicles and peds pool in memory, but with a new patch every week no point getting yet

 

Yeah, GTAIV Script Hook did it, cannot get faster than that. But as you said, very likely it wouldn't live long.

Link to comment
Share on other sites

identitymatrix

 

i dont know if this was asked here before but its possible list the peds/vehicles from game? In c++ scripthookv we can do the following:

Good that you mentioned that. Wrote two functions, World.GetNearbyPeds and World.GetNearbyVehicles, but can't test them because of the recent GTA update, guess we need to wait for an update to the C++ Script Hook.

 

 

Someone uploaded the files that rockstar updated the hashes to

 

https://mega.co.nz/#F!q88RwL5I!Rk136GJGXNNAo2bAtKiAYQ

 

If you replace your files with these, you can continue your scripthook.net development and testing.

Link to comment
Share on other sites

unknown modder

 

 

 

 

i dont know if this was asked here before but its possible list the peds/vehicles from game? In c++ scripthookv we can do the following:

Good that you mentioned that. Wrote two functions, World.GetNearbyPeds and World.GetNearbyVehicles, but can't test them because of the recent GTA update, guess we need to wait for an update to the C++ Script Hook.

 

Someone uploaded the files that rockstar updated the hashes to

 

https://mega.co.nz/#F!q88RwL5I!Rk136GJGXNNAo2bAtKiAYQ

 

If you replace your files with these, you can continue your scripthook.net development and testing.

is that just the gtavexe launcher and update. Not exactly a good solution Edited by unknown modder
Link to comment
Share on other sites

monsterxsync

 

 

 

i dont know if this was asked here before but its possible list the peds/vehicles from game? In c++ scripthookv we can do the following:

Good that you mentioned that. Wrote two functions, World.GetNearbyPeds and World.GetNearbyVehicles, but can't test them because of the recent GTA update, guess we need to wait for an update to the C++ Script Hook.

 

Someone uploaded the files that rockstar updated the hashes to

 

https://mega.co.nz/#F!q88RwL5I!Rk136GJGXNNAo2bAtKiAYQ

 

If you replace your files with these, you can continue your scripthook.net development and testing.

is that just the gtavexe launcher and update. Not exactly a good solution

 

that's what it looks to be not a great solution but i guess if you wanna mod single player its alright..?

Link to comment
Share on other sites

Now that you said that: I remembered I had another installation of GTA V on a second computer which was still on the old version, so was able to grab the files from there (I prefer not to download files from random sources if possible) and can continue working now, thanks a lot =).

Edited by Crosire
  • Like 1
Link to comment
Share on other sites

is there anyway to teleport?

like for example off of the mountain to your safehouse or police station?

Edited by timnboys
Link to comment
Share on other sites

unknown modder

is there anyway to teleport?

like for example off of the mountain to your safehouse or police station?

game.player.character.position = Vector3(x,y,z);

 

x y z being the coordinates of where you want to teleport to

Link to comment
Share on other sites

This is f*cking awesome! I didn't expected .NET would be possible for GTAV.

Lets re-live the GTAIV days again!

well it is practically the same game and why wouldnt it be if it was done in iv

Link to comment
Share on other sites

Umm..can we modify the players Money? (Add or subtract) becoz I didn't found a native :/

Link to comment
Share on other sites

Umm..can we modify the players Money? (Add or subtract) becoz I didn't found a native :/

Haven't found one either, maybe it's modified via "STAT_SET_XXX" and "STAT_GET_XXX", but haven't tried. You can edit the money a ped is carrying though, use "Ped.Money" for that. =)

 

 

so how would i use this in vb.net?

 

First download the latest source code from Github and build it, copy the new ASI to your game and then do something like this in your script:

Imports GTA...Dim peds As Ped() = World.GetNearbyPeds(Game.Player.Character, 1000F)
Link to comment
Share on other sites

I'm searching Native function like on the old "ScriptHookDotNet.dll" (Grand Theft Auto IV/ Episodes from Liberty City) for Grand Theft Auto V City but I can't found it in source Native on Alexander Blade site or GTAModding website's. Here's code on the old "ScriptHookDotNet.dll": Game.GetWaypoint

 

Thanks for your reply!

Edited by Nada_4D
Link to comment
Share on other sites

identitymatrix

Is this .net wrapping basicly contructing classes with methods that run purley native functions? Or is it something more?

 

 

The code in model.cpp looks like I imagned.

 

Untill you get to vectors, matrix, rotation, anything that uses slimdx.....

bool Model::IsBoat::get()	{		return Native::Function::Call<bool>(Native::Hash::IS_THIS_MODEL_A_BOAT, this->mHash);	}	bool Model::IsCar::get()	{		return Native::Function::Call<bool>(Native::Hash::IS_THIS_MODEL_A_CAR, this->mHash);	}	bool Model::IsHelicopter::get()	{		return Native::Function::Call<bool>(Native::Hash::IS_THIS_MODEL_A_HELI, this->mHash);	}	bool Model::IsPed::get()	{		return IsValid && !IsVehicle;	}	bool Model::IsPlane::get()	{		return Native::Function::Call<bool>(Native::Hash::IS_THIS_MODEL_A_PLANE, this->mHash);	}
Link to comment
Share on other sites

unknown modder

I'm searching Native function like on the old "ScriptHookDotNet.dll" (Grand Theft Auto IV/ Episodes from Liberty City) for Grand Theft Auto V City but I can't found it in source Native on Alexander Blade site or GTAModding website's. Here's code on the old "ScriptHookDotNet.dll": Game.GetWaypoint

 

Thanks for your reply!

something like this?

	bool Game::IsWaypointActive::get()	{		return Natives::IS_WAYPOINT_ACTIVE() != 0;	}	Blip ^Game::Waypoint::get()	{		return gcnew Blip(Natives::GET_FIRST_BLIP_INFO_ID(Natives::_GET_BLIP_INFO_ID_ITERATOR()));	}
Link to comment
Share on other sites

    'Source code : Nada 4D    Public Sub Hiip_hôp()        If ON_or_OFF Then            Dot = Game.GetWaypoint            If Not Exists(Dot) Then                msg("You must place the way point ! ( ~BLIP_8~ )", 1000)            End If            If Exists(Dot) Then                Dim Vector As GTA.Vector3 = New GTA.Vector3()                Vector = Dot.Position()                If Not Game.LocalPlayer.Character.isInVehicle Then                    World.LoadEnvironmentNow(Dot.Position)                    Game.LoadAllPathNodes = True                    Game.LocalPlayer.Character.Position = Dot.Position.ToGround                End If                If Game.LocalPlayer.Character.isInVehicle Then                    If Game.LocalPlayer = Game.LocalPlayer.Character.CurrentVehicle.GetPedOnSeat(VehicleSeat.Driver) Then                        World.LoadEnvironmentNow(Dot.Position)                        Game.LoadAllPathNodes = True                        Game.LocalPlayer.Character.Position = Dot.Position.ToGround                    End If                    If Not Game.LocalPlayer = Game.LocalPlayer.Character.CurrentVehicle.GetPedOnSeat(VehicleSeat.Driver) Then                        msg("You must be the driver !", 1000)                    End If                End If            End If        End If    End Sub

Hi, thanks for your reply. Here's my old code for Grand Theft Auto IV/ Episodes from Liberty City. I Wonder if we can set the way point on the map and teleport on the same way point in Grand Theft Auto V. I can't try these Native you shared here because we can't continue in our project on .Net at the moment whitout the new "ScriptHookV.dll"... :/

 

I hope we can get new version soon of "ScriptHookVDotNet.dll" when Alexander Blade will update his "ScriptHookV.dll"! :lol:

Edited by Nada_4D
Link to comment
Share on other sites

Umm..can we modify the players Money? (Add or subtract) becoz I didn't found a native :/

 

There is a way to add money by using STAT_GET_INT and STAT_SET_INT, which is used in Alexander Blade's native trainer.

Here's my translated code:

void AddCash(int amount){    for (int i = 0; i < 3; i++) {        string statNameFull = string.Format("SP{0}_TOTAL_CASH", i);        int hash = Function.Call<int>(Hash.GET_HASH_KEY, statNameFull);        int val = 0;        OutputArgument outArg = new OutputArgument();        Function.Call<bool>(Hash.STAT_GET_INT, hash, outArg, -1);        val = outArg.GetResult<int>() + amount;        Function.Call(Hash.STAT_SET_INT, hash, val, true);    }} 

I tested it a little, and it seems to work just fine.

Edited by Raxdiam
Link to comment
Share on other sites

 

is there anyway to teleport?

like for example off of the mountain to your safehouse or police station?

game.player.character.position = Vector3(x,y,z);

 

x y z being the coordinates of where you want to teleport to

 

okay but could someone give me example code in vb.net due to I don't know what x,y,z I am supposed to put to teleport the player(me) to whichever character I am using and also to the police station.

you know basically if they go to safehouse teleport them to the right safehouse for the character

and also it would help if someone could tell me how to change the playerped back to the story character after changing the model to cop model.

Link to comment
Share on other sites

 

 

is there anyway to teleport?

like for example off of the mountain to your safehouse or police station?

game.player.character.position = Vector3(x,y,z);

 

x y z being the coordinates of where you want to teleport to

 

okay but could someone give me example code in vb.net due to I don't know what x,y,z I am supposed to put to teleport the player(me) to whichever character I am using and also to the police station.

you know basically if they go to safehouse teleport them to the right safehouse for the character

and also it would help if someone could tell me how to change the playerped back to the story character after changing the model to cop model.

 

 

Dim loc As New Vector3(-1336F, -3044F, 13.9F)Game.Player.Character.Position = loc 'Airport Field
Edited by Raxdiam
Link to comment
Share on other sites

 

Umm..can we modify the players Money? (Add or subtract) becoz I didn't found a native :/

Haven't found one either, maybe it's modified via "STAT_SET_XXX" and "STAT_GET_XXX", but haven't tried. You can edit the money a ped is carrying though, use "Ped.Money" for that. =)

 

 

so how would i use this in vb.net?

 

First download the latest source code from Github and build it, copy the new ASI to your game and then do something like this in your script:

Imports GTA...Dim peds As Ped() = World.GetNearbyPeds(Game.Player.Character, 1000F)

Thank-you, tried compiling before and i was missing nativecaller.h or maybe cpp

Edited by xsploit
Link to comment
Share on other sites

Thank-you, itried compiling before and i was kjssing nativecaller.h or maybe cpp

You need the Script Hook V SDK, as explained in the readme.

Link to comment
Share on other sites

Would Anyone mind please help me out by giving me michael's and trevor's and also franklin's ped hashes to change their ped model back?

because when I run it off of compiled code off of the github it says conversion to string to integer isn't valid.

Link to comment
Share on other sites

Would Anyone mind please help me out by giving me michael's and trevor's and also franklin's ped hashes to change their ped model back?

because when I run it off of compiled code off of the github it says conversion to string to integer isn't valid.

 

You need to calculate the hash from the string, and pass that in to SET_PLAYER_MODEL. You can either use:

int hash = Native.Function.Call<int>(Native.Hash.GET_HASH_KEY, "player_zero");

 

Or, you can use the API being built on top of the natives (which internally calls GET_HASH_KEY):

Model model = new Model("player_zero");int hash = model.Hash;

 

In case you still want the hashes for some reason:

"player_zero" = 0xD7114C9;   //Michael"player_one"  = 0x9B22DBAF;  //Franklin"player_two"  = 0x9B810FA2;  //Trevor

 

The native hashes were updated in the newest patch from Rockstar. I'm not sure about the model hashes, but if they were changed as well, that means it's probably best to compute the hash, instead of hardcoding it

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
 Share

  • 1 User Currently Viewing
    0 members, 0 Anonymous, 1 Guest

×
×
  • Create New...

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.