Jump to content
    1. Welcome to GTAForums!

    1. GTANet.com

    1. GTA Online

      1. Los Santos Drug Wars
      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. Forum Support

    3. Suggestions

C++ Script Hook


aru
 Share

Recommended Posts

is there any way to save the object we make until the script is turned off?

or native that used like getclosestobjectwithmodel?

I think i found it myself,just use Scripting::Object obj; on header file

 

g4mGunner: so if the spawned object is deleted(by the script) still wont sync?

 

Link to comment
Share on other sites

 

is there any way to save the object we make until the script is turned off?

or native that used like getclosestobjectwithmodel?

I think i found it myself,just use Scripting::Object obj; on header file

 

g4mGunner: so if the spawned object is deleted(by the script) still wont sync?

I haven't tried deleting it yet but it seems the netcode allocates 50 slots for objects and once those are full i don't think they will be cleared on removal of an object.

 

Also MarkObjectAsNoLongerNeeded crashes.

 

PS. This was awesome:

 

user posted image

Edited by g4mGunner
Link to comment
Share on other sites

nm, yeah i mentioned the bones theres some other funky 3 way returns as well.

Edited by C06alt
Link to comment
Share on other sites

I want to make my mod in such a way, that it can not be used to cheat online. But I don't want to disable it completely, since people might like it to screw around with.

 

So, I want it to be like this:

1.Playing on a ranked server? Mod completely disabled (done already smile.gif )

2.Playing on any other kind of server? Display a message to all players when the user activates the mod. This way they know he's cheating, and he can be dealt with accordingly.

 

How would I make no.2 work? Any suggestions?

 

Link to comment
Share on other sites

I want to make my mod in such a way, that it can not be used to cheat online. But I don't want to disable it completely, since people might like it to screw around with.

 

So, I want it to be like this:

1.Playing on a ranked server? Mod completely disabled (done already smile.gif )

2.Playing on any other kind of server? Display a message to all players when the user activates the mod. This way they know he's cheating, and he can be dealt with accordingly.

 

How would I make no.2 work? Any suggestions?

I don't think you can send text to every player in the 'server'. That would result into rather annoying stuff anyway.

Link to comment
Share on other sites

very good aru, finally a decent language biggrin.gif

 

edit: to the people suggesting making these mods not usable online,

i suggest waiting for a 3rd party multiplayer mod, its obviously possible and with the new RAGE seems easier then ever to implement

 

as well as a working anticheat that will hopefully be promising

sarcasm.gif

 

edit2:

@ thaCURSEDpie: i remember when i was using scripted functions in my C++ loader thing, there was a function called IsOnline or something along those lines.

 

hopefully arus stuff includes it also biggrin.gif

 

if not, here is something

 

g_Natives.Network.IsNetworkConnected  = (BYTE(*)(void))GTAIDA(0xB4A800);

g_Natives.Network.IsNetworkGameRunning  = (BYTE(*)(void))GTAIDA(0xB4A810);

g_Natives.Network.IsNetworkGamePending  = (BYTE(*)(void))GTAIDA(0xB4A820);

 

 

#define GTAIDA(x) ((DWORD)g_Natives.Addon.hGTA + (x - 0x400000))

 

the definition just turns IDA addresses into real-working addresses for those who are lazy.

 

BYTE  (__cdecl *IsNetworkConnected)( void );

BYTE  (__cdecl *IsNetworkGameRunning)( void );

BYTE  (__cdecl *IsNetworkGamePending)( void );

 

 

Edited by opium_addict
Link to comment
Share on other sites

Does anyone have an idea why the following native never seems to work:

 

SetCharWillFlyThroughWindscreen(c,0)

 

The player still flies through the windscreen...

 

 

 

 

Link to comment
Share on other sites

As earlier noted, MarkObjectAsNoLongerNeeded crashes, little help guys.. show me some love inlove.gifbiggrin.gif

 

EDIT:

 

Also what does GetHeadingFromVector2D do? I thought it might be a function to get the heading of XY to player but it seems to do nothing..

 

 

	float hCam;GetHeadingFromVector2D(xNew,yNew, &hCam);SetObjectHeading(objid, hCam);

 

Edited by g4mGunner
Link to comment
Share on other sites

 

how to use two same function on one script in one time?

You cant? Code can only run one at the time... The only thing you can do is

 

function1();function2();

 

 

If that isnt a option, then you need to redesign your code...

Link to comment
Share on other sites

I think i dont have to,my problem is done(not by running two function)

I Have discovered to make an float object and make it guided to something

Link to comment
Share on other sites

<snip>

Yes, I know how to detect if the user is online, but I don't want to block online-play altogether, I just want to block ranked games (which I've already done), and let the user send a chat message like: "I am a cheater: godmode on". That way they still can play around with friends, who can just ignore the message, but when they use it on a public server, all players will know the user is cheating.

 

 

Link to comment
Share on other sites

 

