-
Notifications
You must be signed in to change notification settings - Fork 2.2k
/
Copy pathPed.cs
1603 lines (1513 loc) · 32.9 KB
/
Ped.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
using System;
using CitizenFX.Core.Native;
using CitizenFX.Core.NaturalMotion;
using System.Security;
namespace CitizenFX.Core
{
public enum Gender
{
Male,
Female
}
public enum DrivingStyle
{
None = 0,
Normal = 786603,
IgnoreLights = 2883621,
SometimesOvertakeTraffic = 5,
Rushed = 1074528293,
AvoidTraffic = 786468,
AvoidTrafficExtremely = 6,
AvoidHighwaysWhenPossible = 536870912,
IgnorePathing = 16777216,
IgnoreRoads = 4194304,
ShortestPath = 262144,
Backwards = 1024
}
[Flags]
public enum VehicleDrivingFlags : uint
{
None = 0,
FollowTraffic = 1,
YieldToPeds = 2,
AvoidVehicles = 4,
AvoidEmptyVehicles = 8,
AvoidPeds = 16,
AvoidObjects = 32,
StopAtTrafficLights = 128,
UseBlinkers = 256,
AllowGoingWrongWay = 512,
Reverse = 1024,
AllowMedianCrossing = 262144,
DriveBySight = 4194304,
IgnorePathFinding = 16777216,
TryToAvoidHighways = 536870912,
StopAtDestination = 2147483648
}
public enum HelmetType : uint
{
RegularMotorcycleHelmet = 4096u,
FiremanHelmet = 16384u,
PilotHeadset = 32768u
}
public enum ParachuteLandingType
{
None = -1,
Stumbling = 1,
Rolling,
Ragdoll
}
public enum ParachuteState
{
None = -1,
FreeFalling,
Deploying,
Gliding,
LandingOrFallingToDoom
}
public enum RagdollType
{
Normal = 0,
StiffLegs = 1,
NarrowLegs = 2,
WideLegs = 3,
}
public enum SpeechModifier
{
Standard = 0,
AllowRepeat = 1,
Beat = 2,
Force = 3,
ForceFrontend = 4,
ForceNoRepeatFrontend = 5,
ForceNormal = 6,
ForceNormalClear = 7,
ForceNormalCritical = 8,
ForceShouted = 9,
ForceShoutedClear = 10,
ForceShoutedCritical = 11,
ForcePreloadOnly = 12,
Megaphone = 13,
Helicopter = 14,
ForceMegaphone = 15,
ForceHelicopter = 16,
Interrupt = 17,
InterruptShouted = 18,
InterruptShoutedClear = 19,
InterruptShoutedCritical = 20,
InterruptNoForce = 21,
InterruptFrontend = 22,
InterruptNoForceFrontend = 23,
AddBlip = 24,
AddBlipAllowRepeat = 25,
AddBlipForce = 26,
AddBlipShouted = 27,
AddBlipShoutedForce = 28,
AddBlipInterrupt = 29,
AddBlipInterruptForce = 30,
ForcePreloadOnlyShouted = 31,
ForcePreloadOnlyShoutedClear = 32,
ForcePreloadOnlyShoutedCritical = 33,
Shouted = 34,
ShoutedClear = 35,
ShoutedCritical = 36
}
public sealed class Ped : Entity
{
#region Fields
Tasks _tasks;
Euphoria _euphoria;
WeaponCollection _weapons;
Style _style;
PedBoneCollection _pedBones;
internal static readonly string[] _speechModifierNames = {
"SPEECH_PARAMS_STANDARD",
"SPEECH_PARAMS_ALLOW_REPEAT",
"SPEECH_PARAMS_BEAT",
"SPEECH_PARAMS_FORCE",
"SPEECH_PARAMS_FORCE_FRONTEND",
"SPEECH_PARAMS_FORCE_NO_REPEAT_FRONTEND",
"SPEECH_PARAMS_FORCE_NORMAL",
"SPEECH_PARAMS_FORCE_NORMAL_CLEAR",
"SPEECH_PARAMS_FORCE_NORMAL_CRITICAL",
"SPEECH_PARAMS_FORCE_SHOUTED",
"SPEECH_PARAMS_FORCE_SHOUTED_CLEAR",
"SPEECH_PARAMS_FORCE_SHOUTED_CRITICAL",
"SPEECH_PARAMS_FORCE_PRELOAD_ONLY",
"SPEECH_PARAMS_MEGAPHONE",
"SPEECH_PARAMS_HELI",
"SPEECH_PARAMS_FORCE_MEGAPHONE",
"SPEECH_PARAMS_FORCE_HELI",
"SPEECH_PARAMS_INTERRUPT",
"SPEECH_PARAMS_INTERRUPT_SHOUTED",
"SPEECH_PARAMS_INTERRUPT_SHOUTED_CLEAR",
"SPEECH_PARAMS_INTERRUPT_SHOUTED_CRITICAL",
"SPEECH_PARAMS_INTERRUPT_NO_FORCE",
"SPEECH_PARAMS_INTERRUPT_FRONTEND",
"SPEECH_PARAMS_INTERRUPT_NO_FORCE_FRONTEND",
"SPEECH_PARAMS_ADD_BLIP",
"SPEECH_PARAMS_ADD_BLIP_ALLOW_REPEAT",
"SPEECH_PARAMS_ADD_BLIP_FORCE",
"SPEECH_PARAMS_ADD_BLIP_SHOUTED",
"SPEECH_PARAMS_ADD_BLIP_SHOUTED_FORCE",
"SPEECH_PARAMS_ADD_BLIP_INTERRUPT",
"SPEECH_PARAMS_ADD_BLIP_INTERRUPT_FORCE",
"SPEECH_PARAMS_FORCE_PRELOAD_ONLY_SHOUTED",
"SPEECH_PARAMS_FORCE_PRELOAD_ONLY_SHOUTED_CLEAR",
"SPEECH_PARAMS_FORCE_PRELOAD_ONLY_SHOUTED_CRITICAL",
"SPEECH_PARAMS_SHOUTED",
"SPEECH_PARAMS_SHOUTED_CLEAR",
"SPEECH_PARAMS_SHOUTED_CRITICAL",
};
#endregion
public Ped(int handle) : base(handle)
{
}
/// <summary>
/// Get the headblend data from this <see cref="Ped"/>.
/// </summary>
/// <returns>A <see cref="PedHeadBlendData"/> struct containing all headblend data from a mp ped.</returns>
public PedHeadBlendData GetHeadBlendData()
{
return _GetHeadBlendData();
}
/// <summary>
/// Gets the unsafe headblend struct and converts it into a safe struct and returns that struct.
/// </summary>
/// <returns>A <see cref="PedHeadBlendData"/> struct.</returns>
[SecuritySafeCritical]
private PedHeadBlendData _GetHeadBlendData()
{
UnsafePedHeadBlendData data;
unsafe
{
Function.Call(Hash._GET_PED_HEAD_BLEND_DATA, API.PlayerPedId(), &data);
}
return data.GetData();
}
/// <summary>
/// Gets or sets how much money this <see cref="Ped"/> is carrying.
/// </summary>
public int Money
{
get
{
return API.GetPedMoney(Handle);
}
set
{
API.SetPedMoney(Handle, value);
}
}
/// <summary>
/// Gets the gender of this <see cref="Ped"/>. Note this does not seem to work correctly for all peds.
/// </summary>
public Gender Gender
{
get
{
return API.IsPedMale(Handle) ? Gender.Male : Gender.Female;
}
}
/// <summary>
/// Gets or sets how much Armor this <see cref="Ped"/> is wearing.
/// </summary>
/// <remarks>if you need to get or set the value strictly, use <see cref="ArmorFloat"/> instead.</remarks>
public int Armor
{
get
{
return API.GetPedArmour(Handle);
}
set
{
API.SetPedArmour(Handle, value);
}
}
/// <summary>
/// Gets or sets how much Armor this <see cref="Ped"/> is wearing in float.
/// </summary>
public float ArmorFloat
{
get
{
if (MemoryAddress == IntPtr.Zero)
{
return 0.0f;
}
int offset = Game.Version >= GameVersion.v1_0_372_2_Steam ? 0x1474 : 0x1464;
return MemoryAccess.ReadFloat(MemoryAddress + offset);
}
set
{
if (MemoryAddress == IntPtr.Zero)
{
return;
}
int offset = Game.Version >= GameVersion.v1_0_372_2_Steam ? 0x1474 : 0x1464;
MemoryAccess.WriteFloat(MemoryAddress + offset, value);
}
}
/// <summary>
/// Gets or sets how accurate this <see cref="Ped"/>s shooting ability is.
/// </summary>
/// <value>
/// The accuracy from 0 to 100, 0 being very innacurate, 100 being perfectly accurate.
/// </value>
public int Accuracy
{
get
{
return API.GetPedAccuracy(Handle);
}
set
{
API.SetPedAccuracy(Handle, value);
}
}
/// <summary>
/// Opens a list of <see cref="Tasks"/> that this <see cref="Ped"/> can carry out.
/// </summary>
public Tasks Task
{
get
{
if (ReferenceEquals(_tasks, null))
{
_tasks = new Tasks(this);
}
return _tasks;
}
}
/// <summary>
/// Gets the stage of the <see cref="TaskSequence"/> this <see cref="Ped"/> is currently executing.
/// </summary>
public int TaskSequenceProgress
{
get
{
return API.GetSequenceProgress(Handle);
}
}
/// <summary>
/// Opens a list of <see cref="NaturalMotion.Euphoria"/> Helpers which can be applied to this <see cref="Ped"/>.
/// </summary>
public Euphoria Euphoria
{
get
{
if (ReferenceEquals(_euphoria, null))
{
_euphoria = new Euphoria(this);
}
return _euphoria;
}
}
/// <summary>
/// Gets a collection of all this <see cref="Ped"/>s <see cref="Weapon"/>s.
/// </summary>
public WeaponCollection Weapons
{
get
{
if (ReferenceEquals(_weapons, null))
{
_weapons = new WeaponCollection(this);
}
return _weapons;
}
}
/// <summary>
/// Opens a list of clothing and prop configurations that this <see cref="Ped"/> can wear.
/// </summary>
public Style Style
{
get
{
if (ReferenceEquals(_style, null))
{
_style = new Style(this);
}
return _style;
}
}
/// <summary>
/// Gets the vehicle weapon this <see cref="Ped"/> is using.
/// <remarks>The vehicle weapon, returns <see cref="VehicleWeaponHash.Invalid"/> if this <see cref="Ped"/> isnt using a vehicle weapon.</remarks>
/// </summary>
public VehicleWeaponHash VehicleWeapon
{
get
{
uint hash = 0u;
if (API.GetCurrentPedVehicleWeapon(Handle, ref hash))
{
return (VehicleWeaponHash)hash;
}
return VehicleWeaponHash.Invalid;
}
}
/// <summary>
/// Gets the last <see cref="Vehicle"/> this <see cref="Ped"/> used.
/// </summary>
/// <remarks>returns <c>null</c> if the last vehicle doesn't exist.</remarks>
public Vehicle LastVehicle
{
get
{
Vehicle veh = new Vehicle(API.GetVehiclePedIsIn(Handle, true));
return veh.Exists() ? veh : null;
}
}
/// <summary>
/// Gets the current <see cref="Vehicle"/> this <see cref="Ped"/> is using.
/// </summary>
/// <remarks>returns <c>null</c> if this <see cref="Ped"/> isn't in a <see cref="Vehicle"/>.</remarks>
public Vehicle CurrentVehicle
{
get
{
Vehicle veh = new Vehicle(API.GetVehiclePedIsIn(Handle, false));
return veh.Exists() ? veh : null;
}
}
/// <summary>
/// Gets the <see cref="Vehicle"/> this <see cref="Ped"/> is trying to enter.
/// </summary>
/// <remarks>returns <c>null</c> if this <see cref="Ped"/> isn't trying to enter a <see cref="Vehicle"/>.</remarks>
public Vehicle VehicleTryingToEnter
{
get
{
Vehicle veh = new Vehicle(API.GetVehiclePedIsTryingToEnter(Handle));
return veh.Exists() ? veh : null;
}
}
/// <summary>
/// Gets the PedGroup this <see cref="Ped"/> is in.
/// </summary>
public PedGroup PedGroup
{
get
{
if (!IsInGroup)
{
return null;
}
return new PedGroup(API.GetPedGroupIndex(Handle));
}
}
/// <summary>
/// Gets or sets the how much sweat should be rendered on this <see cref="Ped"/>.
/// </summary>
/// <value>
/// The sweat from 0 to 100, 0 being no sweat, 100 being saturated.
/// </value>
public float Sweat
{
[SecuritySafeCritical]
get
{
if (MemoryAddress == IntPtr.Zero)
{
return 0;
}
return MemoryAccess.ReadInt(MemoryAddress + 4464);
}
set
{
if (value < 0)
{
value = 0;
}
if (value > 100)
{
value = 100;
}
API.SetPedSweat(Handle, value);
}
}
/// <summary>
/// Sets how high up on this <see cref="Ped"/>s body water should be visible.
/// </summary>
/// <value>
/// The height ranges from 0.0f to 1.99f, 0.0f being no water visible, 1.99f being covered in water.
/// </value>
public float WetnessHeight
{
set
{
if (value == 0.0f)
{
API.ClearPedWetness(Handle);
}
else
{
API.SetPedWetnessHeight(Handle, value);
}
}
}
/// <summary>
/// Sets the voice to use when this <see cref="Ped"/> speaks.
/// </summary>
public string Voice
{
set
{
API.SetAmbientVoiceName(Handle, value);
}
}
/// <summary>
/// Sets the rate this <see cref="Ped"/> will shoot at.
/// </summary>
/// <value>
/// The shoot rate from 0.0f to 1000.0f, 100.0f is the default value.
/// </value>
public int ShootRate
{
set
{
API.SetPedShootRate(Handle, value);
}
}
/// <summary>
/// Gets a value indicating whether this <see cref="Ped"/> was killed by a stealth attack.
/// </summary>
/// <value>
/// <c>true</c> if this <see cref="Ped"/> was killed by stealth; otherwise, <c>false</c>.
/// </value>
public bool WasKilledByStealth
{
get
{
return API.WasPedKilledByStealth(Handle);
}
}
/// <summary>
/// Gets a value indicating whether this <see cref="Ped"/> was killed by a takedown.
/// </summary>
/// <value>
/// <c>true</c> if this <see cref="Ped"/> was killed by a takedown; otherwise, <c>false</c>.
/// </value>
public bool WasKilledByTakedown
{
get
{
return API.WasPedKilledByTakedown(Handle);
}
}
/// <summary>
/// Gets the <see cref="VehicleSeat"/> this <see cref="Ped"/> is in.
/// </summary>
/// <value>
/// The <see cref="VehicleSeat"/> this <see cref="Ped"/> is in if this <see cref="Ped"/> is in a <see cref="Vehicle"/>; otherwise, <see cref="VehicleSeat.None"/>.
/// </value>
public VehicleSeat SeatIndex
{
get
{
if (!IsInVehicle())
{
return VehicleSeat.None;
}
for (int seatIndex = -1; seatIndex < API.GetVehicleModelNumberOfSeats((uint)CurrentVehicle.Model.Hash); seatIndex++)
{
if (CurrentVehicle.GetPedOnSeat((VehicleSeat)seatIndex).Handle == Handle)
{
return (VehicleSeat)seatIndex;
}
}
return VehicleSeat.None;
}
}
/// <summary>
/// Gets a value indicating whether this <see cref="Ped"/> is jumping out of their vehicle.
/// </summary>
/// <value>
/// <c>true</c> if this <see cref="Ped"/> is jumping out of their vehicle; otherwise, <c>false</c>.
/// </value>
public bool IsJumpingOutOfVehicle
{
get
{
return API.IsPedJumpingOutOfVehicle(Handle);
}
}
/// <summary>
/// Sets a value indicating whether this <see cref="Ped"/> will stay in the vehicle when the driver gets jacked.
/// </summary>
/// <value>
/// <c>true</c> if <see cref="Ped"/> stays in vehicle when jacked; otherwise, <c>false</c>.
/// </value>
public bool StaysInVehicleWhenJacked
{
set
{
API.SetPedStayInVehicleWhenJacked(Handle, value);
}
}
/// <summary>
/// Sets the maximum driving speed this <see cref="Ped"/> can drive at.
/// </summary>
public float MaxDrivingSpeed
{
set
{
API.SetDriveTaskMaxCruiseSpeed(Handle, value);
}
}
/// <summary>
/// Gets or sets the injury health threshold for this <see cref="Ped"/>.
/// The ped is considered injured when its health drops below this value.
/// </summary>
/// <value>
/// The injury health threshold. Should be below <see cref="Entity.MaxHealth"/>.
/// </value>
public float InjuryHealthThreshold
{
get
{
if (MemoryAddress == IntPtr.Zero)
{
return 0.0f;
}
int offset = Game.Version >= GameVersion.v1_0_372_2_Steam ? 0x1480 : 0x1470;
return MemoryAccess.ReadFloat(MemoryAddress + offset);
}
set
{
if (MemoryAddress == IntPtr.Zero)
{
return;
}
int offset = Game.Version >= GameVersion.v1_0_372_2_Steam ? 0x1480 : 0x1470;
MemoryAccess.WriteFloat(MemoryAddress + offset, value);
}
}
/// <summary>
/// Gets or sets the fatal injury health threshold for this <see cref="Ped"/>.
/// The ped is considered dead when its health drops below this value.
/// </summary>
/// <value>
/// The fatal injury health threshold. Should be below <see cref="Entity.MaxHealth"/>.
/// </value>
/// <remarks>
/// Note on player controlled peds: One of the game scripts will kill the player when their health drops below 100, regardless of this setting.
/// </remarks>
public float FatalInjuryHealthThreshold
{
get
{
if (MemoryAddress == IntPtr.Zero)
{
return 0.0f;
}
int offset = Game.Version >= GameVersion.v1_0_372_2_Steam ? 0x1484 : 0x1474;
return MemoryAccess.ReadFloat(MemoryAddress + 5248);
}
set
{
if (MemoryAddress == IntPtr.Zero)
{
return;
}
int offset = Game.Version >= GameVersion.v1_0_372_2_Steam ? 0x1484 : 0x1474;
MemoryAccess.WriteFloat(MemoryAddress + offset, value);
}
}
/// <summary>
/// Gets a value indicating whether this <see cref="Ped"/> is human.
/// </summary>
/// <value>
/// <c>true</c> if this <see cref="Ped"/> is human; otherwise, <c>false</c>.
/// </value>
public bool IsHuman
{
get
{
return API.IsPedHuman(Handle);
}
}
public bool IsEnemy
{
set
{
API.SetPedAsEnemy(Handle, value);
}
}
public bool IsPriorityTargetForEnemies
{
set
{
API.SetEntityIsTargetPriority(Handle, value, 0);
}
}
public bool IsPlayer
{
get
{
return API.IsPedAPlayer(Handle);
}
}
public bool IsCuffed
{
get
{
return API.IsPedCuffed(Handle);
}
}
public bool IsWearingHelmet
{
get
{
return API.IsPedWearingHelmet(Handle);
}
}
public bool IsRagdoll
{
get
{
return API.IsPedRagdoll(Handle);
}
}
public bool IsIdle
{
get
{
return !IsInjured && !IsRagdoll && !IsInAir && !IsOnFire && !IsDucking && !IsGettingIntoAVehicle && !IsInCombat && !IsInMeleeCombat && (!IsInVehicle() || IsSittingInVehicle());
}
}
public bool IsProne
{
get
{
return API.IsPedProne(Handle);
}
}
public bool IsDucking
{
get
{
return API.IsPedDucking(Handle);
}
set
{
API.SetPedDucking(Handle, value);
}
}
public bool IsGettingUp
{
get
{
return API.IsPedGettingUp(Handle);
}
}
public bool IsClimbing
{
get
{
return API.IsPedClimbing(Handle);
}
}
public bool IsJumping
{
get
{
return API.IsPedJumping(Handle);
}
}
public bool IsFalling
{
get
{
return API.IsPedFalling(Handle);
}
}
public bool IsStopped
{
get
{
return API.IsPedStopped(Handle);
}
}
public bool IsWalking
{
get
{
return API.IsPedWalking(Handle);
}
}
public bool IsRunning
{
get
{
return API.IsPedRunning(Handle);
}
}
public bool IsSprinting
{
get
{
return API.IsPedSprinting(Handle);
}
}
public bool IsDiving
{
get
{
return API.IsPedDiving(Handle);
}
}
public bool IsInParachuteFreeFall
{
get
{
return API.IsPedInParachuteFreeFall(Handle);
}
}
public bool IsSwimming
{
get
{
return API.IsPedSwimming(Handle);
}
}
public bool IsSwimmingUnderWater
{
get
{
return API.IsPedSwimmingUnderWater(Handle);
}
}
public bool IsVaulting
{
get
{
return API.IsPedVaulting(Handle);
}
}
public bool IsOnBike
{
get
{
return API.IsPedOnAnyBike(Handle);
}
}
public bool IsOnFoot
{
get
{
return API.IsPedOnFoot(Handle);
}
}
public bool IsInSub
{
get
{
return API.IsPedInAnySub(Handle);
}
}
public bool IsInTaxi
{
get
{
return API.IsPedInAnyTaxi(Handle);
}
}
public bool IsInTrain
{
get
{
return API.IsPedInAnyTrain(Handle);
}
}
public bool IsInHeli
{
get
{
return API.IsPedInAnyHeli(Handle);
}
}
public bool IsInPlane
{
get
{
return API.IsPedInAnyPlane(Handle);
}
}
public bool IsInFlyingVehicle
{
get
{
return API.IsPedInFlyingVehicle(Handle);
}
}
public bool IsInBoat
{
get
{
return API.IsPedInAnyBoat(Handle);
}
}
public bool IsInPoliceVehicle
{
get
{
return API.IsPedInAnyPoliceVehicle(Handle);
}
}
public bool IsJacking
{
get
{
return API.IsPedJacking(Handle);
}
}
public bool IsBeingJacked
{
get
{
return API.IsPedBeingJacked(Handle);
}
}
public bool IsGettingIntoAVehicle
{
get
{
return API.IsPedGettingIntoAVehicle(Handle);
}
}
public bool IsTryingToEnterALockedVehicle
{
get
{
return API.IsPedTryingToEnterALockedVehicle(Handle);
}
}
public bool IsInjured
{
get
{
return API.IsPedInjured(Handle);
}
}
public bool IsFleeing
{
get
{
return API.IsPedFleeing(Handle);
}
}
public bool IsInCombat
{
get
{
return API.IsPedInCombat(Handle, API.PlayerPedId()); // native descriptiong is pretty vague, might need testing.
}
}
public bool IsInMeleeCombat
{
get
{
return API.IsPedInMeleeCombat(Handle);
}
}
public bool IsInStealthMode
{
get
{
return API.GetPedStealthMovement(Handle);
}
}
public bool IsAmbientSpeechplaying
{
get
{
return API.IsAmbientSpeechPlaying(Handle);
}
}
public bool IsScriptedSpeechplaying
{
get
{
return API.IsScriptedSpeechPlaying(Handle);
}
}
public bool IsAnySpeechplaying
{
get
{
return API.IsAnySpeechPlaying(Handle);
}
}
public bool IsAmbientSpeechEnabled
{
get
{
return !API.IsAmbientSpeechDisabled(Handle);
}
}
public bool IsPainAudioEnabled
{
set
{
API.DisablePedPainAudio(Handle, !value);