IMG

 
IMG
IMG   IMG
  Welcome to GTAForums! Be sure to check out the Grand Theft Auto V Forum.

You are not registered! (If you are, click here to login) Registering is fast, free and easy and allows you to instantly reply to any topic on GTAForums.
Why wait? Click here to register your own unique username and become part of the ever-growing community!


( Log In | Register | Revalidate Validation E-mail )
Quick Log-In:
  IMG
       
>
Forum Rules GTA Modification Forums

Post mod/code requests in the Mod Requests topic

Post mod releases in the Mod Showroom

Read the Modding Rules BEFORE posting!

GTAGarage.com
free mod hosting from GTANet, simply login with your GTAForums account details

GTAModding.com
GTANet's modding wiki

GTA Modding Chatroom
provided by irc.gtanet.com (Don't have an IRC client? Click here)


Pages: (146) « First ... 142 143 [144] 145 146   ( Go to first unread post ) Reply to this topicStart new topicStart Poll

 [BETA] GTAIV .Net ScriptHook

 V1.6.1.1 Released 1.0.6.0 / EFLC Support
 
Timmoboy  
Posted: Saturday, Jul 21 2012, 04:33
Quote Post


Player Hater
Group Icon
Group: Members
Joined: Jul 21, 2012

XXXXX



Hello. I'm in really deep water with this and I have no knowledge of coding what so ever!

The only reason I started was because I could not find one single mod/script that did what I wanted. Basically, all I want is when I fire my silenced gun in the game, it won't attract much attention, if none. Especially if you are alone and you kill a cop you shouldn't get chased by everyone because there was no witnesses etc.

I have no idea if that's even possible but I gave it a shot and this is what I came up with:

If Player.isShooting.DesertEagle = True Then (I have replaced the eagle with a silenced gun)

Player.IgnoredByEveryone = True

The first line is something I just came up with because I could not find anything better.

I would really like some big help with this and I will forever be in your debt if you get something like this working!
PM
  Top
 

 
fengyeblade  
Posted: Wednesday, Aug 1 2012, 06:15
Quote Post


Blade Feng Land
Group Icon
Group: Members
Joined: Feb 1, 2009

cn.gif

XXXXX



I make a ped , add a task to enter vehicle.

CODE
GudList[z].Task.ClearAll();
GudList[z].Task.AlwaysKeepTask = true;
GudList[z].Task.EnterVehicle(GudCar[0], VehicleSeat.Driver);


and make he drive vehicle to a point.

CODE

if (GudList[z].isInVehicle(GudCar[0]))
GudList[z].Task.DriveTo(endpoint, sspeed, false);


but , in game, the ped get in car, get out ,get in ,get out , get in , get out ....
he can't stay in the vehicle.
how make he stay in the car , still i give he command?
PM
  Top
 

 
_Charger_  
Posted: Sunday, Aug 5 2012, 15:53
Quote Post


Germany
Group Icon
Group: Members
Joined: Apr 1, 2010

gr.gif

XXXXX



hi i have a problem... i wanna remove buttons with
CODE
this.Controls.Remove()
but it doesn't work...

CODE
2012-08-05 17:37:46 - Error during Form.ShowDialog:
                     System.NullReferenceException: Object reference not set to an instance of an object.
                        at GTA.Forms.Control.get_Controls()
                        at GTA.Forms.Control.set_Parent(Control value)
                        at GTA.Forms.ControlCollection.Remove(Control item)
                        at IV_SA_Tuning_Garage.GarageUI.neonOffBtn_Click(Object sender, MouseEventArgs e)
                        at GTA.Forms.Control.raise_Click(Object value0, MouseEventArgs value1)
                        at GTA.Forms.Button.OnClick(MouseEventArgs e)
                        at GTA.Forms.FormHost.TriggerMouseUp(MouseEventArgs e)
                        at GTA.Script.ProcessEvents()
                        at GTA.Forms.Form.ShowDialog()

is the error message, but i don't understand why it says NullReferenceException. The buttons are visible and enabled, and they work... they are "global" so the function (btw it's the mouseclick event of one of these buttons) should be able to remove them.
Can anyone tell me if the remove function works, or isn't it possible to remove buttons?
PM
  Top
 

 
_Charger_  
Posted: Sunday, Aug 5 2012, 20:20
Quote Post


Germany
Group Icon
Group: Members
Joined: Apr 1, 2010

gr.gif

XXXXX



QUOTE (Timmoboy @ Saturday, Jul 21 2012, 06:33)
Hello. I'm in really deep water with this and I have no knowledge of coding what so ever!

The only reason I started was because I could not find one single mod/script that did what I wanted. Basically, all I want is when I fire my silenced gun in the game, it won't attract much attention, if none. Especially if you are alone and you kill a cop you shouldn't get chased by everyone because there was no witnesses etc.

