Mass convert indentation + add ped speech cmd
This commit is contained in:
@@ -15,121 +15,121 @@ function initGUIScript() {
|
||||
// ===========================================================================
|
||||
|
||||
function playerPromptAnswerNo(client) {
|
||||
if(getPlayerData(client).promptType == VRR_PROMPT_NONE) {
|
||||
return false;
|
||||
}
|
||||
if(getPlayerData(client).promptType == VRR_PROMPT_NONE) {
|
||||
return false;
|
||||
}
|
||||
|
||||
logToConsole(LOG_DEBUG, `[VRR.GUI] ${getPlayerDisplayForConsole(client)} answered NO to their prompt (${getPlayerData(client).promptType})`);
|
||||
logToConsole(LOG_DEBUG, `[VRR.GUI] ${getPlayerDisplayForConsole(client)} answered NO to their prompt (${getPlayerData(client).promptType})`);
|
||||
|
||||
switch(getPlayerData(client).promptType) {
|
||||
case VRR_PROMPT_CREATEFIRSTCHAR:
|
||||
logToConsole(LOG_DEBUG, `${getPlayerDisplayForConsole(client)} chose not to create a first character. Kicking them from the server ...`);
|
||||
showPlayerErrorGUI(client, "You don't have a character to play. Goodbye!", "No Characters");
|
||||
setTimeout(function() { client.disconnect(); }, 5000);
|
||||
break;
|
||||
switch(getPlayerData(client).promptType) {
|
||||
case VRR_PROMPT_CREATEFIRSTCHAR:
|
||||
logToConsole(LOG_DEBUG, `${getPlayerDisplayForConsole(client)} chose not to create a first character. Kicking them from the server ...`);
|
||||
showPlayerErrorGUI(client, "You don't have a character to play. Goodbye!", "No Characters");
|
||||
setTimeout(function() { client.disconnect(); }, 5000);
|
||||
break;
|
||||
|
||||
case VRR_PROMPT_BIZORDER:
|
||||
if(getPlayerData(client).businessOrderAmount > 0) {
|
||||
if(canPlayerUseGUI(client)) {
|
||||
showPlayerErrorGUI(client, "You canceled the order.", "Business Order Canceled");
|
||||
} else {
|
||||
logToConsole(LOG_DEBUG, `${getPlayerDisplayForConsole(client)} canceled the order of ${getPlayerData(client).businessOrderAmount} ${getPlayerData(client).businessOrderItem} at ${getPlayerData(client).businessOrderCost/getPlayerData(client).businessOrderAmount} each for business ${getBusinessData(getPlayerData(client).businessOrderBusiness)}`);
|
||||
messagePlayerError(client, "You canceled the order!");
|
||||
}
|
||||
} else {
|
||||
showPlayerErrorGUI(client, "You aren't ordering anything for a business!", "Business Order Canceled");
|
||||
}
|
||||
break;
|
||||
case VRR_PROMPT_BIZORDER:
|
||||
if(getPlayerData(client).businessOrderAmount > 0) {
|
||||
if(canPlayerUseGUI(client)) {
|
||||
showPlayerErrorGUI(client, "You canceled the order.", "Business Order Canceled");
|
||||
} else {
|
||||
logToConsole(LOG_DEBUG, `${getPlayerDisplayForConsole(client)} canceled the order of ${getPlayerData(client).businessOrderAmount} ${getPlayerData(client).businessOrderItem} at ${getPlayerData(client).businessOrderCost/getPlayerData(client).businessOrderAmount} each for business ${getBusinessData(getPlayerData(client).businessOrderBusiness)}`);
|
||||
messagePlayerError(client, "You canceled the order!");
|
||||
}
|
||||
} else {
|
||||
showPlayerErrorGUI(client, "You aren't ordering anything for a business!", "Business Order Canceled");
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
getPlayerData(client).promptType = VRR_PROMPT_NONE;
|
||||
getPlayerData(client).promptType = VRR_PROMPT_NONE;
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
function playerPromptAnswerYes(client) {
|
||||
if(getPlayerData(client).promptType == VRR_PROMPT_NONE) {
|
||||
return false;
|
||||
}
|
||||
if(getPlayerData(client).promptType == VRR_PROMPT_NONE) {
|
||||
return false;
|
||||
}
|
||||
|
||||
logToConsole(LOG_DEBUG, `[VRR.GUI] ${getPlayerDisplayForConsole(client)} answered YES to their prompt (${getPlayerData(client).promptType})`);
|
||||
logToConsole(LOG_DEBUG, `[VRR.GUI] ${getPlayerDisplayForConsole(client)} answered YES to their prompt (${getPlayerData(client).promptType})`);
|
||||
|
||||
switch(getPlayerData(client).promptType) {
|
||||
case VRR_PROMPT_CREATEFIRSTCHAR:
|
||||
showPlayerNewCharacterGUI(client);
|
||||
break;
|
||||
switch(getPlayerData(client).promptType) {
|
||||
case VRR_PROMPT_CREATEFIRSTCHAR:
|
||||
showPlayerNewCharacterGUI(client);
|
||||
break;
|
||||
|
||||
case VRR_PROMPT_BIZORDER:
|
||||
if(getPlayerData(client).businessOrderAmount > 0) {
|
||||
if(getBusinessData(getPlayerData(client).businessOrderBusiness).till < getPlayerData(client).businessOrderCost) {
|
||||
logToConsole(LOG_DEBUG, `[VRR.GUI] ${getPlayerDisplayForConsole(client)} failed to order ${getPlayerData(client).businessOrderAmount} ${getItemTypeData(getPlayerData(client).businessOrderItem).name} at ${getPlayerData(client).businessOrderCost/getPlayerData(client).businessOrderAmount} each for business ${getBusinessData(getPlayerData(client).businessOrderBusiness).name} (Reason: Not enough money in business till)`);
|
||||
showPlayerErrorGUI(client, "This business doesn't have enough money! Deposit some using /bizdeposit", "Business Order Canceled");
|
||||
getPlayerData(client).businessOrderAmount = 0;
|
||||
getPlayerData(client).businessOrderBusiness = false;
|
||||
getPlayerData(client).businessOrderItem = -1;
|
||||
getPlayerData(client).businessOrderValue = -1;
|
||||
} else {
|
||||
logToConsole(LOG_DEBUG, `[VRR.GUI] ${getPlayerDisplayForConsole(client)} successfully ordered ${getPlayerData(client).businessOrderAmount} ${getItemTypeData(getPlayerData(client).businessOrderItem).name} at ${getPlayerData(client).businessOrderCost/getPlayerData(client).businessOrderAmount} each for business ${getBusinessData(getPlayerData(client).businessOrderBusiness).name}`);
|
||||
showPlayerInfoGUI(client, `You ordered ${getPlayerData(client).businessOrderAmount} ${getItemTypeData(getPlayerData(client).businessOrderItem).name} (${getItemValueDisplay(getPlayerData(client).businessOrderItem, getPlayerData(client).businessOrderValue)}) for ${getPlayerData(client).businessOrderCost}!`, "Business Order Successful");
|
||||
createItem(getPlayerData(client).businessOrderItem, getPlayerData(client).businessOrderValue, VRR_ITEM_OWNER_BIZFLOOR, getBusinessData(getPlayerData(client).businessOrderBusiness).databaseId, getPlayerData(client).businessOrderAmount);
|
||||
cacheBusinessItems(getPlayerData(client).businessOrderBusiness);
|
||||
getBusinessData(getPlayerData(client).businessOrderBusiness).till -= getPlayerData(client).businessOrderCost;
|
||||
updateBusinessPickupLabelData(getPlayerData(client).businessOrderBusiness);
|
||||
getPlayerData(client).businessOrderAmount = 0;
|
||||
getPlayerData(client).businessOrderBusiness = false;
|
||||
getPlayerData(client).businessOrderItem = -1;
|
||||
getPlayerData(client).businessOrderValue = -1;
|
||||
case VRR_PROMPT_BIZORDER:
|
||||
if(getPlayerData(client).businessOrderAmount > 0) {
|
||||
if(getBusinessData(getPlayerData(client).businessOrderBusiness).till < getPlayerData(client).businessOrderCost) {
|
||||
logToConsole(LOG_DEBUG, `[VRR.GUI] ${getPlayerDisplayForConsole(client)} failed to order ${getPlayerData(client).businessOrderAmount} ${getItemTypeData(getPlayerData(client).businessOrderItem).name} at ${getPlayerData(client).businessOrderCost/getPlayerData(client).businessOrderAmount} each for business ${getBusinessData(getPlayerData(client).businessOrderBusiness).name} (Reason: Not enough money in business till)`);
|
||||
showPlayerErrorGUI(client, "This business doesn't have enough money! Deposit some using /bizdeposit", "Business Order Canceled");
|
||||
getPlayerData(client).businessOrderAmount = 0;
|
||||
getPlayerData(client).businessOrderBusiness = false;
|
||||
getPlayerData(client).businessOrderItem = -1;
|
||||
getPlayerData(client).businessOrderValue = -1;
|
||||
} else {
|
||||
logToConsole(LOG_DEBUG, `[VRR.GUI] ${getPlayerDisplayForConsole(client)} successfully ordered ${getPlayerData(client).businessOrderAmount} ${getItemTypeData(getPlayerData(client).businessOrderItem).name} at ${getPlayerData(client).businessOrderCost/getPlayerData(client).businessOrderAmount} each for business ${getBusinessData(getPlayerData(client).businessOrderBusiness).name}`);
|
||||
showPlayerInfoGUI(client, `You ordered ${getPlayerData(client).businessOrderAmount} ${getItemTypeData(getPlayerData(client).businessOrderItem).name} (${getItemValueDisplay(getPlayerData(client).businessOrderItem, getPlayerData(client).businessOrderValue)}) for ${getPlayerData(client).businessOrderCost}!`, "Business Order Successful");
|
||||
createItem(getPlayerData(client).businessOrderItem, getPlayerData(client).businessOrderValue, VRR_ITEM_OWNER_BIZFLOOR, getBusinessData(getPlayerData(client).businessOrderBusiness).databaseId, getPlayerData(client).businessOrderAmount);
|
||||
cacheBusinessItems(getPlayerData(client).businessOrderBusiness);
|
||||
getBusinessData(getPlayerData(client).businessOrderBusiness).till -= getPlayerData(client).businessOrderCost;
|
||||
updateBusinessPickupLabelData(getPlayerData(client).businessOrderBusiness);
|
||||
getPlayerData(client).businessOrderAmount = 0;
|
||||
getPlayerData(client).businessOrderBusiness = false;
|
||||
getPlayerData(client).businessOrderItem = -1;
|
||||
getPlayerData(client).businessOrderValue = -1;
|
||||
|
||||
}
|
||||
} else {
|
||||
showPlayerErrorGUI(client, `You aren't ordering anything for a business!`, `Business Order Canceled`);
|
||||
}
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
showPlayerErrorGUI(client, `You aren't ordering anything for a business!`, `Business Order Canceled`);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
getPlayerData(client).promptType = VRR_PROMPT_NONE;
|
||||
getPlayerData(client).promptType = VRR_PROMPT_NONE;
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
function canPlayerUseGUI(client) {
|
||||
return (doesServerHaveGUIEnabled() && doesPlayerHaveGUIEnabled(client));
|
||||
return (doesServerHaveGUIEnabled() && doesPlayerHaveGUIEnabled(client));
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
function playerPromptAnswerYesCommand(command, params, client) {
|
||||
playerPromptAnswerYes(client);
|
||||
playerPromptAnswerYes(client);
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
function playerPromptAnswerNoCommand(command, params, client) {
|
||||
playerPromptAnswerNo(client);
|
||||
playerPromptAnswerNo(client);
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
function playerToggledGUI(client) {
|
||||
toggleAccountGUICommand("gui", "", client);
|
||||
toggleAccountGUICommand("gui", "", client);
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
function showPlayerChangePasswordGUI(client) {
|
||||
sendNetworkEventToPlayer("vrr.changePassword", client);
|
||||
sendNetworkEventToPlayer("vrr.changePassword", client);
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
function showPlayerTwoFactorAuthenticationGUI(client) {
|
||||
sendNetworkEventToPlayer("vrr.2fa", client);
|
||||
sendNetworkEventToPlayer("vrr.2fa", client);
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
Reference in New Issue
Block a user