Update xml
This commit is contained in:
@@ -493,13 +493,15 @@ function getClosestCivilian(position) {
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
function getClosestPlayer(position) {
|
||||
function getClosestPlayer(position, exemptClient) {
|
||||
let clients = getClients();
|
||||
let closest = 0;
|
||||
for(let i in clients) {
|
||||
if(getDistance(getPlayerPosition(clients[i]), position) > 0.0) {
|
||||
if(getDistance(getPlayerPosition(clients[i]), position) < getDistance(getPlayerPosition(clients[closest]), position)) {
|
||||
closest = i;
|
||||
if(clients[i] != exemptClient) {
|
||||
if(getDistance(getPlayerPosition(clients[i]), position) > 0.0) {
|
||||
if(getDistance(getPlayerPosition(clients[i]), position) < getDistance(getPlayerPosition(clients[closest]), position)) {
|
||||
closest = i;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1965,4 +1967,17 @@ function removeColoursFromString(str) {
|
||||
return [str, matchedHexes];
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
function getClientByName(name) {
|
||||
let clients = getClients();
|
||||
for(let i in clients) {
|
||||
if(clients[i].name == name) {
|
||||
return clients[i];
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
@@ -1067,4 +1067,21 @@ function checkVehicleBurning() {
|
||||
}
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
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