Bunch of changes (see description)
* New script files to organize GUI * Added clientside pickup detection to reduce server load for enter/exit * Added notips command for players to toggle random tips * Select account last IP as part of wildcard (was separate due to old INT) * Save account registration with datetime instead of unix timestamp * Don't force mouse camera on moving anims in SA+ * Add IP ban to server runtime memory in subnet ban command * Add non-roleplay character name account moderation flag * Fix bizowner and bizclan commands * Fix bug that allowed buying items without having the needed cash * Fix set biz blip command * Add dealership help label type command * Added command to show all clan flag types * Added discord config and load from database * Fix angle for directional teleport and anim move directions * Use new colour structure in preparation for locale translations * Add on-foot only item usetype array to prevent using when in veh * Fix wrong const value for exit pickup type * Start using datetime in MySQL tables instead of unix timestamps * Start adding webhooks for discord (unfinished) * Added new discord URL to discord help category * Added house reset pickups/blips utils * Prevent using items when in skin selector * Fix get player command * Fix give player money command * Add coffee shop and vehicle repair shop default biz item templates * Remove old game fixes util (resource now in server config) * Fix bug where characters in clans wouldn't be shown in char select * Slimmed down the amount of timers * Made some potentially large numbers more readable (commas) * Remove colours in message for console output
This commit is contained in:
@@ -122,41 +122,69 @@ function submitBugReportCommand(command, params, client) {
|
||||
// ===========================================================================
|
||||
|
||||
function enterExitPropertyCommand(command, params, client) {
|
||||
let closestBusinessEntrance = getClosestBusinessEntrance(getPlayerPosition(client), getPlayerDimension(client));
|
||||
let closestBusinessExit = getClosestBusinessExit(getPlayerPosition(client), getPlayerDimension(client));
|
||||
let closestHouseEntrance = getClosestHouseEntrance(getPlayerPosition(client), getPlayerDimension(client));
|
||||
let closestHouseExit = getClosestHouseExit(getPlayerPosition(client), getPlayerDimension(client));
|
||||
//let closestBusinessEntrance = getClosestBusinessEntrance(getPlayerPosition(client), getPlayerDimension(client));
|
||||
//let closestBusinessExit = getClosestBusinessExit(getPlayerPosition(client), getPlayerDimension(client));
|
||||
//let closestHouseEntrance = getClosestHouseEntrance(getPlayerPosition(client), getPlayerDimension(client));
|
||||
//let closestHouseExit = getClosestHouseExit(getPlayerPosition(client), getPlayerDimension(client));
|
||||
|
||||
let closestEntrance = null;
|
||||
let closestExit = null;
|
||||
let closestProperty = null;
|
||||
let isEntrance = false;
|
||||
let isBusiness = false;
|
||||
|
||||
if(getDistance(getPlayerPosition(client), getBusinessData(closestBusinessEntrance).entrancePosition) <= getDistance(getPlayerPosition(client), getHouseData(closestHouseEntrance).entrancePosition)) {
|
||||
closestEntrance = getBusinessData(closestBusinessEntrance);
|
||||
} else {
|
||||
closestEntrance = getHouseData(closestHouseEntrance);
|
||||
}
|
||||
//if(getDistance(getPlayerPosition(client), getBusinessData(closestBusinessEntrance).entrancePosition) <= getDistance(getPlayerPosition(client), getHouseData(closestHouseEntrance).entrancePosition)) {
|
||||
// closestEntrance = getBusinessData(closestBusinessEntrance);
|
||||
//} else {
|
||||
// closestEntrance = getHouseData(closestHouseEntrance);
|
||||
//}
|
||||
|
||||
if(getDistance(getPlayerPosition(client), getBusinessData(closestBusinessExit).exitPosition) <= getDistance(getPlayerPosition(client), getHouseData(closestHouseExit).exitPosition)) {
|
||||
closestExit = getBusinessData(closestBusinessExit);
|
||||
} else {
|
||||
closestExit = getHouseData(closestHouseExit);
|
||||
}
|
||||
//if(getDistance(getPlayerPosition(client), getBusinessData(closestBusinessExit).exitPosition) <= getDistance(getPlayerPosition(client), getHouseData(closestHouseExit).exitPosition)) {
|
||||
// closestExit = getBusinessData(closestBusinessExit);
|
||||
//} else {
|
||||
// closestExit = getHouseData(closestHouseExit);
|
||||
//}
|
||||
|
||||
if(getDistance(getPlayerPosition(client), closestEntrance.entrancePosition) <= getDistance(getPlayerPosition(client), closestExit.exitPosition)) {
|
||||
closestProperty = closestEntrance;
|
||||
isEntrance = true;
|
||||
} else {
|
||||
closestProperty = closestExit;
|
||||
isEntrance = false;
|
||||
}
|
||||
//if(getDistance(getPlayerPosition(client), closestEntrance.entrancePosition) <= getDistance(getPlayerPosition(client), closestExit.exitPosition)) {
|
||||
// closestProperty = closestEntrance;
|
||||
// isEntrance = true;
|
||||
//} else {
|
||||
// closestProperty = closestExit;
|
||||
// isEntrance = false;
|
||||
//}
|
||||
|
||||
if(closestProperty instanceof HouseData) {
|
||||
isBusiness = false;
|
||||
} else {
|
||||
isBusiness = true;
|
||||
if(getPlayerData(client).currentPickup != false) {
|
||||
let ownerType = getEntityData(getPlayerData(client).currentPickup, "vrr.owner.type");
|
||||
let ownerId = getEntityData(getPlayerData(client).currentPickup, "vrr.owner.id");
|
||||
|
||||
//logToConsole(LOG_DEBUG, `${getPlayerDisplayForConsole(client)} is near pickup for owner ID ${ownerId}`);
|
||||
|
||||
switch(ownerType) {
|
||||
case VRR_PICKUP_BUSINESS_ENTRANCE:
|
||||
isBusiness = true;
|
||||
isEntrance = true;
|
||||
closestProperty = getServerData().businesses[ownerId];
|
||||
break;
|
||||
|
||||
case VRR_PICKUP_BUSINESS_EXIT:
|
||||
isBusiness = true;
|
||||
isEntrance = false;
|
||||
closestProperty = getServerData().businesses[ownerId];
|
||||
break;
|
||||
|
||||
case VRR_PICKUP_HOUSE_ENTRANCE:
|
||||
isBusiness = false;
|
||||
isEntrance = true;
|
||||
closestProperty = getServerData().houses[ownerId];
|
||||
break;
|
||||
|
||||
case VRR_PICKUP_HOUSE_EXIT:
|
||||
isBusiness = false;
|
||||
isEntrance = false;
|
||||
closestProperty = getServerData().houses[ownerId];
|
||||
break;
|
||||
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
logToConsole(LOG_DEBUG, `${getPlayerDisplayForConsole(client)}'s closest door is ${(isBusiness) ? closestProperty.name : closestProperty.description} ${(isEntrance) ? "entrance" : "exit"}`);
|
||||
@@ -167,6 +195,12 @@ function enterExitPropertyCommand(command, params, client) {
|
||||
meActionToNearbyPlayers(client, `tries to open the ${(isBusiness) ? "business" : "house"} door but fails because it's locked`);
|
||||
return false;
|
||||
}
|
||||
|
||||
if(!closestProperty.hasInterior) {
|
||||
messagePlayerAlert(client, `This ${(isBusiness) ? "business" : "house"} does not have an interior, but you can still use commands at the door icon.`);
|
||||
return false;
|
||||
}
|
||||
|
||||
clearPlayerStateToEnterExitProperty(client);
|
||||
getPlayerData(client).pedState = VRR_PEDSTATE_ENTERINGPROPERTY;
|
||||
meActionToNearbyPlayers(client, `opens the door and enters the ${(isBusiness) ? "business" : "house"}`);
|
||||
@@ -234,22 +268,6 @@ function enterExitPropertyCommand(command, params, client) {
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
function loadGameFixesResource() {
|
||||
//switch(getServerGame()) {
|
||||
// case GAME_GTA_III:
|
||||
// if(findResourceByName("asshat-gta3") != null) {
|
||||
// findResourceByName("asshat-gta3").start();
|
||||
// }
|
||||
// break;
|
||||
//
|
||||
// default:
|
||||
// break;
|
||||
//}
|
||||
return true;
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
function getPlayerInfoCommand(command, params, client) {
|
||||
if(areParamsEmpty(params)) {
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user