15.02.2018, 14:08
(
Последний раз редактировалось iKarim; 17.02.2018 в 06:02.
)
drift-detection.inc: v1.0.1
This include provide basic drift detection functionality that can be used in any drift script, it doesn't require a plugin, just plug and start using it. It's aimed to be basic to avoid performance issues since it's written in PAWN. I have noticed that the drift plugin was removed from the forum (and it didn't work with newer SA-MP versions) so I decided to rewrite this include I've created a while ago and release it. I am willing to continue developing this include if it gains interest, so don't hesitate to suggest a feature or report a bug!Preview:
Documentation:
Functions:
PHP код:
Drift::EnableDetection(playerid = -1);
Drift::EnableDamageCheck(playerid = -1);
Drift::DisableDetection(playerid = -1);
Drift::DisableDamageCheck(playerid = -1);
bool: Drift::IsDetectionEnabled(playerid = -1);
bool: Drift::IsDamageCheckEnabled(playerid = -1);
bool: Drift::IsPlayerDrifting(playerid);
Drift::SetMinAngle(Float: angle);
Drift::SetMinSpeed(Float: speed);
Drift::SetTimeoutTicks(ticks);
Float: Drift::GetMinAngle();
Float: Drift::GetMinSpeed();
Drift::GetTimeoutTicks();
PHP код:
forward OnPlayerDriftStart(playerid);
forward OnPlayerDriftUpdate(playerid, Float: drift_angle, Float: speed);
forward OnPlayerDriftEnd(playerid, reason, Float: distance, time);
- DRIFT_END_REASON_DAMAGED: vehicle is damaged (only when DamageCheck is enabled)
- DRIFT_END_REASON_TIMEOUT: player has stopped drifting for N * delay interval.
- DRIFT_END_REASON_OTHER: player left his vehicle or disconencted from the server.
sampctl:
Код:
sampctl package install ltkarim/drift-detection
https://github.com/ltkarim/drift-detection