Quantcast

Jump to content

» «
Photo

Removing Buildings by Script

36 replies to this topic
LetsPlayOrDy
  • LetsPlayOrDy

    Too fast for ya

  • Members
  • Joined: 24 Aug 2013
  • United-States

#31

Posted 11 June 2014 - 05:28 PM

whoa.. that isn't playable..

 

Most likely not, but you could try it. That's the only way I see this being done.


LordOfTheBongs
  • LordOfTheBongs

    Deceased

  • Members
  • Joined: 21 Sep 2013
  • None

#32

Posted 11 June 2014 - 05:40 PM

Nope nothing happends... 

 

 

 

Model is a property of GTA objects (peds, vehicles, objects) so no... u can spawn an object with a specific model ;)

 

But you can't do that with a building.. right ? Or am I completely wrong here ?

oh ok, maybe ill see why later when i have a chance, id like to see if this native produces any results

 

also i know of no way to spawn a building like an object


hardsty1e
  • hardsty1e

    RIP Yeardley Diamond

  • Members
  • Joined: 02 May 2009
  • Philippines

#33

Posted 11 June 2014 - 06:36 PM Edited by hardsty1e, 11 June 2014 - 06:47 PM.

this might be an alternative for you.. you're able to drive through walls while not falling off the map

if(collision){
		if(IS_CHAR_IN_ANY_CAR(pPlayer)){
			if((!IS_CHAR_IN_ANY_BOAT(pPlayer)) && (!IS_CHAR_IN_ANY_HELI(pPlayer))){
				GET_CAR_CHAR_IS_USING(pPlayer,&pveh);
				SET_CAR_ON_GROUND_PROPERLY(pveh);
				SET_CAR_COLLISION(pveh, false);
			}
			else{
				GET_CAR_CHAR_IS_USING(pPlayer,&pveh);
				SET_CAR_COLLISION(pveh, false);
			}
		}
	}

LordOfTheBongs
  • LordOfTheBongs

    Deceased

  • Members
  • Joined: 21 Sep 2013
  • None

#34

Posted 11 June 2014 - 07:22 PM Edited by LordOfTheBongs, 11 June 2014 - 07:25 PM.

Nope nothing happends... 

 

 

 

Model is a property of GTA objects (peds, vehicles, objects) so no... u can spawn an object with a specific model ;)

 

But you can't do that with a building.. right ? Or am I completely wrong here ?

ok this is a working script to test the native... though i didnt see any results with a few values i tested but here is a script for someone who would like to test more values

namespace BuildingSwapTest
{
    using System.Windows.Forms;
    using GTA;
    
    public class Main : Script
    {
        public Main()
        {
            BindKey(Keys.Insert, delegate
            {
                Vector3 p = Game.LocalPlayer.Character.Position;
                uint maxValueToCheck = 1000;//use whatever u like
                float radius = 100f;//go near some building
 
                for (uint x = 0; x <= maxValueToCheck; x++)
                {
                    bool exit = false;

                    for (uint y = 0; y <= maxValueToCheck; y++)
                    {
                        if (Game.isKeyPressed(Keys.End))
                        {
                            Game.DisplayText("Exiting Building Swap Test...");
                            exit = true;
                            break;
                        }
 
                        while (!Game.isKeyPressed(Keys.Enter))
                        {
                            Game.DisplayText("Calling SWAP_NEAREST_BUILDING_MODEL Native With Params:\nPosition: " + p.ToString() + "\nRadius: " + radius.ToString() + "\nModel From: " + x.ToString() + "\nModel To: " + y.ToString() + "\n\nPress Enter To Test!!");
                            Wait(0);
                        }
                        Wait(250);

                        GTA.Native.Function.Call("SWAP_NEAREST_BUILDING_MODEL", p.X, p.Y, p.Z, radius, x, y);
                        
                        Wait(0);
                        while (!Game.isKeyPressed(Keys.Enter))
                        {
                            Game.DisplayText("Did anything happen?? Press Enter To Continue!!");
                            Wait(0);
                        }
                        Wait(250);
                    }
                    if (exit) break;
                }            
            });
        }
    }
}

InfamousSabre
  • InfamousSabre

    Harpocrates

  • Members
  • Joined: 03 Jan 2013

#35

Posted 11 June 2014 - 08:28 PM Edited by InfamousSabre, 12 June 2014 - 03:24 AM.

since that uint is likely a hash code, the for loops may not be much help.
will have to get the models hash code from gtamodding or something
 


LordOfTheBongs
  • LordOfTheBongs

    Deceased

  • Members
  • Joined: 21 Sep 2013
  • None

#36

Posted 11 June 2014 - 08:49 PM

ah didnt think of that, i guess i assumed they assigned bulding some type of model id

 

good point ;)


stef538
  • stef538

    It's just me, going 88 MPH.

  • Members
  • Joined: 06 Oct 2012
  • Netherlands

#37

Posted 13 June 2014 - 10:24 AM

well, i spawned the building as an object and made some kind of object spawner so i can move it around etc etc. but now there i can't enable collision :@ there is always something :/





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users