I have no idea if that's even possible but I gave it a shot and this is what I came up with:

If Player.isShooting.DesertEagle = True Then (I have replaced the eagle with a silenced gun)

Player.IgnoredByEveryone = True

The first line is something I just came up with because I could not find anything better.

I would really like some big help with this and I will forever be in your debt if you get something like this working!

it would be possible, but u have to make a check for it (it must be a backgroudn thread or a function called by timer) and then checking if shooting, but people should only ignore the shot, not the player completly
PM
  Top
 

 
The Great  
Posted: Monday, Aug 6 2012, 12:17
Quote Post


The Great Legendary of Centuries
Group Icon
Group: Members
Joined: Jul 26, 2012

XXXXX



@HazardX

I have a problem when i start GTA IV there written msvcr100.dll is missing and i install msvcr100.dll at C:\Windows\System32 and i start GTA 4 but another problem came but i will give the photo here is ituser posted image
PM
  Top
 

 
_Charger_  
Posted: Tuesday, Aug 7 2012, 11:29
Quote Post


Germany
Group Icon
Group: Members
Joined: Apr 1, 2010

gr.gif

XXXXX



QUOTE (_Charger_ @ Sunday, Aug 5 2012, 17:53)
hi i have a problem... i wanna remove buttons with
CODE
this.Controls.Remove()
but it doesn't work...

CODE
2012-08-05 17:37:46 - Error during Form.ShowDialog:
                     System.NullReferenceException: Object reference not set to an instance of an object.
                        at GTA.Forms.Control.get_Controls()
                        at GTA.Forms.Control.set_Parent(Control value)
                        at GTA.Forms.ControlCollection.Remove(Control item)
                        at IV_SA_Tuning_Garage.GarageUI.neonOffBtn_Click(Object sender, MouseEventArgs e)
                        at GTA.Forms.Control.raise_Click(Object value0, MouseEventArgs value1)
                        at GTA.Forms.Button.OnClick(MouseEventArgs e)
                        at GTA.Forms.FormHost.TriggerMouseUp(MouseEventArgs e)
                        at GTA.Script.ProcessEvents()
                        at GTA.Forms.Form.ShowDialog()

is the error message, but i don't understand why it says NullReferenceException. The buttons are visible and enabled, and they work... they are "global" so the function (btw it's the mouseclick event of one of these buttons) should be able to remove them.
Can anyone tell me if the remove function works, or isn't it possible to remove buttons?

i found a solution myself. this function is definetly buggy, but with
CODE
try
{
this.Controls.Remove(*item*);
}
catch (Exception e) { }
it worked...
PM
  Top
 

 
Darlyn  
Posted: Wednesday, Aug 8 2012, 22:32
Quote Post


Keyboard & mouse
Group Icon
Group: Members
Joined: Apr 22, 2006

jolly-roger.gif

XXXXX



Any way to reload a single script?
PM
  Top
 

 
kmccmk9  
Posted: Wednesday, Aug 8 2012, 23:01
Quote Post


Crackhead
Group Icon
Group: Members
Joined: May 12, 2007

XXXXX



QUOTE (Timmoboy @ Saturday, Jul 21 2012, 04:33)
Hello. I'm in really deep water with this and I have no knowledge of coding what so ever!

The only reason I started was because I could not find one single mod/script that did what I wanted. Basically, all I want is when I fire my silenced gun in the game, it won't attract much attention, if none. Especially if you are alone and you kill a cop you shouldn't get chased by everyone because there was no witnesses etc.

I have no idea if that's even possible but I gave it a shot and this is what I came up with:

If Player.isShooting.DesertEagle = True Then (I have replaced the eagle with a silenced gun)

Player.IgnoredByEveryone = True

The first line is something I just came up with because I could not find anything better.

I would really like some big help with this and I will forever be in your debt if you get something like this working!

I can look into it.
PMXbox Live
  Top
 

 
Darlyn  
Posted: Thursday, Aug 9 2012, 13:15
Quote Post


Keyboard & mouse
Group Icon
Group: Members
Joined: Apr 22, 2006

jolly-roger.gif

XXXXX



QUOTE (Darlyn @ Wednesday, Aug 8 2012, 17:32)
Any way to reload a single script?

Anyone? Even if it's just a line that I can add into a script that resets it.
PM
  Top
 

 
CrazyRaisin  
Posted: Monday, Aug 20 2012, 19:11
Quote Post


Consoles suck, yeah I be hatin, problem?
Group Icon
Group: Members
Joined: Aug 20, 2012

cd.gif

XXXXX



Every time I try to connect to the download site it wont work, always get

QUOTE (Google Chrome)

Oops! Google Chrome could not connect to dl.hazardx.com
PM
  Top
 

 
