Readd stuff to utilities
This commit is contained in:
@@ -493,11 +493,11 @@ function getClosestCivilian(position) {
|
|||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
|
|
||||||
function getClosestPlayer(position) {
|
function getClosestPlayer(position, exemptClient) {
|
||||||
let clients = getClients();
|
let clients = getClients();
|
||||||
let closest = 0;
|
let closest = 0;
|
||||||
for(let i in clients) {
|
for(let i in clients) {
|
||||||
if(getDistance(getPlayerPosition(clients[i]), position) > 0.0) {
|
if(exemptClient != clients[i]) {
|
||||||
if(getDistance(getPlayerPosition(clients[i]), position) < getDistance(getPlayerPosition(clients[closest]), position)) {
|
if(getDistance(getPlayerPosition(clients[i]), position) < getDistance(getPlayerPosition(clients[closest]), position)) {
|
||||||
closest = i;
|
closest = i;
|
||||||
}
|
}
|
||||||
@@ -1966,3 +1966,20 @@ function removeColoursFromString(str) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// -------------------------------------------------------------------------
|
// -------------------------------------------------------------------------
|
||||||
|
|
||||||
|
function checkPlayerPedStates() {
|
||||||
|
let clients = getClients();
|
||||||
|
for(let i in clients) {
|
||||||
|
if(getPlayerData(clients[i])) {
|
||||||
|
if(getPlayerData(clients[i]).pedState) {
|
||||||
|
if(isPlayerInAnyVehicle(clients[i])) {
|
||||||
|
if(getPlayerData(clients[i]).pedState == AG_PEDSTATE_EXITINGVEHICLE) {
|
||||||
|
getPlayerData(clients[i]).pedState == AG_PEDSTATE_READY;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// -------------------------------------------------------------------------
|
||||||
Reference in New Issue
Block a user