Quantcast
Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
    1. Welcome to GTAForums!

    2. News

    1. Red Dead Redemption 2

      1. News
      2. Red Dead Online
      3. The Armadillo Inn
    1. GTA Online

      1. After Hours
      2. Find Lobbies & Players
      3. Guides & Strategies
      4. Vehicles
      5. Content Creator
      6. Help & Support
    2. Crews

      1. Events
      2. Recruitment
    1. Grand Theft Auto Series

    2. GTA Next

    3. GTA V

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

      1. Episodes from Liberty City
      2. Multiplayer
      3. Guides & Strategies
      4. Help & Support
      5. GTA Mods
    5. GTA Chinatown Wars

    6. GTA Vice City Stories

    7. GTA Liberty City Stories

    8. GTA San Andreas

      1. Guides & Strategies
      2. Help & Support
      3. GTA Mods
    9. GTA Vice City

      1. Guides & Strategies
      2. Help & Support
      3. GTA Mods
    10. GTA III

      1. Guides & Strategies
      2. Help & Support
      3. GTA Mods
    11. Top Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    12. Wiki

      1. Merchandising
    1. GTA Modding

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Mod Showroom

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

      1. DYOM
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Red Dead Redemption

    2. Rockstar Games

    1. Off-Topic

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

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

    2. Site Suggestions

crosire

Community Script Hook V .NET

Recommended Posts

julionib

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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites
crosire

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.

Share this post


Link to post
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.

Share this post


Link to post
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.

Share this post


Link to post
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

Share this post


Link to post
Share on other sites
crosire

 

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.

Share this post


Link to post
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.

Share this post


Link to post
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

Share this post


Link to post
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..?

Share this post


Link to post
Share on other sites
crosire

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

Share this post


Link to post
Share on other sites
timnboys

is there anyway to teleport?

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

Edited by timnboys

Share this post


Link to post
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

Share this post


Link to post
Share on other sites
c39687

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

Share this post


Link to post
Share on other sites
Rugz007

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

Share this post


Link to post
Share on other sites
crosire

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)

Share this post


Link to post
Share on other sites
Nada_4D

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

Share this post


Link to post
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);	}

Share this post


Link to post
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()));	}

Share this post


Link to post
Share on other sites
Nada_4D
    '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

Share this post


Link to post
Share on other sites
Raxdiam

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

Share this post


Link to post
Share on other sites
timnboys

 

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.

Share this post


Link to post
Share on other sites
Raxdiam

 

 

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

Share this post


Link to post
Share on other sites
xsploit

 

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

Share this post


Link to post
Share on other sites
crosire
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.

Share this post


Link to post
Share on other sites
timnboys

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.

Share this post


Link to post
Share on other sites
wozzy

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

Share this post


Link to post
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

  • 3 Users Currently Viewing
    0 Members, 0 Anonymous, 3 Guests

×

Important Information

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