thaCURSEDpie  
Posted: Thursday, Aug 23 2012, 14:25
Quote Post


GTA:IV scripter
Group Icon
Group: Members
Joined: Jul 1, 2007

XXXXX



EDIT:
Below post is probably irrelevant since I've already spoken with some competent people. None of whom can think of a fix at the moment. Too bad.



Since everyone in #gtaivnetscripthook seems afk I'll ask the question here.

I'm building a function-hooking module. It's got an unmanaged base which does all the actually dirty work (patching in jmp's and the like). Then there's the .Net part which can 'register' with the unmanaged part. This part is meant to act as an intermediate to allow end-developers (in .Net) to not have to deal with the unmanaged base. The intermediate exposes methods which allow .Net code to register detour methods.

So, say a hooked function is called (Let's take CPlayerChar::SetCharHealth as an example. If you don't agree with the naming, then too bad tounge.gif):

Flow of execution would be:
Game -> C++ module -> .Net intermediate -> .Net registered detours

So in our case we luckily have the .Net scripthook, which we can use to host the registered detour methods. I made a test class:
CODE

// Delegates
public delegate void Del_CPlayerChar_AddCharHealth(IntPtr CharInstance, int Instance, float amount);
public delegate void Del_CPlayerChar_SetCharHealth(IntPtr CharInstance, float amount, int unkInt);

public class Example : GTA.Script
   {
       private Del_CPlayerChar_AddCharHealth AddCharHealthDetour_Del;
       private Del_CPlayerChar_SetCharHealth SetCharHealthDetour_Del;

       private HookIntermediate hi;
       
       // Constructor
       public Example()
       {
           this.AddCharHealthDetour_Del = new Del_CPlayerChar_AddCharHealth(this.CPlayerChar_AddCharHealthDetour);
           this.SetCharHealthDetour_Del = new Del_CPlayerChar_SetCharHealth(this.CPlayerChar_SetCharHealthDetour);

           // We get a reference to the HookIntermediate instance
           this.hi = HookIntermediate.Get();

           // We register our detour. This works out fine.
           int retVal = hi.RegisterDetour("CPlayerChar::AddCharHealth", this.AddCharHealthDetour_Del);
       }

       private void CPlayerChar_SetCharHealthDetour(IntPtr CharInstance, float amount, int unkInt)
       {
           // This function is then called when the hooked function is called. The values are all correct, but the game hangs when the next line is executed:
           Game.Console.Print("Player health set to: " + amount.ToString());
       }
   }


When the detour method is called, everything works out *until* the moment a .net scripthook method is called (for example: Game.Console.Print() ). It seems it's not possible to call these methods from a different thread than the script-thread. Is this true?

The HookIntermediate is initialized (if it not yet exists) in the Get() method, so we are also always in the same AppDomain as the .net scripthook (SHDN_ScriptDomain wink.gif, yes, I've checked).

So the question is: how should I deal with this? Is there really no way to call for example Game.Console.Print() from any other thread?

This post has been edited by thaCURSEDpie on Monday, Aug 27 2012, 19:42
PM
  Top
 

 
Sunnyak  
Posted: Saturday, Sep 1 2012, 21:32
Quote Post


Player Hater
Group Icon
Group: Members
Joined: Sep 1, 2012

XXXXX



@HazardX
Plz Help me !! after installing Your Dot net Scripthook when i launch GTA 4, It says MSVCR 100.dll is missing or not design to run .......
PM
  Top
 

 
Sunnyak  
Posted: Saturday, Sep 1 2012, 21:37
Quote Post


Player Hater
Group Icon
Group: Members
Joined: Sep 1, 2012

XXXXX



@HazardX
i have a problem when i launch the Game it says MSVCR 100.dll is missing or not design to run ............. ??? plz HElp Me sad.gif
PM
  Top
 

 
mj3150  
Posted: Wednesday, Sep 5 2012, 14:27
Quote Post


Player Hater
Group Icon
Group: Members
Joined: Apr 16, 2008

XXXXX





If you get a "MSVCR100.dll not found" error:
Try installing the Microsoft Visual C++ 2010 Redistributable Package! Make sure to install the linked x86 version, even on x64 systems!

or just go to google and download the file and put it into the gta main folder
PM
  Top
 

 
motorsport71  
Posted: Tuesday, Sep 11 2012, 01:27
Quote Post


newbie modder
Group Icon
Group: Members
Joined: Oct 20, 2009

XXXXX



hey all, i have a question. i've written a script that saves info to an ini when i exit the mod, and loads that info when restarted. the problem i'm having is it will only write to the ini once. if i reloadscripts it will overwrite it once. i'm using!
CODE
settings.load() and settings.getvalueinteger
and to write the
value
CODE
settings.setvalue

is there a command to allow it to overwrite it without needing to restart the script?
PM
  Top
 

 
ch3y3zze  
Posted: Wednesday, Sep 12 2012, 00:26
Quote Post


ni**erKILLER
Group Icon
Group: BUSTED!
Joined: Aug 30, 2012

us.gif

XXXXX



@motorsport

Maybe don't use gta settings class and handle everything manually using stream classes from system.io, I haven't researched your issue but maybe that will give u more control wink.gif
PM
  Top
 

 
gtaivEflc  
Posted: Tuesday, Sep 25 2012, 15:05
Quote Post


Player Hater
Group Icon
Group: Members
Joined: Nov 1, 2011

XXXXX



Hello everybody!

I've found a bug or something like this..
There is no information about GET_STATE_OF_CLOSEST_DOOR_OF_TYPE native function, so I opened some .sco scripts and saw something like this:
GET_STATE_OF_CLOSEST_DOOR_OF_TYPE( iVar5, vVar6[0], ref uVar3, ref uVar4 ); (ray6.sco)
So, iVar5 is model hash, vVar6 is door location (Vector3),
ref uVar3 is locked/unlocked, ref uVar4 is door rotation angle.
The problem is -- uVar3 and uVar4 are ref.
GTA.Native.Function.Call("GET_STATE_OF_CLOSEST_DOOR_OF_TYPE", model.Hash, location.X, location.Y, location.Z, ref locked, ref angle) is incorrect!
Parameter can't be 'ref'.
Please solve this problem!

This post has been edited by gtaivEflc on Tuesday, Sep 25 2012, 15:13
PM
  Top
 

 
s1nk0  
Posted: Friday, Sep 28 2012, 07:54
Quote Post


Player Hater
Group Icon
Group: Members
Joined: Jun 19, 2011

XXXXX



Uploaded a working 1.0.4.0 version of Scripthook if anyone is having crashing issues with the latest release:
http://www.mediafire.com/?0z9up3l5u63odvd
PM
  Top
 

 
pedro2555  
Posted: Friday, Sep 28 2012, 15:02
Quote Post


Rat
Group Icon
Group: Members
Joined: Sep 2, 2012

XXXXX



QUOTE (Darlyn @ Thursday, Aug 9 2012, 13:15)
QUOTE (Darlyn @ Wednesday, Aug 8 2012, 17:32)
Any way to reload a single script?

Anyone? Even if it's just a line that I can add into a script that resets it.

You can always use

CODE

try
{
    // code
}
catch (Exception E)
{
   // maybe send the error to the console
}


to avoid script stoping on error.
PM
  Top
 

 
Max4X  
Posted: Sunday, Sep 30 2012, 17:54
Quote Post


Player Hater
Group Icon
Group: Members
Joined: Jun 14, 2008

kz.gif

XXXXX



Hi everyone!
Does anybody know what all these errors mean in my ScriptHookDotNet log file? I don't know why but net scripts don't work in my game (1.0.0.4). I have everything installed for it including .net framework 4.
Here is my log:
CODE
2012-09-30 22:44:14 - Initializing ScriptHookDotNet v1.7.1.7 BETA (on GTA IV version 1.0.0.4 with C++ Hook version 0.4.0)

2012-09-30 22:44:14 - WARNING: Your C++ ScriptHook version 0.4.0 and GTA IV version 1.0.0.4 are NOT known to be compatible! Use C++ ScriptHook version 0.5.1 or the newest version of the game AND the C++ ScriptHook instead!
2012-09-30 22:44:45 - Direct3D device created!
2012-09-30 22:44:45 - Error during ScriptDomain.Create:
                     System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
                        at GTA.RemoteScriptDomain..ctor()
                        --- End of inner exception stack trace ---
                        at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck)
                        at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache)
                        at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean skipCheckThis, Boolean fillCache)
                        at System.Activator.CreateInstance(Type type, Boolean nonPublic)
                        at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
                        at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
                        at System.Activator.CreateInstanceFromInternal(String assemblyFile, String typeName, Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, Evidence securityInfo)
                        at System.AppDomain.CreateInstanceFrom(String assemblyFile, String typeName)
                        at System.AppDomain.CreateInstanceFrom(String assemblyFile, String typeName)
                        at GTA.ScriptDomain.Create()
2012-09-30 22:44:45 -  -> InnerException:
                     System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
                        at GTA.RemoteScriptDomain..ctor()
2012-09-30 22:44:45 - INFO: Phone number checks are not available!
2012-09-30 22:47:41 - Direct3D device lost!


So is there any errors which could stop running the scripts?
PM
  Top
 

 

2 User(s) are reading this topic (2 Guests and 0 Anonymous Users)

0 Members:

Pages: (146) « First ... 142 143 [144] 145 146 

Topic Options Reply to this topicStart new topicStart Poll
Search topic for posted by (exact match)



 
IMG IMG