adding vend script and car replaces

This commit is contained in:
KingMcDonalds
2025-07-16 23:43:57 -07:00
parent d9faa25c78
commit 05775cc099
219 changed files with 9475 additions and 5 deletions
@@ -0,0 +1,72 @@
End User License Agreement
THIS END USER LICENSE AGREEMENT (the "Agreement")
BETWEEN:
Big Daddy Scripts (a division of I CAN MAKE THAT, LLC)
(the "Vendor")
OF THE FIRST PART
- AND -
Purchaser of Big Daddy Scripts resource
(the "Licensee")
OF THE SECOND PART
BACKGROUND:
The Vendor wishes to license computer software to the Licensee and the Licensee desires to purchase the software license under the terms and conditions stated below.
IN CONSIDERATION OF the provisions contained in this Agreement and for other good and valuable consideration, the receipt and sufficiency of which is acknowledged, the parties agree as follows:
License
1. Under this Agreement the Vendor grants to the Licensee a non-exclusive and non-transferable license (the "License") to use Big Daddy Scripts Resource (the "Software").
2. "Software" includes the executable computer programs and any related printed, electronic and online documentation and any other files that may accompany the product.
3. Title, copyright, intellectual property rights and distribution rights of the Software remain exclusively with the Vendor. Intellectual property rights include the look and feel of the Software. This Agreement constitutes a license for use only and is not in any way a transfer of ownership rights to the Software.
4. The Software may be loaded onto no more than one computer. A single copy may be made for backup purposes only.
5. The rights and obligations of this Agreement are personal rights granted to the Licensee only. The Licensee may not transfer or assign any of the rights or obligations granted under this Agreement to any other person or legal entity. The Licensee may not make available the Software for use by one or more third parties.
6. The Software may not be modified, reverse-engineered, or de-compiled in any manner through current or future available technologies.
7. Failure to comply with any of the terms under the License section will be considered a material breach of this Agreement.
License Fee
8. The purchase price paid by the Licensee will constitute the entire license fee and is the full consideration for this Agreement.
Limitation of Liability
9. The Software is provided by the Vendor and accepted by the Licensee "as is". Liability of the Vendor will be limited to a maximum of the original purchase price of the Software. The Vendor will not be liable for any general, special, incidental or consequential damages including, but not limited to, loss of production, loss of profits, loss of revenue, loss of data, or any other business or economic disadvantage suffered by the Licensee arising out of the use or failure to use the Software.
10. The Vendor makes no warranty expressed or implied regarding the fitness of the Software for a particular purpose or that the Software will be suitable or appropriate for the specific requirements of the Licensee.
11. The Vendor does not warrant that use of the Software will be uninterrupted or error-free. The Licensee accepts that software in general is prone to bugs and flaws within an acceptable level as determined in the industry.
Warrants and Representations
12. The Vendor warrants and represents that it is the copyright holder of the Software. The Vendor warrants and represents that granting the license to use this Software is not in violation of any other agreement, copyright or applicable statute.
Acceptance
13. All terms, conditions and obligations of this Agreement will be deemed to be accepted by the Licensee ("Acceptance") upon the purchse of the software.
User Support
14. The Licensee will be entitled to support within Big Daddy Scripts Discord available most days, at no additional cost.
15. The Licensee will be entitled to maintenance upgrades and bug fixes, at no additional cost, forever.
Term
16. The term of this Agreement will begin on purchase of the software and is perpetual.
Termination
17. This Agreement will be terminated and the License forfeited without the chance of a refund where the Licensee has failed to comply with any of the terms of this Agreement or is in breach of this Agreement. On termination of this Agreement for any reason, the Licensee will promptly destroy the Software or return the Software to the Vendor.
Force Majeure
18. The Vendor will be free of liability to the Licensee where the Vendor is prevented from executing its obligations under this Agreement in whole or in part due to Force Majeure, such as earthquake, typhoon, flood, fire, and war or any other unforeseen and uncontrollable event where the Vendor has taken any and all appropriate action to mitigate such an event.
Additional Clauses
19. You may not share any prop, texture, code, imagery, or any pieces that come with this resource. Failure to comply with this will result in the license being revoked without refund.
Governing Law
20. The Parties to this Agreement submit to the jurisdiction of the courts of the State of West Virginia for the enforcement of this Agreement or any arbitration award or decision arising from this Agreement. This Agreement will be enforced or construed according to the laws of the State of West Virginia.
Miscellaneous
21. This Agreement can only be modified in writing and can be modified at any time without warning or notice, although attempt to provide notice will be made.
22. This Agreement does not create or imply any relationship in agency or partnership between the Vendor and the Licensee.
23. Headings are inserted for the convenience of the parties only and are not to be considered when interpreting this Agreement. Words in the singular mean and include the plural and vice versa. Words in the masculine gender include the feminine gender and vice versa. Words in the neuter gender include the masculine gender and the feminine gender and vice versa.
24. If any term, covenant, condition or provision of this Agreement is held by a court of competent jurisdiction to be invalid, void or unenforceable, it is the parties' intent that such provision be reduced in scope by the court only to the extent deemed necessary by that court to render the provision reasonable and enforceable and the remainder of the provisions of this Agreement will in no way be affected, impaired or invalidated as a result.
25. This Agreement contains the entire agreement between the parties. All understandings have been included in this Agreement. Representations which may have been made by any party to this Agreement may in some way be inconsistent with this final written Agreement. All such statements are declared to be of no value in this Agreement. Only the written terms of this Agreement will bind the parties.
26. This Agreement and the terms and conditions contained in this Agreement apply to and are binding upon the Vendor's successors and assigns.
@@ -0,0 +1,114 @@
// If you change anything below you will probably break the script. This is not meant to be a configurable file due to the complexity of the data
[
{
"model": "prop_vend_coffe_01",
"type": "coffee",
"gives": "bzzz_bigdaddy_prop_coffee,bzzz_bigdaddy_prop_mocha,bzzz_bigdaddy_prop_late,bzzz_bigdaddy_prop_espresso,bzzz_bigdaddy_prop_chocolate",
"givesFriendly": "beanmachine-coffee,beanmachine-mocha,beanmachine-latte,beanmachine-espresso,beanmachine-hotchocolage",
"givesOffset": "0.12,0,-0.04,-82.0,19.0,-16",
"givesBoneIndex": 57005,
"givesAnimDict": "amb@world_human_drinking@coffee@male@idle_a",
"givesAnim": "idle_a",
"prices": "1.50"
},
{
"model": "prop_vend_soda_02",
"type": "soda",
"gives": "bzzz_bigdaddy_prop_cola,bzzz_bigdaddy_prop_zero,bzzz_bigdaddy_prop_sprunk,bzzz_bigdaddy_prop_sprunk,bzzz_bigdaddy_prop_orange,bzzz_bigdaddy_prop_coldtea,bzzz_bigdaddy_prop_miranda",
"givesFriendly": "eCola,ecolazero,Sprunk,sprunkdiet,orang-o-tang,coldtea,miranda",
"givesOffset": "0.14,0.02,-0.03,-75,-31,-53",
"givesBoneIndex": 57005,
"givesAnimDict": "amb@world_human_drinking@coffee@male@base",
"givesAnim": "base",
"prices": "1.00"
},
{
"model": "prop_vend_soda_01",
"type": "soda",
"gives": "bzzz_bigdaddy_prop_cola,bzzz_bigdaddy_prop_zero,bzzz_bigdaddy_prop_sprunk,bzzz_bigdaddy_prop_sprunk,bzzz_bigdaddy_prop_orange,bzzz_bigdaddy_prop_coldtea,bzzz_bigdaddy_prop_miranda",
"givesFriendly": "eCola,ecolazero,Sprunk,sprunkdiet,orang-o-tang,coldtea,miranda",
"givesOffset": "0.14,0.02,-0.03,-75,-31,-53",
"givesBoneIndex": 57005,
"givesAnimDict": "amb@world_human_drinking@coffee@male@base",
"givesAnim": "base",
"prices": "1.00"
},
{
"model": "prop_vend_fridge01",
"type": "fridge",
"gives": "ng_proc_sodabot_01a",
"givesFriendly": "eCola",
"givesOffset": "0.11,-0.06,-0.06,25.0,83.0,74.0",
"givesBoneIndex": 57005,
"givesAnimDict": "amb@world_human_drinking@coffee@male@idle_a",
"givesAnim": "idle_a",
"prices": "2.00"
},
{
"model": "prop_vend_snak_01",
"type": "snack",
"gives": "bzzz_bigdaddy_prop_chips_d,bzzz_bigdaddy_prop_chips_b,bzzz_bigdaddy_prop_chips_f,bzzz_bigdaddy_prop_chips_a,bzzz_bigdaddy_prop_chips_e,bzzz_bigdaddy_prop_chips_c,bzzz_bigdaddy_prop_candybox,bzzz_bigdaddy_prop_cbbrown,bzzz_bigdaddy_prop_cbgreen,bzzz_bigdaddy_prop_cbred,bzzz_bigdaddy_prop_cbyellow,bzzz_bigdaddy_prop_captains,bzzz_bigdaddy_prop_meteorite,bzzz_bigdaddy_prop_nothings,bzzz_bigdaddy_prop_relblue,bzzz_bigdaddy_prop_relgreen,bzzz_bigdaddy_prop_relpink,bzzz_bigdaddy_prop_zebrabar",
"givesFriendly": "phatchips_bigcheese,phatchips_saltsauce,phatchips_stickyribs,phatchips_supersalt,phatchips_crinkle,phatchips_crinklehabanero,ps&qs,candybox_brown,candybox_green,candybox_red,candybox_yellow,captainslog,meteorite,sweetnothings,release_blue,release_green,release_pink,zebrabar",
"givesOffset": "0.14,-0.04,0.04,59.0,93.0,58.0",
"givesBoneIndex": 18905,
"givesAnimDict": "mp_player_inteat@pnq",
"givesAnim": "loop",
"prices": "1.00,1.00,1.00,1.00,1.00,1.00,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.75"
},
{
"model": "prop_vend_snak_01_tu",
"type": "snack",
"gives": "bzzz_bigdaddy_prop_chips_d,bzzz_bigdaddy_prop_chips_b,bzzz_bigdaddy_prop_chips_f,bzzz_bigdaddy_prop_chips_a,bzzz_bigdaddy_prop_chips_e,bzzz_bigdaddy_prop_chips_c,bzzz_bigdaddy_prop_candybox,bzzz_bigdaddy_prop_cbbrown,bzzz_bigdaddy_prop_cbgreen,bzzz_bigdaddy_prop_cbred,bzzz_bigdaddy_prop_cbyellow,bzzz_bigdaddy_prop_captains,bzzz_bigdaddy_prop_meteorite,bzzz_bigdaddy_prop_nothings,bzzz_bigdaddy_prop_relblue,bzzz_bigdaddy_prop_relgreen,bzzz_bigdaddy_prop_relpink,bzzz_bigdaddy_prop_zebrabar",
"givesFriendly": "phatchips_bigcheese,phatchips_saltsauce,phatchips_stickyribs,phatchips_supersalt,phatchips_crinkle,phatchips_crinklehabanero,ps&qs,candybox_brown,candybox_green,candybox_red,candybox_yellow,captainslog,meteorite,sweetnothings,release_blue,release_green,release_pink,zebrabar",
"givesOffset": "0.14,-0.04,0.04,59.0,93.0,58.0",
"givesBoneIndex": 18905,
"givesAnimDict": "mp_player_inteat@pnq",
"givesAnim": "loop",
"prices": "1.00,1.00,1.00,1.00,1.00,1.00,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.75"
},
{
"model": "prop_bar_beerfridge_01",
"type": "fridge",
"gives": "prop_beer_bar,prop_beer_blr,prop_beer_jakey,prop_beer_logger,prop_beer_patriot,prop_beer_pissh,prop_beer_pride,prop_beer_stz,prop_beerdusche",
"givesFriendly": "Just Beer,Blue,Jakey,Logger,Patriot,Pisswasser,Pride,Stz,Dusche",
"givesOffset": "0.11,-0.06,-0.06,25.0,83.0,74.0",
"givesBoneIndex": 57005,
"givesAnimDict": "amb@world_human_drinking@coffee@female@idle_a",
"givesAnim": "idle_a",
"prices": "4.00"
},
{
"model": "prop_vend_fags_01",
"type": "cigarette",
"gives": "v_ret_ml_cigs,v_ret_ml_cigs2,v_ret_ml_cigs4,v_ret_ml_cigs5,v_ret_ml_cigs6,prop_cigar_pack_01",
"givesFriendly": "cig_redwood,cig_redwoodgold,cig_debonaire,cig_cardiaque,cig_69,cig_estancia",
"givesOffset": "0.13,0.03,0.0,-61,0,0",
"givesBoneIndex": 57005,
"givesAnimDict": "amb@code_human_wander_texting@male@exit",
"givesAnim": "exit",
"prices": "7.50,7.50,8.00,7.50,6.50,8.00"
},
{
"model": "sf_prop_sf_vend_drink_01a",
"type": "soda",
"gives": "bzzz_bigdaddy_prop_energy_blueberry,bzzz_bigdaddy_prop_energy_kiwi,bzzz_bigdaddy_prop_energy_orange,bzzz_bigdaddy_prop_energy_raspberry",
"givesFriendly": "junk_blueberry,junk_kiwi,junk_orange,junk_raspberry",
"givesOffset": "0.14,0.02,-0.03,-75,-31,-53",
"givesBoneIndex": 57005,
"givesAnimDict": "amb@world_human_drinking@coffee@male@base",
"givesAnim": "base",
"prices": "1.00"
},
{
"model": "prop_vend_water_01",
"type": "soda",
"gives": "bzzz_bigdaddy_prop_water_slightly,bzzz_bigdaddy_prop_water_sparkling,bzzz_bigdaddy_prop_water_still",
"givesFriendly": "raine_sligtly,raine_sparkling,raine_still",
"givesOffset": "0.11,-0.07,-0.04,-75,-2,-14",
"givesBoneIndex": 57005,
"givesAnimDict": "amb@world_human_drinking@coffee@male@base",
"givesAnim": "base",
"prices": "2.00"
},
]
@@ -0,0 +1,30 @@
fx_version 'bodacious'
game 'gta5'
author 'Big Daddy'
version '1.2'
description 'Interact with Vending Machines'
client_scripts {
'*Client.net.dll',
'settings.ini',
'Newtonsoft.Json.dll',
'Vending.json'
}
server_scripts {
'*Server.net.dll',
'Newtonsoft.Json.dll',
'server.lua',
'settings.ini'
}
ui_page 'nui/ui.html'
files {
'nui/ui.html',
'settings.ini',
'nui/sounds/*.ogg',
'nui/*.png'
}
data_file 'DLC_ITYP_REQUEST' 'stream/bzzz_bigdaddy_prop_vending_machines.ytyp'
Binary file not shown.
@@ -0,0 +1,77 @@
<?xpacket begin="" id="W5M0MpCehiHzreSzNTczkc9d"?>
<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="Adobe XMP Core 7.1-c000 79.b0f8be9, 2021/12/08-19:11:22 ">
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<rdf:Description rdf:about=""
xmlns:xmpDM="http://ns.adobe.com/xmp/1.0/DynamicMedia/"
xmlns:xmp="http://ns.adobe.com/xap/1.0/"
xmlns:xmpMM="http://ns.adobe.com/xap/1.0/mm/"
xmlns:stEvt="http://ns.adobe.com/xap/1.0/sType/ResourceEvent#"
xmlns:dc="http://purl.org/dc/elements/1.1/">
<xmpDM:Tracks>
<rdf:Bag>
<rdf:li rdf:parseType="Resource">
<xmpDM:trackName>CuePoint Markers</xmpDM:trackName>
<xmpDM:trackType>Cue</xmpDM:trackType>
<xmpDM:frameRate>f48000</xmpDM:frameRate>
</rdf:li>
<rdf:li rdf:parseType="Resource">
<xmpDM:trackName>CD Track Markers</xmpDM:trackName>
<xmpDM:trackType>Track</xmpDM:trackType>
<xmpDM:frameRate>f48000</xmpDM:frameRate>
</rdf:li>
<rdf:li rdf:parseType="Resource">
<xmpDM:trackName>Subclip Markers</xmpDM:trackName>
<xmpDM:trackType>InOut</xmpDM:trackType>
<xmpDM:frameRate>f48000</xmpDM:frameRate>
</rdf:li>
</rdf:Bag>
</xmpDM:Tracks>
<xmp:MetadataDate>2023-06-26T16:31:26-04:00</xmp:MetadataDate>
<xmp:ModifyDate>2023-06-26T16:31:26-04:00</xmp:ModifyDate>
<xmpMM:InstanceID>xmp.iid:33789077-9455-e445-b7a0-1a879f2d5b4f</xmpMM:InstanceID>
<xmpMM:DocumentID>xmp.did:abfd5969-b80e-b54a-9630-b3e9d78c5365</xmpMM:DocumentID>
<xmpMM:OriginalDocumentID>xmp.did:abfd5969-b80e-b54a-9630-b3e9d78c5365</xmpMM:OriginalDocumentID>
<xmpMM:History>
<rdf:Seq>
<rdf:li rdf:parseType="Resource">
<stEvt:action>saved</stEvt:action>
<stEvt:instanceID>xmp.iid:abfd5969-b80e-b54a-9630-b3e9d78c5365</stEvt:instanceID>
<stEvt:when>2023-06-26T16:31:26-04:00</stEvt:when>
<stEvt:softwareAgent>Adobe Audition 23.5 (Windows)</stEvt:softwareAgent>
<stEvt:changed>/metadata</stEvt:changed>
</rdf:li>
<rdf:li rdf:parseType="Resource">
<stEvt:action>saved</stEvt:action>
<stEvt:instanceID>xmp.iid:33789077-9455-e445-b7a0-1a879f2d5b4f</stEvt:instanceID>
<stEvt:when>2023-06-26T16:31:26-04:00</stEvt:when>
<stEvt:softwareAgent>Adobe Audition 23.5 (Windows)</stEvt:softwareAgent>
<stEvt:changed>/</stEvt:changed>
</rdf:li>
</rdf:Seq>
</xmpMM:History>
<dc:format>audio/ogg; codec="vorbis"</dc:format>
</rdf:Description>
</rdf:RDF>
</x:xmpmeta>
<?xpacket end="w"?>
Binary file not shown.
Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

