Difference between revisions of "03F1"
(5 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
+ | __NOTOC__ | ||
{{OpCode | {{OpCode | ||
− | | | + | | games = {{Icon|3}} {{Icon|VC}} |
− | | description = Sets the ped type's hostility to other | + | | command = SET_THREAT_FOR_PED_TYPE |
− | | | + | | description = Sets the [[ped type]]'s hostility to other ped types |
− | | | + | | syntax1 = 03F1: pedtype [''int1''] add_threat [''int2''] |
− | | | + | | p1t = [''int1''] |
+ | | p1d = [[Ped type]] | ||
+ | | p2t = [''int2''] | ||
+ | | p2d = Ped threat in [[flag field]] representation (see below) | ||
}} | }} | ||
− | |||
− | == | + | This opcode sets the ped type's hostility to other ped types and will attack the threat ped type on sight. The threat ped type cannot overwrite [[hardcoded]] threats but it can overwrite most threats set in the [[ped.dat]] file. The threat ped type value is represented as a flag field. The effect of this opcode can be reset using [[03F2]]. Peds that are already spawned cannot have their hostility changed actively using this opcode; this opcode only works on newly spawned peds. |
− | + | ||
− | {| {{ | + | == Ped threats == |
− | + | {|class="wikitable center-col-1" | |
− | + | !rowspan="2" |Flag ||rowspan="2" |Binary ||colspan="2" |[[SCM language III/VC definitions#THREAT|Enum]] | |
− | + | |- | |
− | + | !{{Icon|3}} ||{{Icon|VC}} | |
+ | |- | ||
+ | |1 | ||
+ | |<code>00 0000 0000 0000 0000 0000 0001</code> | ||
+ | |colspan="2" {{a|c}} |THREAT_PLAYER1 | ||
+ | |- | ||
+ | |2 | ||
+ | |<code>00 0000 0000 0000 0000 0000 0010</code> | ||
+ | |colspan="2" {{a|c}} |THREAT_PLAYER2 | ||
|- | |- | ||
− | | | + | |4 |
− | | | + | |<code>00 0000 0000 0000 0000 0000 0100</code> |
− | | | + | |colspan="2" {{a|c}} |THREAT_PLAYER3 |
− | | | ||
|- | |- | ||
− | | | + | |8 |
− | | 2 | + | |<code>00 0000 0000 0000 0000 0000 1000</code> |
− | | | + | |colspan="2" {{a|c}} |THREAT_PLAYER4 |
− | | | ||
|- | |- | ||
− | | | + | |16 |
− | | | + | |<code>00 0000 0000 0000 0000 0001 0000</code> |
− | | | + | |colspan="2" {{a|c}} |THREAT_CIVMALE |
− | | | ||
|- | |- | ||
− | | | + | |32 |
− | | | + | |<code>00 0000 0000 0000 0000 0010 0000</code> |
− | | | + | |colspan="2" {{a|c}} |THREAT_CIVFEMALE |
− | | | ||
|- | |- | ||
− | | | + | |64 |
− | | | + | |<code>00 0000 0000 0000 0000 0100 0000</code> |
− | | | + | |colspan="2" {{a|c}} |THREAT_COP |
− | | | ||
|- | |- | ||
− | | | + | |128 |
− | | | + | |<code>00 0000 0000 0000 0000 1000 0000</code> |
− | | | + | |THREAT_GANG_MAFIA ||THREAT_GANG_CUBAN |
− | | | ||
|- | |- | ||
− | | | + | |256 |
− | | | + | |<code>00 0000 0000 0000 0001 0000 0000</code> |
− | | | + | |THREAT_GANG_TRIAD ||THREAT_GANG_HAITIAN |
− | | | ||
|- | |- | ||
− | | | + | |512 |
− | | | + | |<code>00 0000 0000 0000 0010 0000 0000</code> |
− | | | + | |THREAT_GANG_DIABLO ||THREAT_GANG_STREET |
− | | | ||
|- | |- | ||
− | | | + | |1024 |
− | | | + | |<code>00 0000 0000 0000 0100 0000 0000</code> |
− | | | + | |THREAT_GANG_YAKUZA ||THREAT_GANG_DIAZ |
− | | | ||
|- | |- | ||
− | | | + | |2048 |
− | | | + | |<code>00 0000 0000 0000 1000 0000 0000</code> |
− | | | + | |THREAT_GANG_YARDIE ||THREAT_GANG_SECURITY |
− | | | ||
|- | |- | ||
− | | | + | |4096 |
− | | | + | |<code>00 0000 0000 0001 0000 0000 0000</code> |
− | | | + | |THREAT_GANG_COLOMBIAN ||THREAT_GANG_BIKER |
− | | | ||
|- | |- | ||
− | | | + | |8192 |
− | | | + | |<code>00 0000 0000 0010 0000 0000 0000</code> |
− | | | + | |THREAT_GANG_HOOD ||THREAT_GANG_PLAYER |
− | | | ||
|- | |- | ||
− | | | + | |16384 |
− | | | + | |<code>00 0000 0000 0100 0000 0000 0000</code> |
− | | | + | |||THREAT_GANG_GOLFER |
− | | | ||
|- | |- | ||
− | | | + | |32768 |
− | | | + | |<code>00 0000 0000 1000 0000 0000 0000</code> |
− | | | + | |||THREAT_GANG9 |
− | | | ||
|- | |- | ||
− | | | + | |65536 |
− | | | + | |<code>00 0000 0001 0000 0000 0000 0000</code> |
− | | | + | |colspan="2" {{a|c}} |THREAT_EMERGENCY |
− | | | ||
|- | |- | ||
− | | | + | |131072 |
− | | | + | |<code>00 0000 0010 0000 0000 0000 0000</code> |
− | | | + | |colspan="2" {{a|c}} |THREAT_PROSTITUTE |
− | | | ||
|- | |- | ||
− | | | + | |262144 |
− | | | + | |<code>00 0000 0100 0000 0000 0000 0000</code> |
− | | | + | |colspan="2" {{a|c}} |THREAT_CRIMINAL |
− | | | ||
|- | |- | ||
− | | | + | |524288 |
− | | | + | |<code>00 0000 1000 0000 0000 0000 0000</code> |
− | | | + | |colspan="2" {{a|c}} |THREAT_SPECIAL |
− | | | ||
|- | |- | ||
− | | | + | |1048576 |
− | | | + | |<code>00 0001 0000 0000 0000 0000 0000</code> |
− | | | + | |colspan="2" {{a|c}} |THREAT_GUN |
− | | | ||
|- | |- | ||
− | | | + | |2097152 |
− | | | + | |<code>00 0010 0000 0000 0000 0000 0000</code> |
− | | | + | |colspan="2" {{a|c}} |THREAT_COP_CAR |
− | | | + | |- |
+ | |4194304 | ||
+ | |<code>00 0100 0000 0000 0000 0000 0000</code> | ||
+ | |colspan="2" {{a|c}} |THREAT_FAST_CAR | ||
+ | |- | ||
+ | |8388608 | ||
+ | |<code>00 1000 0000 0000 0000 0000 0000</code> | ||
+ | |colspan="2" {{a|c}} |THREAT_EXPLOSION | ||
+ | |- | ||
+ | |16777216 | ||
+ | |<code>01 0000 0000 0000 0000 0000 0000</code> | ||
+ | |colspan="2" {{a|c}} |THREAT_FIREMAN | ||
+ | |- | ||
+ | |33554432 | ||
+ | |<code>10 0000 0000 0000 0000 0000 0000</code> | ||
+ | |colspan="2" {{a|c}} |THREAT_DEADPEDS | ||
|} | |} | ||
− | ==Keywords== | + | == Example == |
− | aggressive, hate, hostile, pedtype, gang | + | The following example lets you toggle Triads/Haitians hate towards the player by pressing the CAMERA key. A number is displayed on the screen to show the gang's hostility; 0 means it is not hostile and 1 means it is. This opcode only affects newly spawned gang members; gang members already spawned will not be affected. |
+ | <source lang="scm"> | ||
+ | // set constant | ||
+ | const | ||
+ | HATE = 0@ | ||
+ | end | ||
+ | |||
+ | // reset gang hate to player | ||
+ | 03F2: pedgroup 8 remove_threat 1 | ||
+ | HATE = false | ||
+ | |||
+ | // toggle gang hate to player | ||
+ | while true | ||
+ | wait 250 | ||
+ | if | ||
+ | 00E1: key_pressed 0 13 // camera key | ||
+ | then | ||
+ | if | ||
+ | HATE == false | ||
+ | then | ||
+ | 03F1: pedtype 8 add_threat 1 // set gang hostile | ||
+ | HATE = true | ||
+ | else | ||
+ | 03F2: pedgroup 8 remove_threat 1 // set gang not hostile | ||
+ | HATE = false | ||
+ | end | ||
+ | end | ||
+ | // display gang hate as a number onscreen | ||
+ | 01E5: text_1number_highpriority 'NUMBER' HATE 250 ms 1 | ||
+ | end | ||
+ | </source> | ||
+ | |||
+ | == Keywords == | ||
+ | set, add, threat, aggressive, hate, hostile, pedtype, gang |
Latest revision as of 05:08, 5 January 2016
- Description
- Sets the ped type's hostility to other ped types
- Syntax
- 03F1: pedtype [int1] add_threat [int2]
- Parameter
- [int1]
- Ped type
- [int2]
- Ped threat in flag field representation (see below)
This opcode sets the ped type's hostility to other ped types and will attack the threat ped type on sight. The threat ped type cannot overwrite hardcoded threats but it can overwrite most threats set in the ped.dat file. The threat ped type value is represented as a flag field. The effect of this opcode can be reset using 03F2. Peds that are already spawned cannot have their hostility changed actively using this opcode; this opcode only works on newly spawned peds.
Ped threats
Flag | Binary | Enum | |
---|---|---|---|
1 | 00 0000 0000 0000 0000 0000 0001
|
THREAT_PLAYER1 | |
2 | 00 0000 0000 0000 0000 0000 0010
|
THREAT_PLAYER2 | |
4 | 00 0000 0000 0000 0000 0000 0100
|
THREAT_PLAYER3 | |
8 | 00 0000 0000 0000 0000 0000 1000
|
THREAT_PLAYER4 | |
16 | 00 0000 0000 0000 0000 0001 0000
|
THREAT_CIVMALE | |
32 | 00 0000 0000 0000 0000 0010 0000
|
THREAT_CIVFEMALE | |
64 | 00 0000 0000 0000 0000 0100 0000
|
THREAT_COP | |
128 | 00 0000 0000 0000 0000 1000 0000
|
THREAT_GANG_MAFIA | THREAT_GANG_CUBAN |
256 | 00 0000 0000 0000 0001 0000 0000
|
THREAT_GANG_TRIAD | THREAT_GANG_HAITIAN |
512 | 00 0000 0000 0000 0010 0000 0000
|
THREAT_GANG_DIABLO | THREAT_GANG_STREET |
1024 | 00 0000 0000 0000 0100 0000 0000
|
THREAT_GANG_YAKUZA | THREAT_GANG_DIAZ |
2048 | 00 0000 0000 0000 1000 0000 0000
|
THREAT_GANG_YARDIE | THREAT_GANG_SECURITY |
4096 | 00 0000 0000 0001 0000 0000 0000
|
THREAT_GANG_COLOMBIAN | THREAT_GANG_BIKER |
8192 | 00 0000 0000 0010 0000 0000 0000
|
THREAT_GANG_HOOD | THREAT_GANG_PLAYER |
16384 | 00 0000 0000 0100 0000 0000 0000
|
THREAT_GANG_GOLFER | |
32768 | 00 0000 0000 1000 0000 0000 0000
|
THREAT_GANG9 | |
65536 | 00 0000 0001 0000 0000 0000 0000
|
THREAT_EMERGENCY | |
131072 | 00 0000 0010 0000 0000 0000 0000
|
THREAT_PROSTITUTE | |
262144 | 00 0000 0100 0000 0000 0000 0000
|
THREAT_CRIMINAL | |
524288 | 00 0000 1000 0000 0000 0000 0000
|
THREAT_SPECIAL | |
1048576 | 00 0001 0000 0000 0000 0000 0000
|
THREAT_GUN | |
2097152 | 00 0010 0000 0000 0000 0000 0000
|
THREAT_COP_CAR | |
4194304 | 00 0100 0000 0000 0000 0000 0000
|
THREAT_FAST_CAR | |
8388608 | 00 1000 0000 0000 0000 0000 0000
|
THREAT_EXPLOSION | |
16777216 | 01 0000 0000 0000 0000 0000 0000
|
THREAT_FIREMAN | |
33554432 | 10 0000 0000 0000 0000 0000 0000
|
THREAT_DEADPEDS |
Example
The following example lets you toggle Triads/Haitians hate towards the player by pressing the CAMERA key. A number is displayed on the screen to show the gang's hostility; 0 means it is not hostile and 1 means it is. This opcode only affects newly spawned gang members; gang members already spawned will not be affected.
// set constant
const
HATE = 0@
end
// reset gang hate to player
03F2: pedgroup 8 remove_threat 1
HATE = false
// toggle gang hate to player
while true
wait 250
if
00E1: key_pressed 0 13 // camera key
then
if
HATE == false
then
03F1: pedtype 8 add_threat 1 // set gang hostile
HATE = true
else
03F2: pedgroup 8 remove_threat 1 // set gang not hostile
HATE = false
end
end
// display gang hate as a number onscreen
01E5: text_1number_highpriority 'NUMBER' HATE 250 ms 1
end
Keywords
set, add, threat, aggressive, hate, hostile, pedtype, gang