and let the user send a chat message like: "I am a cheater: godmode on".

thats Hurts if the user doesnt know that was cheating.

 

Edit:

Hey ,anyone, how to make a bool that not only false and true but 1,2,3,4?

using

 

if(WD){}else{}else{}else{}

 

is that the one of them?

 

Edited by aceship
Link to comment
Share on other sites

@Aceship:

Use integers!

 

And I think it's quite obvious that turning on godmode while online is cheating...

 

Link to comment
Share on other sites

Or in normal language:

 

Declare

 

INT whatever = 0;

 

Then:

 

if (whatever ==0)

{

 

do something;

whatever =1

}

else if (whatever ==1)

{

do something else;

whatever =2

}

else if (whatever ==2)

do something else;

whatever = 3

{

 

smile.gif

Edited by sjaak327
Link to comment
Share on other sites

 

Or in normal language:

 

Declare

 

INT whatever = 0;

 

Then:

 

if (whatever ==0)

{

 

do something;

whatever =1

}

else if (whatever ==1)

{

do something else;

whatever =2

}

else if (whatever ==2)

do something else;

whatever = 3

{

 

smile.gif

 

 

use SWITCH, when you're using Int's (works only with ints)

 

 

int val;switch(val){case 1: //do stuff break;case 2:  // do stuff break;case 3:  //do stuff  break;}

 

Link to comment
Share on other sites

ok,it seems i ask my brother(Study at Indonesian Binus University)

i use int

But i didnt want to use Break;

because mine is not a case one

 

and one more question

how to display a text with real time Update?

like

"HP:||||||||||"

when the hp is 5

"HP:|||||"

 

So how to do it?

 

 

Andd

How To Do Something when i use Wait(3000)?

 

 

Edited by aceship
Link to comment
Share on other sites

ok,it seems i ask my brother(Study at Indonesian Binus University)

i use int

But i didnt want to use Break;

because mine is not a case one

 

and one more question

how to display a text with real time Update?

like

"HP:||||||||||"

when the hp is 5

"HP:|||||"

 

So how to do it?

 

 

Andd

How To Do Something when i use Wait(3000)?

You cant. If you want no flickering, you must use Wait(0). Or use DX Hooking tounge.gif ORRR Use the .Net Scripthook. it has PerFrameRendering function.

Link to comment
Share on other sites

ok,it seems i ask my brother(Study at Indonesian Binus University)

i use int

But i didnt want to use Break;

because mine is not a case one

 

and one more question

how to display a text with real time Update?

like

"HP:||||||||||"

when the hp is 5

"HP:|||||"

 

So how to do it?

 

 

Andd

How To Do Something when i use Wait(3000)?

You cant. If you want no flickering, you must use Wait(0). Or use DX Hooking tounge.gif ORRR Use the .Net Scripthook. it has PerFrameRendering function.

Yes you can by using this hook, that's how the speedometer works in my trainer smile.gif

 

 

Link to comment
Share on other sites

What if i include My Script like #include "Myscript.cpp"?

Or a header that use 0sec DisplayText?

 

if i cant do that, how to hook to dx?

Link to comment
Share on other sites

Plese read this very thread, it's only about 20 pages, and it is explained repeatedly how to do it.

 

 

Link to comment
Share on other sites

Ok, im reading it.

Is the Direct x hooking help are on this Very thread?

Yes actually either on the first or second page, maybe it would be better if you explain exactly what it is that you want ?

 

 

Link to comment
Share on other sites

Actualy, Im now making one script that make an Drone BodyGuard, I already make it floating,Change Weapon,And now i m making a Health one for my drone script

so, is there any ambient spawner?

like dir_fire, maybe i can make a flame thrower drone,

and is there any way to spawn weapon and throw it?(the Projectile one)

Link to comment
Share on other sites

Ok, im reading it.

Is the Direct x hooking help are on this Very thread?

Yes actually either on the first or second page, maybe it would be better if you explain exactly what it is that you want ?

Theres nothing in this thread about hooking DX. Think you got two things mixed up...

Link to comment
Share on other sites

Ok, im reading it.

Is the Direct x hooking help are on this Very thread?

Yes actually either on the first or second page, maybe it would be better if you explain exactly what it is that you want ?

Theres nothing in this thread about hooking DX. Think you got two things mixed up...

Yes there is, on the second page:

 

http://www.gtaforums.com/index.php?showtop...st&p=1058853945

 

 

Link to comment
Share on other sites

hey,

is there any possibility to unlock car doors? i can lock them but i dont find a function to unlock them sad.gif

 

 

Link to comment
Share on other sites

hey,

is there any possibility to unlock car doors? i can lock them but i dont find a function to unlock them sad.gif

Thats most likely because people use the LOCK_CAR_DOORS native wrong. The second parameter is NOT the door id, but the lock level for all doors. Call LOCK_CAR_DOORS with 0 as second parameter and the doors are unlocked.

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.