@@ -0,0 +1,202 @@
<html>
<head>
<script src="nui://game/ui/jquery.js" type="text/javascript"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/howler/2.1.1/howler.min.js" type="text/javascript"></script>
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
</head>
<body style="background-color: rgba(0, 0, 0, 0);display: block; margin: 0; padding: 0;">
<style>
.ui {
width: 100%;
height: 100%;
background: rgba(0,0,0,.5);
display: none;
text-align: center;
margin: 0;
padding: 0;
}
.ui-inner {
width: 310px;
margin: 0 auto 0;
top: 100px;
position: relative;
}
.ui-wide {
width:620px;
}
.vbtn {
width: 310px;
height: 90px;
cursor: pointer;
}
.col {
float:left;
}
</style>
<div class="ui">
<div class="ui-inner"></div>
</div>
<script>
var isVisible = false;
var audioPlayer = null;
var SoundPlayer = null;
var distance = 9999999;
var maxVolume = 0;
var radius = 0;
window.addEventListener('message', function (event) {
if (event.data.action == "sendSound") {
distance = 9999999;
maxVolume = 0;
radius = 0;
if (SoundPlayer != null) {
SoundPlayer.pause();
}
if (event.data.submissionFile == "") { //if not file sent, just return it's probably just as a stop sound call
return;
}
SoundPlayer = new Howl({
src: ["./sounds/" + event.data.submissionFile + ".ogg"],
loop: event.data.loop
});
distance = event.data.distance;
maxVolume = event.data.maxVolume;
radius = event.data.radius;
SoundPlayer.volume(calcDistanceVolume());
SoundPlayer.play();
}
else if (event.data.action == "updateDistance") {
distance = event.data.distance;
SoundPlayer.volume(calcDistanceVolume());
}
else if (event.data.action === "PlaySound") {
if (event.data.value === '') {
if (audioPlayer != null) {
audioPlayer.pause();
audioPlayer = null;
}
} else {
try {
audioPlayer = new Howl({
src: [event.data.value + ".ogg"],
loop: false
});
audioPlayer.volume(0.5);
audioPlayer.play();
} catch (err) {
}
}
}
if (event.data.action === "OpenNui") {
$('.ui-inner').html("");
var s = event.data.value.split(',');
if (s.length > 7) {
$('.ui-inner').addClass('ui-wide');
for (i = 0; i < s.length; i++) {
if (s[i] != '' && imageExists(s[i].toLowerCase() + '.png')) {
var t = $('#vbtn_template2').html();
t = t.replace('{{image}}', s[i].toLowerCase());
t = t.replace('{{item}}', s[i]);
$(".ui-inner").append(t);
if ((i+1) % 2 == 0) {
$(".ui-inner").append('</br>');
}
}
}
} else {
for (i = 0; i < s.length; i++) {
if (s[i] != '' && imageExists(s[i].toLowerCase() + '.png')) {
var t = $('#vbtn_template').html();
t = t.replace('{{image}}', s[i].toLowerCase());
t = t.replace('{{item}}', s[i]);
$(".ui-inner").append(t);
}
}
}
$('.ui').show();
isVisible = true;
}
});
function Choose(t) {
fetch(`https://${GetParentResourceName()}/SelectionMade`, {
method: 'POST',
headers: {
'Content-Type': 'application/json; charset=UTF-8',
},
body: JSON.stringify({
index: $(t).attr('data-item')
})
});
$('.ui').hide();
}
jQuery(function ($) {
var input = $('body');
input.on('keydown', function () {
var key = event.keyCode || event.charCode;
if (key == 8) { //backspace
if (isVisible) {
$('.ui').fadeOut();
isVisible = false;
fetch(`https://${GetParentResourceName()}/SelectionMade`, {
method: 'POST',
headers: {
'Content-Type': 'application/json; charset=UTF-8',
},
body: JSON.stringify({
index: ''
})
});
}
return false;
}
});
});
function imageExists(image_url) {
var http = new XMLHttpRequest();
http.open('HEAD', image_url, false);
http.send();
return http.status != 404;
}
function calcDistanceVolume() {
//$('#debug').html('distance: ' + distance + " radius: " + radius + " maxVolume: " + maxVolume);
if (distance > radius) {
return 0;
} else {
return maxVolume * ((radius - distance) / radius);
}
}
</script>
<script type="text/html" id="vbtn_template">
<div class="vbtn"><img src="{{image}}.png" data-item="{{item}}" onclick="Choose(this)" /></div>
</script>
<script type="text/html" id="vbtn_template2">
<div class="vbtn col"><img src="{{image}}.png" data-item="{{item}}" onclick="Choose(this)" /></div>
</script>
</body>
</html>
Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

