forked from sampgo/sampgo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnatives.go
2871 lines (2396 loc) · 125 KB
/
natives.go
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
package sampgo
/*
#cgo windows CFLAGS: -I./lib -I./lib/amx -Wno-attributes -Wno-implicit-function-declaration
#cgo windows CFLAGS: -DHAVE_INTTYPES_H -DHAVE_MALLOC_H -DHAVE_STDINT_H -DWIN32
#cgo windows LDFLAGS: -Wl,--subsystem,windows,--kill-at
#cgo linux CFLAGS: -I./lib -I./lib/amx -Wno-attributes -Wno-implicit-function-declaration
#cgo linux CFLAGS: -DHAVE_INTTYPES_H -DHAVE_MALLOC_H -DHAVE_STDINT_H -DLINUX -D_GNU_SOURCE
#cgo linux LDFLAGS: -ldl
#ifndef GOLANG_APP
#define GOLANG_APP
#include "unitybuild.c"
#include "main.h"
#endif
*/
import "C"
import "unsafe"
// For documentation, please visit https://open.mp/docs/scripting/functions/CreateActor
func CreateActor(modelid int, x, y, z, rotation float32) int {
return int(C.CreateActor(C.int(modelid), C.float(x), C.float(y), C.float(z), C.float(rotation)))
}
// For documentation, please visit https://open.mp/docs/scripting/functions/DestroyActor
func DestroyActor(actorid int) bool {
return bool(C.DestroyActor(C.int(actorid)))
}
// For documentation, please visit https://open.mp/docs/scripting/functions/IsActorStreamedIn
func IsActorStreamedIn(actorid, forplayerid int) bool {
return bool(C.IsActorStreamedIn(C.int(actorid), C.int(forplayerid)))
}
// For documentation, please visit https://open.mp/docs/scripting/functions/SetActorVirtualWorld
func SetActorVirtualWorld(actorid, vworld int) bool {
return bool(C.SetActorVirtualWorld(C.int(actorid), C.int(vworld)))
}
// For documentation, please visit https://open.mp/docs/scripting/functions/GetActorVirtualWorld
func GetActorVirtualWorld(actorid int) int {
return int(C.GetActorVirtualWorld(C.int(actorid)))
}
// For documentation, please visit https://open.mp/docs/scripting/functions/ApplyActorAnimation
func ApplyActorAnimation(actorid int, animlib, animname string, fDelta float32, loop, lockx, locky, freeze bool, time int) bool {
csanimlib := C.CString(animlib)
defer C.free(unsafe.Pointer(csanimlib))
csanimname := C.CString(animname)
defer C.free(unsafe.Pointer(csanimname))
return bool(C.ApplyActorAnimation(C.int(actorid), C.nonConstToConst(csanimlib), C.nonConstToConst(csanimname), C.float(fDelta), C.bool(loop), C.bool(lockx), C.bool(locky), C.bool(freeze), C.int(time)))
}
// For documentation, please visit https://open.mp/docs/scripting/functions/ClearActorAnimations
func ClearActorAnimations(actorid int) bool {
return bool(C.ClearActorAnimations(C.int(actorid)))
}
// For documentation, please visit https://open.mp/docs/scripting/functions/SetActorPos
func SetActorPos(actorid int, x, y, z float32) bool {
return bool(C.SetActorPos(C.int(actorid), C.float(x), C.float(y), C.float(z)))
}
// For documentation, please visit https://open.mp/docs/scripting/functions/GetActorPos
func GetActorPos(actorid int, x, y, z *float32) bool {
var ret bool
var cx C.float
var cy C.float
var cz C.float
ret = bool(C.GetActorPos(C.int(actorid), &cx, &cy, &cz))
*x = float32(cx)
*y = float32(cy)
*z = float32(cz)
return ret
}
// For documentation, please visit https://open.mp/docs/scripting/functions/SetActorFacingAngle
func SetActorFacingAngle(actorid int, angle float32) bool {
return bool(C.SetActorFacingAngle(C.int(actorid), C.float(angle)))
}
// For documentation, please visit https://open.mp/docs/scripting/functions/GetActorFacingAngle
func GetActorFacingAngle(actorid int, angle *float32) bool {
var ret bool
var cangle C.float
ret = bool(C.GetActorFacingAngle(C.int(actorid), &cangle))
*angle = float32(cangle)
return ret
}
// For documentation, please visit https://open.mp/docs/scripting/functions/SetActorHealth
func SetActorHealth(actorid int, health float32) bool {
return bool(C.SetActorHealth(C.int(actorid), C.float(health)))
}
// For documentation, please visit https://open.mp/docs/scripting/functions/GetActorHealth
func GetActorHealth(actorid int, health *float32) bool {
var ret bool
var chealth C.float
ret = bool(C.GetActorHealth(C.int(actorid), &chealth))
*health = float32(chealth)
return ret
}
// For documentation, please visit https://open.mp/docs/scripting/functions/SetActorInvulnerable
func SetActorInvulnerable(actorid int, invulnerable bool) bool {
return bool(C.SetActorInvulnerable(C.int(actorid), C.bool(invulnerable)))
}
// For documentation, please visit https://open.mp/docs/scripting/functions/IsActorInvulnerable
func IsActorInvulnerable(actorid int) bool {
return bool(C.IsActorInvulnerable(C.int(actorid)))
}
// For documentation, please visit https://open.mp/docs/scripting/functions/IsValidActor
func IsValidActor(actorid int) bool {
return bool(C.IsValidActor(C.int(actorid)))
}
// For documentation, please visit https://open.mp/docs/scripting/functions/SetSpawnInfo
func SetSpawnInfo(playerid, team, skin int, x, y, z, rotation float32, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo int) bool {
return bool(C.SetSpawnInfo(C.int(playerid), C.int(team), C.int(skin), C.float(x), C.float(y), C.float(z), C.float(rotation), C.int(weapon1), C.int(weapon1_ammo), C.int(weapon2), C.int(weapon2_ammo), C.int(weapon3), C.int(weapon3_ammo)))
}
// For documentation, please visit https://open.mp/docs/scripting/functions/SpawnPlayer
func SpawnPlayer(playerid int) bool {
return bool(C.SpawnPlayer(C.int(playerid)))
}
// For documentation, please visit https://open.mp/docs/scripting/functions/SetPlayerPos
func SetPlayerPos(playerid int, x, y, z float32) bool {
return bool(C.SetPlayerPos(C.int(playerid), C.float(x), C.float(y), C.float(z)))
}
// For documentation, please visit https://open.mp/docs/scripting/functions/SetPlayerPosFindZ
func SetPlayerPosFindZ(playerid int, x, y, z float32) bool {
return bool(C.SetPlayerPosFindZ(C.int(playerid), C.float(x), C.float(y), C.float(z)))
}
// For documentation, please visit https://open.mp/docs/scripting/functions/GetPlayerPos
func GetPlayerPos(playerid int, x, y, z *float32) bool {
var ret bool
var cx C.float
var cy C.float
var cz C.float
ret = bool(C.GetPlayerPos(C.int(playerid), &cx, &cy, &cz))
*x = float32(cx)
*y = float32(cy)
*z = float32(cz)
return ret
}
// For documentation, please visit https://open.mp/docs/scripting/functions/SetPlayerFacingAngle
func SetPlayerFacingAngle(playerid int, angle float32) bool {
return bool(C.SetPlayerFacingAngle(C.int(playerid), C.float(angle)))
}
// For documentation, please visit https://open.mp/docs/scripting/functions/GetPlayerFacingAngle
func GetPlayerFacingAngle(playerid int, angle *float32) bool {
var ret bool
var cangle C.float
ret = bool(C.GetPlayerFacingAngle(C.int(playerid), &cangle))
*angle = float32(cangle)
return ret
}
// For documentation, please visit https://open.mp/docs/scripting/functions/IsPlayerInRangeOfPoint
func IsPlayerInRangeOfPoint(playerid int, range_, x, y, z float32) bool {
return bool(C.IsPlayerInRangeOfPoint(C.int(playerid), C.float(range_), C.float(x), C.float(y), C.float(z)))
}
// For documentation, please visit https://open.mp/docs/scripting/functions/GetPlayerDistanceFromPoint
func GetPlayerDistanceFromPoint(playerid int, x, y, z float32) float32 {
return float32(C.GetPlayerDistanceFromPoint(C.int(playerid), C.float(x), C.float(y), C.float(z)))
}
// For documentation, please visit https://open.mp/docs/scripting/functions/IsPlayerStreamedIn
func IsPlayerStreamedIn(playerid int, forplayerid int) bool {
return bool(C.IsPlayerStreamedIn(C.int(playerid), C.int(forplayerid)))
}
// For documentation, please visit https://open.mp/docs/scripting/functions/SetPlayerInterior
func SetPlayerInterior(playerid int, interiorid int) bool {
return bool(C.SetPlayerInterior(C.int(playerid), C.int(interiorid)))
}
// For documentation, please visit https://open.mp/docs/scripting/functions/GetPlayerInterior
func GetPlayerInterior(playerid int) int {
return int(C.GetPlayerInterior(C.int(playerid)))
}
// For documentation, please visit https://open.mp/docs/scripting/functions/SetPlayerHealth
func SetPlayerHealth(playerid int, health float32) bool {
return bool(C.SetPlayerHealth(C.int(playerid), C.float(health)))
}
// For documentation, please visit https://open.mp/docs/scripting/functions/GetPlayerHealth
func GetPlayerHealth(playerid int, health *float32) bool {
var ret bool
var chealth C.float
ret = bool(C.GetPlayerHealth(C.int(playerid), &chealth))
*health = float32(chealth)
return ret
}
// For documentation, please visit https://open.mp/docs/scripting/functions/SetPlayerArmour
func SetPlayerArmour(playerid int, armour float32) bool {
return bool(C.SetPlayerArmour(C.int(playerid), C.float(armour)))
}
// For documentation, please visit https://open.mp/docs/scripting/functions/GetPlayerArmour
func GetPlayerArmour(playerid int, armour *float32) bool {
var ret bool
var carmour C.float
ret = bool(C.GetPlayerArmour(C.int(playerid), &carmour))
*armour = float32(carmour)
return ret
}
// For documentation, please visit https://open.mp/docs/scripting/functions/SetPlayerAmmo
func SetPlayerAmmo(playerid, weaponid, ammo int) bool {
return bool(C.SetPlayerAmmo(C.int(playerid), C.int(weaponid), C.int(ammo)))
}
// For documentation, please visit https://open.mp/docs/scripting/functions/GetPlayerAmmo
func GetPlayerAmmo(playerid int) int {
return int(C.GetPlayerAmmo(C.int(playerid)))
}
// For documentation, please visit https://open.mp/docs/scripting/functions/GetPlayerWeaponState
func GetPlayerWeaponState(playerid int) int {
return int(C.GetPlayerWeaponState(C.int(playerid)))
}
// For documentation, please visit https://open.mp/docs/scripting/functions/GetPlayerTargetPlayer
func GetPlayerTargetPlayer(playerid int) int {
return int(C.GetPlayerTargetPlayer(C.int(playerid)))
}
// For documentation, please visit https://open.mp/docs/scripting/functions/GetPlayerTargetActor
func GetPlayerTargetActor(playerid int) int {
return int(C.GetPlayerTargetActor(C.int(playerid)))
}
// For documentation, please visit https://open.mp/docs/scripting/functions/SetPlayerTeam
func SetPlayerTeam(playerid, teamid int) bool {
return bool(C.SetPlayerTeam(C.int(playerid), C.int(teamid)))
}
// For documentation, please visit https://open.mp/docs/scripting/functions/GetPlayerTeam
func GetPlayerTeam(playerid int) int {
return int(C.GetPlayerTeam(C.int(playerid)))
}
// For documentation, please visit https://open.mp/docs/scripting/functions/SetPlayerScore
func SetPlayerScore(playerid, score int) bool {
return bool(C.SetPlayerScore(C.int(playerid), C.int(score)))
}
// For documentation, please visit https://open.mp/docs/scripting/functions/GetPlayerScore
func GetPlayerScore(playerid int) int {
return int(C.GetPlayerScore(C.int(playerid)))
}
// For documentation, please visit https://open.mp/docs/scripting/functions/GetPlayerDrunkLevel
func GetPlayerDrunkLevel(playerid int) int {
return int(C.GetPlayerDrunkLevel(C.int(playerid)))
}
// For documentation, please visit https://open.mp/docs/scripting/functions/SetPlayerDrunkLevel
func SetPlayerDrunkLevel(playerid, level int) bool {
return bool(C.SetPlayerDrunkLevel(C.int(playerid), C.int(level)))
}
// For documentation, please visit https://open.mp/docs/scripting/functions/SetPlayerColor
func SetPlayerColor(playerid, color int) bool {
return bool(C.SetPlayerColor(C.int(playerid), C.int(color)))
}
// For documentation, please visit https://open.mp/docs/scripting/functions/GetPlayerColor
func GetPlayerColor(playerid int) int {
return int(C.GetPlayerColor(C.int(playerid)))
}
// For documentation, please visit https://open.mp/docs/scripting/functions/SetPlayerSkin
func SetPlayerSkin(playerid, skinid int) bool {
return bool(C.SetPlayerSkin(C.int(playerid), C.int(skinid)))
}
// For documentation, please visit https://open.mp/docs/scripting/functions/GetPlayerSkin
func GetPlayerSkin(playerid int) int {
return int(C.GetPlayerSkin(C.int(playerid)))
}
// For documentation, please visit https://open.mp/docs/scripting/functions/GivePlayerWeapon
func GivePlayerWeapon(playerid, weaponid, ammo int) bool {
return bool(C.GivePlayerWeapon(C.int(playerid), C.int(weaponid), C.int(ammo)))
}
// For documentation, please visit https://open.mp/docs/scripting/functions/ResetPlayerWeapons
func ResetPlayerWeapons(playerid int) bool {
return bool(C.ResetPlayerWeapons(C.int(playerid)))
}
// For documentation, please visit https://open.mp/docs/scripting/functions/SetPlayerArmedWeapon
func SetPlayerArmedWeapon(playerid, weaponid int) bool {
return bool(C.SetPlayerArmedWeapon(C.int(playerid), C.int(weaponid)))
}
// For documentation, please visit https://open.mp/docs/scripting/functions/GetPlayerWeaponData
func GetPlayerWeaponData(playerid, slot int, weapon, ammo *int) bool {
var ret bool
var cweapon C.int
var cammo C.int
ret = bool(C.GetPlayerWeaponData(C.int(playerid), C.int(slot), &cweapon, &cammo))
*weapon = int(cweapon)
*ammo = int(cammo)
return ret
}
// For documentation, please visit https://open.mp/docs/scripting/functions/GivePlayerMoney
func GivePlayerMoney(playerid int, money int) bool {
return bool(C.GivePlayerMoney(C.int(playerid), C.int(money)))
}
// For documentation, please visit https://open.mp/docs/scripting/functions/ResetPlayerMoney
func ResetPlayerMoney(playerid int) bool {
return bool(C.ResetPlayerMoney(C.int(playerid)))
}
// For documentation, please visit https://open.mp/docs/scripting/functions/SetPlayerName
func SetPlayerName(playerid int, name string) int {
csname := C.CString(name)
defer C.free(unsafe.Pointer(csname))
return int(C.SetPlayerName(C.int(playerid), C.nonConstToConst(csname)))
}
// For documentation, please visit https://open.mp/docs/scripting/functions/GetPlayerMoney
func GetPlayerMoney(playerid int) int {
return int(C.GetPlayerMoney(C.int(playerid)))
}
// For documentation, please visit https://open.mp/docs/scripting/functions/GetPlayerState
func GetPlayerState(playerid int) int {
return int(C.GetPlayerState(C.int(playerid)))
}
// For documentation, please visit https://open.mp/docs/scripting/functions/GetPlayerIp
func GetPlayerIp(playerid int, ip *string, size int) bool {
var ret bool
var cip *C.char
cip = (*C.char)(C.malloc(C.uint(size)))
defer C.free(unsafe.Pointer(cip))
ret = bool(C.GetPlayerIp(C.int(playerid), cip, C.int(size)))
*ip = C.GoString(C.constToNonConst(cip))
return ret
}
// For documentation, please visit https://open.mp/docs/scripting/functions/GetPlayerPing
func GetPlayerPing(playerid int) int {
return int(C.GetPlayerPing(C.int(playerid)))
}
// For documentation, please visit https://open.mp/docs/scripting/functions/GetPlayerWeapon
func GetPlayerWeapon(playerid int) int {
return int(C.GetPlayerWeapon(C.int(playerid)))
}
// For documentation, please visit https://open.mp/docs/scripting/functions/GetPlayerKeys
func GetPlayerKeys(playerid int, keys, updown, leftright *int) bool {
var ret bool
var ckeys C.int
var cupdown C.int
var cleftright C.int
ret = bool(C.GetPlayerKeys(C.int(playerid), &ckeys, &cupdown, &cleftright))
*keys = int(ckeys)
*updown = int(cupdown)
*leftright = int(cleftright)
return ret
}
// For documentation, please visit https://open.mp/docs/scripting/functions/GetPlayerName
func GetPlayerName(playerid int, name *string, size int) int {
var ret int
var cname *C.char
cname = (*C.char)(C.malloc(C.uint(size)))
defer C.free(unsafe.Pointer(cname))
ret = int(C.GetPlayerName(C.int(playerid), cname, C.int(size)))
*name = C.GoString(C.constToNonConst(cname))
return ret
}
// For documentation, please visit https://open.mp/docs/scripting/functions/SetPlayerTime
func SetPlayerTime(playerid, hour, minute int) bool {
return bool(C.SetPlayerTime(C.int(playerid), C.int(hour), C.int(minute)))
}
// For documentation, please visit https://open.mp/docs/scripting/functions/GetPlayerTime
func GetPlayerTime(playerid int, hour *int, minute *int) bool {
var ret bool
var chour C.int
var cminute C.int
ret = bool(C.GetPlayerTime(C.int(playerid), &chour, &cminute))
*hour = int(chour)
*minute = int(cminute)
return ret
}
// For documentation, please visit https://open.mp/docs/scripting/functions/TogglePlayerClock
func TogglePlayerClock(playerid int, toggle bool) bool {
return bool(C.TogglePlayerClock(C.int(playerid), C.bool(toggle)))
}
// For documentation, please visit https://open.mp/docs/scripting/functions/SetPlayerWeather
func SetPlayerWeather(playerid, weather int) bool {
return bool(C.SetPlayerWeather(C.int(playerid), C.int(weather)))
}
// For documentation, please visit https://open.mp/docs/scripting/functions/ForceClassSelection
func ForceClassSelection(playerid int) bool {
return bool(C.ForceClassSelection(C.int(playerid)))
}
// For documentation, please visit https://open.mp/docs/scripting/functions/SetPlayerWantedLevel
func SetPlayerWantedLevel(playerid, level int) bool {
return bool(C.SetPlayerWantedLevel(C.int(playerid), C.int(level)))
}
// For documentation, please visit https://open.mp/docs/scripting/functions/GetPlayerWantedLevel
func GetPlayerWantedLevel(playerid int) int {
return int(C.GetPlayerWantedLevel(C.int(playerid)))
}
// For documentation, please visit https://open.mp/docs/scripting/functions/SetPlayerFightingStyle
func SetPlayerFightingStyle(playerid, style int) bool {
return bool(C.SetPlayerFightingStyle(C.int(playerid), C.int(style)))
}
// For documentation, please visit https://open.mp/docs/scripting/functions/GetPlayerFightingStyle
func GetPlayerFightingStyle(playerid int) int {
return int(C.GetPlayerFightingStyle(C.int(playerid)))
}
// For documentation, please visit https://open.mp/docs/scripting/functions/SetPlayerVelocity
func SetPlayerVelocity(playerid int, x, y, z float32) bool {
return bool(C.SetPlayerVelocity(C.int(playerid), C.float(x), C.float(y), C.float(z)))
}
// For documentation, please visit https://open.mp/docs/scripting/functions/GetPlayerVelocity
func GetPlayerVelocity(playerid int, x, y, z *float32) bool {
var ret bool
var cx C.float
var cy C.float
var cz C.float
ret = bool(C.GetPlayerVelocity(C.int(playerid), &cx, &cy, &cz))
*x = float32(cx)
*y = float32(cy)
*z = float32(cz)
return ret
}
// For documentation, please visit https://open.mp/docs/scripting/functions/PlayCrimeReportForPlayer
func PlayCrimeReportForPlayer(playerid, suspectid, crime int) bool {
return bool(C.PlayCrimeReportForPlayer(C.int(playerid), C.int(suspectid), C.int(crime)))
}
// For documentation, please visit https://open.mp/docs/scripting/functions/PlayAudioStreamForPlayer
func PlayAudioStreamForPlayer(playerid int, url string, posX, posY, posZ, distance float32, usepos bool) bool {
csurl := C.CString(url)
defer C.free(unsafe.Pointer(csurl))
return bool(C.PlayAudioStreamForPlayer(C.int(playerid), C.nonConstToConst(csurl), C.float(posX), C.float(posY), C.float(posZ), C.float(distance), C.bool(usepos)))
}
// For documentation, please visit https://open.mp/docs/scripting/functions/StopAudioStreamForPlayer
func StopAudioStreamForPlayer(playerid int) bool {
return bool(C.StopAudioStreamForPlayer(C.int(playerid)))
}
// For documentation, please visit https://open.mp/docs/scripting/functions/SetPlayerShopName
func SetPlayerShopName(playerid int, shopname string) bool {
csshopname := C.CString(shopname)
defer C.free(unsafe.Pointer(csshopname))
return bool(C.SetPlayerShopName(C.int(playerid), C.nonConstToConst(csshopname)))
}
// For documentation, please visit https://open.mp/docs/scripting/functions/SetPlayerSkillLevel
func SetPlayerSkillLevel(playerid int, skill, level int) bool {
return bool(C.SetPlayerSkillLevel(C.int(playerid), C.int(skill), C.int(level)))
}
// For documentation, please visit https://open.mp/docs/scripting/functions/GetPlayerSurfingVehicleID
func GetPlayerSurfingVehicleID(playerid int) int {
return int(C.GetPlayerSurfingVehicleID(C.int(playerid)))
}
// For documentation, please visit https://open.mp/docs/scripting/functions/GetPlayerSurfingObjectID
func GetPlayerSurfingObjectID(playerid int) int {
return int(C.GetPlayerSurfingObjectID(C.int(playerid)))
}
// For documentation, please visit https://open.mp/docs/scripting/functions/RemoveBuildingForPlayer
func RemoveBuildingForPlayer(playerid, modelid int, fX, fY, fZ, fRadius float32) bool {
return bool(C.RemoveBuildingForPlayer(C.int(playerid), C.int(modelid), C.float(fX), C.float(fY), C.float(fZ), C.float(fRadius)))
}
// For documentation, please visit https://open.mp/docs/scripting/functions/GetPlayerLastShotVectors
func GetPlayerLastShotVectors(playerid int, fOriginX, fOriginY, fOriginZ, fHitPosX, fHitPosY, fHitPosZ *float32) bool {
var ret bool
var cfOriginX C.float
var cfOriginY C.float
var cfOriginZ C.float
var cfHitPosX C.float
var cfHitPosY C.float
var cfHitPosZ C.float
ret = bool(C.GetPlayerLastShotVectors(C.int(playerid), &cfOriginX, &cfOriginY, &cfOriginZ, &cfHitPosX, &cfHitPosY, &cfHitPosZ))
*fOriginX = float32(cfOriginX)
*fOriginY = float32(cfOriginY)
*fOriginZ = float32(cfOriginZ)
*fHitPosX = float32(cfHitPosX)
*fHitPosY = float32(cfHitPosY)
*fHitPosZ = float32(cfHitPosZ)
return ret
}
// For documentation, please visit https://open.mp/docs/scripting/functions/SetPlayerAttachedObject
func SetPlayerAttachedObject(playerid, index, modelid, bone int, fOffsetX, fOffsetY, fOffsetZ, fRotX, fRotY, fRotZ, fScaleX, fScaleY, fScaleZ float32, materialcolor1, materialcolor2 int) bool {
return bool(C.SetPlayerAttachedObject(C.int(playerid), C.int(index), C.int(modelid), C.int(bone), C.float(fOffsetX), C.float(fOffsetY), C.float(fOffsetZ), C.float(fRotX), C.float(fRotY), C.float(fRotZ), C.float(fScaleX), C.float(fScaleY), C.float(fScaleZ), C.int(materialcolor1), C.int(materialcolor2)))
}
// For documentation, please visit https://open.mp/docs/scripting/functions/RemovePlayerAttachedObject
func RemovePlayerAttachedObject(playerid, index int) bool {
return bool(C.RemovePlayerAttachedObject(C.int(playerid), C.int(index)))
}
// For documentation, please visit https://open.mp/docs/scripting/functions/IsPlayerAttachedObjectSlotUsed
func IsPlayerAttachedObjectSlotUsed(playerid, index int) bool {
return bool(C.IsPlayerAttachedObjectSlotUsed(C.int(playerid), C.int(index)))
}
// For documentation, please visit https://open.mp/docs/scripting/functions/EditAttachedObject
func EditAttachedObject(playerid, index int) bool {
return bool(C.EditAttachedObject(C.int(playerid), C.int(index)))
}
// For documentation, please visit https://open.mp/docs/scripting/functions/CreatePlayerTextDraw
func CreatePlayerTextDraw(playerid int, x, y float32, text string) int {
cstext := C.CString(text)
defer C.free(unsafe.Pointer(cstext))
return int(C.CreatePlayerTextDraw(C.int(playerid), C.float(x), C.float(y), C.nonConstToConst(cstext)))
}
// For documentation, please visit https://open.mp/docs/scripting/functions/PlayerTextDrawDestroy
func PlayerTextDrawDestroy(playerid int, textid int) bool {
return bool(C.PlayerTextDrawDestroy(C.int(playerid), C.int(textid)))
}
// For documentation, please visit https://open.mp/docs/scripting/functions/PlayerTextDrawLetterSize
func PlayerTextDrawLetterSize(playerid, textid int, x, y float32) bool {
return bool(C.PlayerTextDrawLetterSize(C.int(playerid), C.int(textid), C.float(x), C.float(y)))
}
// For documentation, please visit https://open.mp/docs/scripting/functions/PlayerTextDrawTextSize
func PlayerTextDrawTextSize(playerid, textid int, x, y float32) bool {
return bool(C.PlayerTextDrawTextSize(C.int(playerid), C.int(textid), C.float(x), C.float(y)))
}
// For documentation, please visit https://open.mp/docs/scripting/functions/PlayerTextDrawAlignment
func PlayerTextDrawAlignment(playerid, textid, alignment int) bool {
return bool(C.PlayerTextDrawAlignment(C.int(playerid), C.int(textid), C.int(alignment)))
}
// For documentation, please visit https://open.mp/docs/scripting/functions/PlayerTextDrawColor
func PlayerTextDrawColor(playerid, textid, color int) bool {
return bool(C.PlayerTextDrawColor(C.int(playerid), C.int(textid), C.int(color)))
}
// For documentation, please visit https://open.mp/docs/scripting/functions/PlayerTextDrawUseBox
func PlayerTextDrawUseBox(playerid, textid int, use bool) bool {
return bool(C.PlayerTextDrawUseBox(C.int(playerid), C.int(textid), C.bool(use)))
}
// For documentation, please visit https://open.mp/docs/scripting/functions/PlayerTextDrawBoxColor
func PlayerTextDrawBoxColor(playerid, textid, color int) bool {
return bool(C.PlayerTextDrawBoxColor(C.int(playerid), C.int(textid), C.int(color)))
}
// For documentation, please visit https://open.mp/docs/scripting/functions/PlayerTextDrawSetShadow
func PlayerTextDrawSetShadow(playerid, textid, size int) bool {
return bool(C.PlayerTextDrawSetShadow(C.int(playerid), C.int(textid), C.int(size)))
}
// For documentation, please visit https://open.mp/docs/scripting/functions/PlayerTextDrawSetOutline
func PlayerTextDrawSetOutline(playerid, textid, size int) bool {
return bool(C.PlayerTextDrawSetOutline(C.int(playerid), C.int(textid), C.int(size)))
}
// For documentation, please visit https://open.mp/docs/scripting/functions/PlayerTextDrawBackgroundColor
func PlayerTextDrawBackgroundColor(playerid, textid, color int) bool {
return bool(C.PlayerTextDrawBackgroundColor(C.int(playerid), C.int(textid), C.int(color)))
}
// For documentation, please visit https://open.mp/docs/scripting/functions/PlayerTextDrawFont
func PlayerTextDrawFont(playerid, textid, font int) bool {
return bool(C.PlayerTextDrawFont(C.int(playerid), C.int(textid), C.int(font)))
}
// For documentation, please visit https://open.mp/docs/scripting/functions/PlayerTextDrawSetProportional
func PlayerTextDrawSetProportional(playerid, textid int, set bool) bool {
return bool(C.PlayerTextDrawSetProportional(C.int(playerid), C.int(textid), C.bool(set)))
}
// For documentation, please visit https://open.mp/docs/scripting/functions/PlayerTextDrawSetSelectable
func PlayerTextDrawSetSelectable(playerid, textid int, set bool) bool {
return bool(C.PlayerTextDrawSetSelectable(C.int(playerid), C.int(textid), C.bool(set)))
}
// For documentation, please visit https://open.mp/docs/scripting/functions/PlayerTextDrawShow
func PlayerTextDrawShow(playerid, textid int) bool {
return bool(C.PlayerTextDrawShow(C.int(playerid), C.int(textid)))
}
// For documentation, please visit https://open.mp/docs/scripting/functions/PlayerTextDrawHide
func PlayerTextDrawHide(playerid, textid int) bool {
return bool(C.PlayerTextDrawHide(C.int(playerid), C.int(textid)))
}
// For documentation, please visit https://open.mp/docs/scripting/functions/PlayerTextDrawSetString
func PlayerTextDrawSetString(playerid, textid int, text string) bool {
cstring := C.CString(text)
defer C.free(unsafe.Pointer(cstring))
return bool(C.PlayerTextDrawSetString(C.int(playerid), C.int(textid), C.nonConstToConst(cstring)))
}
// For documentation, please visit https://open.mp/docs/scripting/functions/PlayerTextDrawSetPreviewModel
func PlayerTextDrawSetPreviewModel(playerid, textid, modelindex int) bool {
return bool(C.PlayerTextDrawSetPreviewModel(C.int(playerid), C.int(textid), C.int(modelindex)))
}
// For documentation, please visit https://open.mp/docs/scripting/functions/PlayerTextDrawSetPreviewRot
func PlayerTextDrawSetPreviewRot(playerid, textid int, fRotX, fRotY, fRotZ, fZoom float32) bool {
return bool(C.PlayerTextDrawSetPreviewRot(C.int(playerid), C.int(textid), C.float(fRotX), C.float(fRotY), C.float(fRotZ), C.float(fZoom)))
}
// For documentation, please visit https://open.mp/docs/scripting/functions/PlayerTextDrawSetPreviewVehCol
func PlayerTextDrawSetPreviewVehCol(playerid, textid, color1, color2 int) bool {
return bool(C.PlayerTextDrawSetPreviewVehCol(C.int(playerid), C.int(textid), C.int(color1), C.int(color2)))
}
// For documentation, please visit https://open.mp/docs/scripting/functions/SetPVarInt
func SetPVarInt(playerid int, varname string, value int) bool {
csvarname := C.CString(varname)
defer C.free(unsafe.Pointer(csvarname))
return bool(C.SetPVarInt(C.int(playerid), C.nonConstToConst(csvarname), C.int(value)))
}
// For documentation, please visit https://open.mp/docs/scripting/functions/GetPVarInt
func GetPVarInt(playerid int, varname string) int {
csvarname := C.CString(varname)
defer C.free(unsafe.Pointer(csvarname))
return int(C.GetPVarInt(C.int(playerid), C.nonConstToConst(csvarname)))
}
// For documentation, please visit https://open.mp/docs/scripting/functions/SetPVarString
func SetPVarString(playerid int, varname, value string) bool {
csvarname := C.CString(varname)
defer C.free(unsafe.Pointer(csvarname))
csvalue := C.CString(value)
defer C.free(unsafe.Pointer(csvalue))
return bool(C.SetPVarString(C.int(playerid), C.nonConstToConst(csvarname), C.nonConstToConst(csvalue)))
}
// For documentation, please visit https://open.mp/docs/scripting/functions/GetPVarString
func GetPVarString(playerid int, varname string, value *string, size int) bool {
csvarname := C.CString(varname)
defer C.free(unsafe.Pointer(csvarname))
var ret bool
var cvalue *C.char
cvalue = (*C.char)(C.malloc(C.uint(size)))
defer C.free(unsafe.Pointer(cvalue))
ret = bool(C.GetPVarString(C.int(playerid), C.nonConstToConst(csvarname), cvalue, C.int(size)))
*value = C.GoString(C.constToNonConst(cvalue))
return ret
}
// For documentation, please visit https://open.mp/docs/scripting/functions/SetPVarFloat
func SetPVarFloat(playerid int, varname string, value float32) bool {
csvarname := C.CString(varname)
defer C.free(unsafe.Pointer(csvarname))
return bool(C.SetPVarFloat(C.int(playerid), C.nonConstToConst(csvarname), C.float(value)))
}
// For documentation, please visit https://open.mp/docs/scripting/functions/GetPVarFloat
func GetPVarFloat(playerid int, varname string) float32 {
csvarname := C.CString(varname)
defer C.free(unsafe.Pointer(csvarname))
return float32(C.GetPVarFloat(C.int(playerid), C.nonConstToConst(csvarname)))
}
// For documentation, please visit https://open.mp/docs/scripting/functions/DeletePVar
func DeletePVar(playerid int, varname string) bool {
csvarname := C.CString(varname)
defer C.free(unsafe.Pointer(csvarname))
return bool(C.DeletePVar(C.int(playerid), C.nonConstToConst(csvarname)))
}
// For documentation, please visit https://open.mp/docs/scripting/functions/GetPVarsUpperIndex
func GetPVarsUpperIndex(playerid int) int {
return int(C.GetPVarsUpperIndex(C.int(playerid)))
}
// For documentation, please visit https://open.mp/docs/scripting/functions/GetPVarNameAtIndex
func GetPVarNameAtIndex(playerid, index int, varname *string, size int) bool {
var ret bool
var cvarname *C.char
cvarname = (*C.char)(C.malloc(C.uint(size)))
defer C.free(unsafe.Pointer(cvarname))
ret = bool(C.GetPVarNameAtIndex(C.int(playerid), C.int(index), cvarname, C.int(size)))
*varname = C.GoString(C.constToNonConst(cvarname))
return ret
}
// For documentation, please visit https://open.mp/docs/scripting/functions/GetPVarType
func GetPVarType(playerid int, varname string) int {
csvarname := C.CString(varname)
defer C.free(unsafe.Pointer(csvarname))
return int(C.GetPVarType(C.int(playerid), C.nonConstToConst(csvarname)))
}
// For documentation, please visit https://open.mp/docs/scripting/functions/SetPlayerChatBubble
func SetPlayerChatBubble(playerid int, text string, color int, drawdistance float32, expiretime int) bool {
cstext := C.CString(text)
defer C.free(unsafe.Pointer(cstext))
return bool(C.SetPlayerChatBubble(C.int(playerid), C.nonConstToConst(cstext), C.int(color), C.float(drawdistance), C.int(expiretime)))
}
// For documentation, please visit https://open.mp/docs/scripting/functions/PutPlayerInVehicle
func PutPlayerInVehicle(playerid, vehicleid, seatid int) bool {
return bool(C.PutPlayerInVehicle(C.int(playerid), C.int(vehicleid), C.int(seatid)))
}
// For documentation, please visit https://open.mp/docs/scripting/functions/GetPlayerVehicleID
func GetPlayerVehicleID(playerid int) int {
return int(C.GetPlayerVehicleID(C.int(playerid)))
}
// For documentation, please visit https://open.mp/docs/scripting/functions/GetPlayerVehicleSeat
func GetPlayerVehicleSeat(playerid int) int {
return int(C.GetPlayerVehicleSeat(C.int(playerid)))
}
// For documentation, please visit https://open.mp/docs/scripting/functions/RemovePlayerFromVehicle
func RemovePlayerFromVehicle(playerid int) bool {
return bool(C.RemovePlayerFromVehicle(C.int(playerid)))
}
// For documentation, please visit https://open.mp/docs/scripting/functions/TogglePlayerControllable
func TogglePlayerControllable(playerid int, toggle bool) bool {
return bool(C.TogglePlayerControllable(C.int(playerid), C.bool(toggle)))
}
// For documentation, please visit https://open.mp/docs/scripting/functions/PlayerPlaySound
func PlayerPlaySound(playerid, soundid int, x, y, z float32) bool {
return bool(C.PlayerPlaySound(C.int(playerid), C.int(soundid), C.float(x), C.float(y), C.float(z)))
}
// For documentation, please visit https://open.mp/docs/scripting/functions/ApplyAnimation
func ApplyAnimation(playerid int, animlib, animname string, fDelta float32, loop, lockx, locky, freeze bool, time int, forcesync bool) bool {
csanimlib := C.CString(animlib)
defer C.free(unsafe.Pointer(csanimlib))
csanimname := C.CString(animname)
defer C.free(unsafe.Pointer(csanimname))
return bool(C.ApplyAnimation(C.int(playerid), C.nonConstToConst(csanimlib), C.nonConstToConst(csanimname), C.float(fDelta), C.bool(loop), C.bool(lockx), C.bool(locky), C.bool(freeze), C.int(time), C.bool(forcesync)))
}
// For documentation, please visit https://open.mp/docs/scripting/functions/ClearAnimations
func ClearAnimations(playerid int, forcesync bool) bool {
return bool(C.ClearAnimations(C.int(playerid), C.bool(forcesync)))
}
// For documentation, please visit https://open.mp/docs/scripting/functions/GetPlayerAnimationIndex
func GetPlayerAnimationIndex(playerid int) int {
return int(C.GetPlayerAnimationIndex(C.int(playerid)))
}
// For documentation, please visit https://open.mp/docs/scripting/functions/GetAnimationName
func GetAnimationName(index int, animlib *string, animlib_size int, animname *string, animname_size int) bool {
var ret bool
var canimlib *C.char
canimlib = (*C.char)(C.malloc(C.uint(animlib_size)))
defer C.free(unsafe.Pointer(canimlib))
var canimname *C.char
canimname = (*C.char)(C.malloc(C.uint(animname_size)))
defer C.free(unsafe.Pointer(canimname))
ret = bool(C.GetAnimationName(C.int(index), canimlib, C.int(animlib_size), canimname, C.int(animname_size)))
*animlib = C.GoString(C.constToNonConst(canimlib))
*animname = C.GoString(C.constToNonConst(canimname))
return ret
}
// For documentation, please visit https://open.mp/docs/scripting/functions/GetPlayerSpecialAction
func GetPlayerSpecialAction(playerid int) int {
return int(C.GetPlayerSpecialAction(C.int(playerid)))
}
// For documentation, please visit https://open.mp/docs/scripting/functions/SetPlayerSpecialAction
func SetPlayerSpecialAction(playerid int, actionid int) bool {
return bool(C.SetPlayerSpecialAction(C.int(playerid), C.int(actionid)))
}
// For documentation, please visit https://open.mp/docs/scripting/functions/DisableRemoteVehicleCollisions
func DisableRemoteVehicleCollisions(playerid int, disable bool) bool {
return bool(C.DisableRemoteVehicleCollisions(C.int(playerid), C.bool(disable)))
}
// For documentation, please visit https://open.mp/docs/scripting/functions/SetPlayerCheckpoint
func SetPlayerCheckpoint(playerid int, x, y, z, size float32) bool {
return bool(C.SetPlayerCheckpoint(C.int(playerid), C.float(x), C.float(y), C.float(z), C.float(size)))
}
// For documentation, please visit https://open.mp/docs/scripting/functions/DisablePlayerCheckpoint
func DisablePlayerCheckpoint(playerid int) bool {
return bool(C.DisablePlayerCheckpoint(C.int(playerid)))
}
// For documentation, please visit https://open.mp/docs/scripting/functions/SetPlayerRaceCheckpoint
func SetPlayerRaceCheckpoint(playerid, type_ int, x, y, z, nextx, nexty, nextz, size float32) bool {
return bool(C.SetPlayerRaceCheckpoint(C.int(playerid), C.int(type_), C.float(x), C.float(y), C.float(z), C.float(nextx), C.float(nexty), C.float(nextz), C.float(size)))
}
// For documentation, please visit https://open.mp/docs/scripting/functions/DisablePlayerRaceCheckpoint
func DisablePlayerRaceCheckpoint(playerid int) bool {
return bool(C.DisablePlayerRaceCheckpoint(C.int(playerid)))
}
// For documentation, please visit https://open.mp/docs/scripting/functions/SetPlayerWorldBounds
func SetPlayerWorldBounds(playerid int, x_max, x_min, y_max, y_min float32) bool {
return bool(C.SetPlayerWorldBounds(C.int(playerid), C.float(x_max), C.float(x_min), C.float(y_max), C.float(y_min)))
}
// For documentation, please visit https://open.mp/docs/scripting/functions/SetPlayerMarkerForPlayer
func SetPlayerMarkerForPlayer(playerid, showplayerid, color int) bool {
return bool(C.SetPlayerMarkerForPlayer(C.int(playerid), C.int(showplayerid), C.int(color)))
}
// For documentation, please visit https://open.mp/docs/scripting/functions/ShowPlayerNameTagForPlayer
func ShowPlayerNameTagForPlayer(playerid, showplayerid int, show bool) bool {
return bool(C.ShowPlayerNameTagForPlayer(C.int(playerid), C.int(showplayerid), C.bool(show)))
}
// For documentation, please visit https://open.mp/docs/scripting/functions/SetPlayerMapIcon
func SetPlayerMapIcon(playerid, iconid int, x, y, z float32, markertype, color, style int) bool {
return bool(C.SetPlayerMapIcon(C.int(playerid), C.int(iconid), C.float(x), C.float(y), C.float(z), C.int(markertype), C.int(color), C.int(style)))
}
// For documentation, please visit https://open.mp/docs/scripting/functions/RemovePlayerMapIcon
func RemovePlayerMapIcon(playerid, iconid int) bool {
return bool(C.RemovePlayerMapIcon(C.int(playerid), C.int(iconid)))
}
// For documentation, please visit https://open.mp/docs/scripting/functions/AllowPlayerTeleport
func AllowPlayerTeleport(playerid int, allow bool) bool {
return bool(C.AllowPlayerTeleport(C.int(playerid), C.bool(allow)))
}
// For documentation, please visit https://open.mp/docs/scripting/functions/SetPlayerCameraPos
func SetPlayerCameraPos(playerid int, x, y, z float32) bool {
return bool(C.SetPlayerCameraPos(C.int(playerid), C.float(x), C.float(y), C.float(z)))
}
// For documentation, please visit https://open.mp/docs/scripting/functions/SetPlayerCameraLookAt
func SetPlayerCameraLookAt(playerid int, x, y, z float32, cut int) bool {
return bool(C.SetPlayerCameraLookAt(C.int(playerid), C.float(x), C.float(y), C.float(z), C.int(cut)))
}
// For documentation, please visit https://open.mp/docs/scripting/functions/SetCameraBehindPlayer
func SetCameraBehindPlayer(playerid int) bool {
return bool(C.SetCameraBehindPlayer(C.int(playerid)))
}
// For documentation, please visit https://open.mp/docs/scripting/functions/GetPlayerCameraPos
func GetPlayerCameraPos(playerid int, x, y, z *float32) bool {
var ret bool
var cx C.float
var cy C.float
var cz C.float
ret = bool(C.GetPlayerCameraPos(C.int(playerid), &cx, &cy, &cz))
*x = float32(cx)
*y = float32(cy)
*z = float32(cz)
return ret
}
// For documentation, please visit https://open.mp/docs/scripting/functions/GetPlayerCameraFrontVector
func GetPlayerCameraFrontVector(playerid int, x, y, z *float32) bool {
var ret bool
var cx C.float
var cy C.float
var cz C.float
ret = bool(C.GetPlayerCameraFrontVector(C.int(playerid), &cx, &cy, &cz))
*x = float32(cx)
*y = float32(cy)
*z = float32(cz)
return ret
}
// For documentation, please visit https://open.mp/docs/scripting/functions/GetPlayerCameraMode
func GetPlayerCameraMode(playerid int) int {
return int(C.GetPlayerCameraMode(C.int(playerid)))
}
// For documentation, please visit https://open.mp/docs/scripting/functions/EnablePlayerCameraTarget
func EnablePlayerCameraTarget(playerid int, enable bool) bool {
return bool(C.EnablePlayerCameraTarget(C.int(playerid), C.bool(enable)))
}
// For documentation, please visit https://open.mp/docs/scripting/functions/GetPlayerCameraTargetObject
func GetPlayerCameraTargetObject(playerid int) int {
return int(C.GetPlayerCameraTargetObject(C.int(playerid)))
}
// For documentation, please visit https://open.mp/docs/scripting/functions/GetPlayerCameraTargetVehicle
func GetPlayerCameraTargetVehicle(playerid int) int {
return int(C.GetPlayerCameraTargetVehicle(C.int(playerid)))
}
// For documentation, please visit https://open.mp/docs/scripting/functions/GetPlayerCameraTargetPlayer
func GetPlayerCameraTargetPlayer(playerid int) int {
return int(C.GetPlayerCameraTargetPlayer(C.int(playerid)))
}
// For documentation, please visit https://open.mp/docs/scripting/functions/GetPlayerCameraTargetActor
func GetPlayerCameraTargetActor(playerid int) int {
return int(C.GetPlayerCameraTargetActor(C.int(playerid)))
}
// For documentation, please visit https://open.mp/docs/scripting/functions/GetPlayerCameraAspectRatio
func GetPlayerCameraAspectRatio(playerid int) float32 {
return float32(C.GetPlayerCameraAspectRatio(C.int(playerid)))
}
// For documentation, please visit https://open.mp/docs/scripting/functions/GetPlayerCameraZoom
func GetPlayerCameraZoom(playerid int) float32 {
return float32(C.GetPlayerCameraZoom(C.int(playerid)))
}
// For documentation, please visit https://open.mp/docs/scripting/functions/AttachCameraToObject
func AttachCameraToObject(playerid, objectid int) bool {
return bool(C.AttachCameraToObject(C.int(playerid), C.int(objectid)))
}
// For documentation, please visit https://open.mp/docs/scripting/functions/AttachCameraToPlayerObject
func AttachCameraToPlayerObject(playerid, playerobjectid int) bool {
return bool(C.AttachCameraToPlayerObject(C.int(playerid), C.int(playerobjectid)))
}
// For documentation, please visit https://open.mp/docs/scripting/functions/InterpolateCameraPos
func InterpolateCameraPos(playerid int, FromX, FromY, FromZ, ToX, ToY, ToZ float32, time, cut int) bool {
return bool(C.InterpolateCameraPos(C.int(playerid), C.float(FromX), C.float(FromY), C.float(FromZ), C.float(ToX), C.float(ToY), C.float(ToZ), C.int(time), C.int(cut)))
}
// For documentation, please visit https://open.mp/docs/scripting/functions/InterpolateCameraLookAt
func InterpolateCameraLookAt(playerid int, FromX, FromY, FromZ, ToX, ToY, ToZ float32, time, cut int) bool {
return bool(C.InterpolateCameraLookAt(C.int(playerid), C.float(FromX), C.float(FromY), C.float(FromZ), C.float(ToX), C.float(ToY), C.float(ToZ), C.int(time), C.int(cut)))
}
// For documentation, please visit https://open.mp/docs/scripting/functions/IsPlayerConnected
func IsPlayerConnected(playerid int) bool {
return bool(C.IsPlayerConnected(C.int(playerid)))
}
// For documentation, please visit https://open.mp/docs/scripting/functions/IsPlayerInVehicle
func IsPlayerInVehicle(playerid int, vehicleid int) bool {
return bool(C.IsPlayerInVehicle(C.int(playerid), C.int(vehicleid)))
}
// For documentation, please visit https://open.mp/docs/scripting/functions/IsPlayerInAnyVehicle
func IsPlayerInAnyVehicle(playerid int) bool {
return bool(C.IsPlayerInAnyVehicle(C.int(playerid)))
}
// For documentation, please visit https://open.mp/docs/scripting/functions/IsPlayerInCheckpoint
func IsPlayerInCheckpoint(playerid int) bool {
return bool(C.IsPlayerInCheckpoint(C.int(playerid)))
}
// For documentation, please visit https://open.mp/docs/scripting/functions/IsPlayerInRaceCheckpoint
func IsPlayerInRaceCheckpoint(playerid int) bool {
return bool(C.IsPlayerInRaceCheckpoint(C.int(playerid)))
}
// For documentation, please visit https://open.mp/docs/scripting/functions/SetPlayerVirtualWorld
func SetPlayerVirtualWorld(playerid int, worldid int) bool {
return bool(C.SetPlayerVirtualWorld(C.int(playerid), C.int(worldid)))
}
// For documentation, please visit https://open.mp/docs/scripting/functions/GetPlayerVirtualWorld