Jump to content

» «

Ped AI Hacking

60 replies to this topic
  • Upaluppa


  • Members
  • Joined: 20 Jan 2009


Posted 26 February 2009 - 10:50 PM

QUOTE (Durka Durka Mahn @ Feb 26 2009, 22:22)
QUOTE (Upaluppa @ Feb 26 2009, 14:32)
QUOTE (Durka Durka Mahn @ Feb 26 2009, 02:10)
All I did for that was I took a construction made using ADe's shape maker thing on CheatSync, took a few chunks out, then used a single if statement:

x = getfloat(pobj+0x30); //Save the player's x coord
y = getfloat(pobj+0x34); //Save the player's y coord
portalcenterx = ...; //TO BE DEFINED BY YOU...
portalcentery = ...; //TO BE DEFINED BY YOU...
dx = x - portalcenterx; //Calc the distance on the x axis
dy = y - portalcentery; //Calc the distance on the y axis
if(sqrt(dx^2 + dy^2) < 5.0) //Calc two dimensional distance using dx and dy, and if that value is less than 5.0 (the player is within 5.0 units of the portal center)
    //do something...

Hey thank you a lot mate !
That was what I was looking for.
I`ll modify it to fit my needs and then I can just copy and paste it over and over again and only need to change the coordinates !

By the way:

x = getfloat(pobj+0x30); //Save the player's x coord
y = getfloat(pobj+0x34); //Save the player's y coord

You only get the x and y coordinates there !
I thought the z coordinate must be defined aswell... mercie_blink.gif

I thought, what happens if I create a portal INSIDE the Vice Point Mall interior, for example.
If I try to teleport to this portal inside the mall, how does the Cheatdevice know, that the portal is underneath the normal map ?
I guess it will teleport me onto the malls roof instead of inside, because the roof is located exactly over the mall interior...

Edit: Ah forget it, I think you probably wouldn`t post it like this if it was required, so I`ll just try it like this and see how it`s going to look ingame.

Thanks again ! icon14.gif

You could, just make another variable called z and dz, only you would need to add
&& abs(dz) < 5.0

to the if statement.

Alright mate !

I`ll do that...

I knew that I could create a third variable for the height, but I did not know that the cheat also works, if you leave it out !
Looks like you can leave the height variable out if you place it somewhere at an open space.

I never knew that, I always used x, y and z coordinates, might be usefull for my pedspawning cheat, because it somehow has problems with the z coordinate.

For whatever reason the peds sometimes spawn at the wrong height, underneath the map to be exact... notify.gif

Maybe it works better if I leave the z value out ?

I`m going to try it and compare the results. icon14.gif

1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users