@@ -0,0 +1,87 @@
framework = 'bigdaddy' --VALUES CAN BE 'nat', 'qb', 'esx', 'nd', 'bigdaddy' or 'custom'
reason = 'Vending Machine' --reason for the transaction will notify using framework methods
useSociety = false
toSocietyaccount = ''
local currencySymbol = '$'
if framework == 'nat' then
print('Framework set to nat')
elseif framework == 'qb' then
QBCore = exports['qb-core']:GetCoreObject()
elseif framework == 'esx' then
ESX = exports["es_extended"]:getSharedObject()
elseif framework == 'nd' then
NDCore = exports.ND_Core:GetCoreObject()
elseif framework == 'bigdaddy' then
print('Framework set to Big Daddy')
elseif framework == 'custom' then
print('LOAD CORE OBJECT HERE IF REQUIRED, if not then you may disregard this statement.')
else
print('FRAMEWORK IS NOT SET PROPERLY FOR RESOURCE! Check server.lua in ' .. GetCurrentResourceName() .. ' for money events. The current value is set to ' .. framework .. ', and this is not a valid selection.' )
end
RegisterNetEvent('BigDaddy-VendingMachines:Pay', function(amount, playerId)
local src = source
if framework == 'nat' then
local account = exports.money:getaccount(src)
if (tonumber(account.bank) >= tonumber(amount)) then
local newbalance = tonumber(account.cash) - tonumber(amount)
exports.money:updateaccount(src, {cash = newbalance, bank = account.bank})
exports.money:bankNotify(src, reason .. ' ' .. currencySymbol .. amount )
TriggerClientEvent('BigDaddy-VendingMachines:IsPaid', src, true)
else
TriggerClientEvent('BigDaddy-VendingMachines:IsPaid', src, false)
end
elseif framework == 'qb' then
local Player = QBCore.Functions.GetPlayer(src)
if (Player.Functions.GetMoney('cash') >= tonumber(amount)) then
Player.Functions.RemoveMoney('cash', tonumber(amount), reason)
if (useSociety) then
exports['qb-management']:AddMoney(toSocietyaccount, tonumber(amount))
end
TriggerClientEvent('QBCore:Notify', src, reason, 'primary', 5000)
TriggerClientEvent('BigDaddy-VendingMachines:IsPaid', src, true)
else
TriggerClientEvent('BigDaddy-VendingMachines:IsPaid', src, false)
end
elseif framework == 'esx' then
local xPlayer = ESX.GetPlayerFromId(src)
local account = xPlayer.getAccount('cash')
if (account.money >= tonumber(amount)) then
xPlayer.removeAccountMoney('cash', tonumber(amount))
xPlayer.showNotification(reason)
TriggerClientEvent('BigDaddy-VendingMachines:IsPaid', src, true)
else
TriggerClientEvent('BigDaddy-VendingMachines:IsPaid', src, false)
end
elseif framework == 'nd' then
local Player = NDCore:getPlayer(src)
if (Player.cash >= amount) then
Player.DeductMoney('cash', amount, reason)
TriggerClientEvent('BigDaddy-VendingMachines:IsPaid', src, true)
else
TriggerClientEvent('BigDaddy-VendingMachines:IsPaid', src, false)
end
elseif framework == 'bigdaddy' then
local account = exports['BigDaddy-Money']:GetAccounts(src, playerId, -1)
local data = json.decode(account)
if (tonumber(data.cash) >= tonumber(amount)) then
local newbalance = tonumber(data.cash) - tonumber(amount)
exports['BigDaddy-Money']:UpdateTotals(src, data.bank, newbalance, data.dirty, -1)
TriggerClientEvent("BigDaddy-Money:Notify", src, 'Paid ' .. currencySymbol .. string.format("%.2f", amount) .. ' in cash ' .. reason)
TriggerClientEvent('BigDaddy-VendingMachines:IsPaid', src, true)
else
TriggerClientEvent('BigDaddy-VendingMachines:IsPaid', src, false)
end
elseif framework == 'custom' then
--INSERT CUSTOM CODE HERE FOR CASH MANAGEMENT
else
print('FRAMEWORK IS NOT SET PROPERLY FOR RESOURCE! Check server.lua in ' .. GetCurrentResourceName() .. ' for money events. The current value is set to ' .. framework .. ', and this is not a valid selection.' )
end
end)
@@ -0,0 +1,17 @@
[licensing]
key1=pyqo129MJhQB9jFhFGFpeafMxFaynZjcGwlEyhYPz9Bl8v0j66LKVw%3d%3d
[settings]
useMoney=true
showPrompts=true
[keys]
;please see documenation on what these do and how to set them
actionKey=38
[locales]
outOfOrder=Out of order
;leave the $ in place or you will break the script
presToUse=Press $ to use Vending Machine
noMoney=You do not have enough money to purchase
jammed=The Machine Jammed
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<CPackFileMetaData>
<MapDataGroups/>
<HDTxdBindingArray/>
<imapDependencies/>
<imapDependencies_2>
<Item>
<imapName>vendingmachines</imapName>
<manifestFlags/>
<itypDepArray>
<Item>v_coin_op</Item>
<Item>sf_prop_sf_interior</Item>
</itypDepArray>
</Item>
</imapDependencies_2>
<itypDependencies_2/>
<Interiors/>
</CPackFileMetaData>

Some files were not shown because too many files have changed in this diff Show More