#1 31-12-2009 05:09

angeloelibz24
Registered: 18-06-2009
Posts: 22

"Line of sight"

Sorry if this is a stupid question, but is there by chance a code that checks if you're at the line of sight (of police/enemy/etc.)?

I'm making a simple "disguise" mod that allows you to change CJ's form to that of closest ped. Works very similarly to the Citizens mod, but it's made as a CLEO mod, and I'm making this just for myself (I have no plans of releasing it).

Like in the game [PROTOTYPE], I was wondering if it is possible to have it so that if CJ shape-shifts while in the line of sight, he cannot evade the police, as well as making an indicator that tells if you are in the line of sight or not. And, no, I'm not planning to make a [PROTOTYPE] mod in case you're wondering. sad

Last edited by angeloelibz24 (31-12-2009 05:11)

Offline

#2 31-12-2009 08:06

Den_spb
From: Ленинград
Registered: 23-11-2008
Posts: 941
Website

Re: "Line of sight"

May be you need it:

09ED:   actor 71@ is_within_field_of_view_actor $PLAYER_ACTOR

Offline

#3 31-12-2009 08:35

angeloelibz24
Registered: 18-06-2009
Posts: 22

Re: "Line of sight"

Damn. It's close, but not close enough, unless there's an "everyone/all peds" variable or "$EVERYONE" or something that I can use for this code, is there?

Offline

#4 31-12-2009 12:05

Den_spb
From: Ленинград
Registered: 23-11-2008
Posts: 941
Website

Re: "Line of sight"

You can write random ped from certain zone to variable with opcodes:

073F: get_actor_in_sphere 4@ 7@ 10@ radius 20.0 with_pedtype_civilian 1 gang 1 criminal/prostitute 1 handle_as 27@ 
089E: get_actor_in_sphere 3@ 4@ 5@ radius 5.0 handle_as 11@ // versionB 
08E5: get_actor_in_sphere 27@ 28@ 29@ radius 50.0 handle_as 0@

or with this code: http://sannybuilder.com/forums/viewtopic.php?id=75&p=1
Also you can write closest ped with opcode:

0AB5: store_actor $PLAYER_ACTOR closest_vehicle_to 0@ closest_ped_to 1@

Offline

Board footer

Powered by FluxBB