1. IsPlayerAiming(playerid, weaponid); - returns true if a player is aiming. (Includes zoom-in weapons.) 2. IsPlayerSwimming(playerid); - returns true if a player is swimming. (Regardless of the water body.) 3. IsPlayerSkydiving(playerid); - returns true if a player is skydiving. 4. IsPlayerParachuting(playerid); - returns true if a player is parachuting. 5. IsPlayerPassengerAiming(playerid); - returns true if a player is aiming a weapon as passenger of vehicle. 6. IsPlayerInKitchen(playerid); - returns true if player is in Kitchen. (Default Interiors.) 7. IsPlayerNearVending(playerid, type); - returns true if player is near Vending Machine. (Default locations.) 8. IsPlayerNearPump(playerid); - returns true if a player is near Fuel Pump. (Default Locations.) 8. IsPlayerCarSurfing(playerid) - returns true if player is car surfing. 9. IsPlayerNearPlayer(playerid, targetid, float:radius) - returns true if player is near another player in given radius. 10. IsPlayerNearVehicle(playerid, vehicleid, float:radius) - returns true if player is near specified vehicle in given radius. 11. IsPlayerNearDynamicObject(playerid, objectid, float:radius) - returns true if player is near specified dynamic object id in given radius 12. IsPlayerRidingTrain(playerid); - returns true if player is riding a train. 13. IsPlayerSpawned(playerid); - returns true if player is spawned.
Ritzy - Author |Stuntman| And Southclaws - Helped a lot Emmet_ - Vending Machine Array OneDay - Optimization SA-MP Team (Past, and Present) - For SA-MP
stock bool:IsPlayerPassengerAiming(playerid)
{
return GetPlayerCameraMode(playerid) == 55 && 22 <= GetPlayerWeapon(playerid) <= 38 && GetPlayerState(playerid) == PLAYER_STATE_PASSENGER;
}
|
They are not natives only plugins add natives. and this is wrong: 0<=plaerid<=MAX_PLAYERS
why not: PHP код:
|
0<=playerid<=MAX_PLAYERS
proc ; IsPlayerPassengerAiming1
; line 5
;$lcl playerid c
; line 6
break ; c
;$lcl wep fffffffc
stack fffffffc
push.s c
;$par
push.c 4
sysreq.c 0 ; GetPlayerWeapon
stack 8
stor.s.pri fffffffc
;$exp
; line 7
break ; 40
;$lcl camera fffffff8
stack fffffffc
push.s c
;$par
push.c 4
sysreq.c 1 ; GetPlayerCameraMode
stack 8
stor.s.pri fffffff8
;$exp
; line 8
break ; 74
;$lcl pState fffffff4
stack fffffffc
push.s c
;$par
push.c 4
sysreq.c 2 ; GetPlayerState
stack 8
stor.s.pri fffffff4
;$exp
; line a
break ; a8
load.s.pri fffffff8
eq.c.pri 37
jzer 1
const.pri 16
load.s.alt fffffffc
sleq
push.pri
const.pri 26
sgeq
pop.alt
and
jzer 1
load.s.pri fffffff4
eq.c.pri 3
jzer 1
const.pri 1
jump 2
l.1
zero.pri
l.2
jzer 0
;$exp
; line b
break ; 12c
const.pri 1
stack c
retn
l.0 ; 144
; line d
break ; 144
zero.pri
stack c
retn
proc ; IsPlayerPassengerAiming2
; line 11
;$lcl playerid c
; line 12
break ; 15c
push.s c
;$par
push.c 4
sysreq.c 1 ; GetPlayerCameraMode
stack 8
eq.c.pri 37
jzer 3
push.s c
;$par
push.c 4
sysreq.c 0 ; GetPlayerWeapon
stack 8
const.alt 16
xchg
sleq
push.pri
const.pri 26
sgeq
pop.alt
and
jzer 3
push.s c
;$par
push.c 4
sysreq.c 2 ; GetPlayerState
stack 8
eq.c.pri 3
jzer 3
const.pri 1
jump 4
l.3
zero.pri
l.4
retn
native IsPlayerPassengerAiming(playerid);
Script[gamemodes/aiming.amx]: Run time error 19: "File or function is not found"
|
I'm also not sure why this is wrong -
Код:
0<=playerid<=MAX_PLAYERS |
|
It would prompt OB. because the indeces of MAX_PLAYERS in array is 0 to 499 or w/e the value of MAX_PLAYERS take away one, so a valid check would just using < less than, not <= less than or equals
pawn Код:
|
The only means that a pawn program has to manipulate objects in the host application is by calling subroutines, so called “native functions”, that the host application provides.
|
Just as OneDay says, you're not truly creating native functions. As the PAWN Language Guide says:
Код:
The only means that a pawn program has to manipulate objects in the host application is by calling subroutines, so called “native functions”, that the host application provides. |
|
PAWN has short-circuiting. Your code calls 3 functions then checks. My code calls 1 function then checks then may not call another.
|