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)


  Reply to this topicStart new topicStart Poll

 Help with script for new game

 unlock map, delete cutscenes
 
Don Wasyl  
Posted: Friday, May 25 2012, 21:40
Quote Post


Player Hater
Group Icon
Group: Members
Joined: Jun 22, 2007

pl.gif

XXXXX



Hi
I'm a begginer in scripting for gta iv (i know c++ language), but needs your help.
I would like to write script in which I could:
1. unlock map (I can't find function which is responsible for this)
2. delete startup cutscenes
3. disable peds
4. place custom object in map, and rotate it when I get closer

Can I do it in C# script without interference in scripts.img (1.-2.)?

Maybe, this is easy, but I think I'm not the only who can take advantage of your help wink.gif
Users WebsitePM
  Top
 

 
Skorpro  
Posted: Wednesday, May 30 2012, 20:06
Quote Post


GTAholiker
Group Icon
Group: Members
Joined: Jul 19, 2009

eu.gif

XXXXX



QUOTE (Don Wasyl @ Friday, May 25 2012, 21:40)
1. unlock map (I can't find function which is responsible for this)
2. delete startup cutscenes
3. disable peds
4. place custom object in map, and rotate it when I get closer

Dzien dobry,

try the following codes (for aru's C++ Script Hook Version 0.4.0 (Development Kit)!

1. Unlock all bridges/islands
QUOTE

SetIntStat(STAT_ISLANDS_UNLOCKED, 3); // STAT_ISLANDS_UNLOCKED = 363


2. I have no idea!

3. Disable peds
QUOTE

f32 x, y, z;
GetCharCoordinates(GetPlayerPed(), &x, &y, &z);
ClearAreaOfChars(x, y, z, 400.0f);
ClearAreaOfCops(x, y, z, 400.0f);
SetPedDensityMultiplier(0.0); // Switch all peds OFF


4. Create object and rotate
QUOTE

Object object; // GLOBAL!

.........

eModel model = 185750165; // CJ_NF_GARAGE_DOOR => 185750165 => 0x0B125295
// Set your coords here
f32 x = -420.245f;
f32 y = 1137.605f;
f32 z = 12.530f;
f32 a = 90.0f;  // angle = 90°

RequestModel(model);
while(!HasModelLoaded(model)) { Wait(0); }
CreateObject(model, x, y, z, &object, 1);
SetObjectCollision(object, 1);
SetObjectVisible(object, 1);
SetObjectHeading(object, a);

.........

while(IsThreadAlive())
{
if (IsCharInArea3D(GetPlayerPed(), 900.0f, 700.0f, 20.0f, 999.0f, 799.0f, 29.0f, 0)) // This are example coords only!!!
{
  RotateObject(object, 90.0f, 10.f, 1);
}
Wait(0);
}


IMPORTANT: Add this to scripting.h
CODE

static void RotateObject(Object obj, float angle, float rotSpeed, b8 unknown) { NativeInvoke::Invoke<NATIVE_ROTATE_OBJECT, ScriptVoid>(obj, angle, rotSpeed, unknown); }
static void SetPedDensityMultiplier(f32 pedDensity) { NativeInvoke::Invoke<NATIVE_SET_PED_DENSITY_MULTIPLIER, ScriptVoid>(pedDensity); }


QUOTE
Can I do it in C# script without interference in scripts.img (1.-2.)?

Yes (point 1,3 and 4)! Convert my codes to C#.
Point 2: I don't know!

Good luck biggrin.gif
Users WebsitePM
  Top
 

 

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

0 Members:

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



 
IMG IMG