From fea06e0ecc47a3b1fe8b4aef48ef3ab0c517bb49 Mon Sep 17 00:00:00 2001 From: bitpredator <67551273+bitpredator@users.noreply.github.com> Date: Tue, 6 Aug 2024 10:09:42 +0200 Subject: [PATCH 01/13] =?UTF-8?q?chore:=20=F0=9F=8E=A8=20Run=20formatter?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/[bpt_addons]/bpt_hunting/client/main.lua | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/server-data/resources/[bpt_addons]/bpt_hunting/client/main.lua b/server-data/resources/[bpt_addons]/bpt_hunting/client/main.lua index 08e3d09db..5c5d0c160 100644 --- a/server-data/resources/[bpt_addons]/bpt_hunting/client/main.lua +++ b/server-data/resources/[bpt_addons]/bpt_hunting/client/main.lua @@ -99,12 +99,7 @@ end) local oldped = {} function CanSlaughterPed(ped) if - not IsPedAPlayer(ped) - and not IsPedInAnyVehicle(ped, false) - and not IsPedHuman(ped) - and IsEntityDead(ped) - and ped ~= oldped - and GetEntityModel(ped) == GetHashKey("a_c_boar") + not IsPedAPlayer(ped) and not IsPedInAnyVehicle(ped, false) and not IsPedHuman(ped) and IsEntityDead(ped) and ped ~= oldped and GetEntityModel(ped) == GetHashKey("a_c_boar") or GetEntityModel(ped) == GetHashKey("a_c_coyote") or GetEntityModel(ped) == GetHashKey("a_c_deer") or GetEntityModel(ped) == GetHashKey("a_c_mtlion") From 9a32433fc8ce61f0a20109798b73c887eb969924 Mon Sep 17 00:00:00 2001 From: bitpredator <67551273+bitpredator@users.noreply.github.com> Date: Tue, 6 Aug 2024 10:22:30 +0200 Subject: [PATCH 02/13] refactor: Improved code style respecting ESLint rules --- .../[esx]/esx_notify/nui/js/script.js | 92 +++++++++---------- 1 file changed, 46 insertions(+), 46 deletions(-) diff --git a/server-data/resources/[esx]/esx_notify/nui/js/script.js b/server-data/resources/[esx]/esx_notify/nui/js/script.js index a21fde57d..6cf1b97e2 100644 --- a/server-data/resources/[esx]/esx_notify/nui/js/script.js +++ b/server-data/resources/[esx]/esx_notify/nui/js/script.js @@ -2,73 +2,73 @@ const w = window; // Gets the current icon it needs to use. const types = { - ["success"]: { - ["icon"]: "check_circle", - }, - ["error"]: { - ["icon"]: "error", - }, - ["info"]: { - ["icon"]: "info", - }, + ['success']: { + ['icon']: 'check_circle', + }, + ['error']: { + ['icon']: 'error', + }, + ['info']: { + ['icon']: 'info', + }, }; // the color codes example `i ~r~love~s~ donuts` const codes = { - "~r~": "red", - "~b~": "#378cbf", - "~g~": "green", - "~y~": "yellow", - "~p~": "purple", - "~c~": "grey", - "~m~": "#212121", - "~u~": "black", - "~o~": "orange", + '~r~': 'red', + '~b~': '#378cbf', + '~g~': 'green', + '~y~': 'yellow', + '~p~': 'purple', + '~c~': 'grey', + '~m~': '#212121', + '~u~': 'black', + '~o~': 'orange', }; -w.addEventListener("message", (event) => { - notification({ - type: event.data.type, - message: event.data.message, - length: event.data.length, - }); +w.addEventListener('message', (event) => { + notification({ + type: event.data.type, + message: event.data.message, + length: event.data.length, + }); }); const replaceColors = (str, obj) => { - let strToReplace = str; + let strToReplace = str; - for (let id in obj) { - strToReplace = strToReplace.replace(new RegExp(id, "g"), obj[id]); - } + for (const id in obj) { + strToReplace = strToReplace.replace(new RegExp(id, 'g'), obj[id]); + } - return strToReplace; + return strToReplace; }; notification = (data) => { - for (color in codes) { - if (data["message"].includes(color)) { - let objArr = {}; - objArr[color] = ``; - objArr["~s~"] = ""; + for (color in codes) { + if (data['message'].includes(color)) { + const objArr = {}; + objArr[color] = ``; + objArr['~s~'] = ''; - let newStr = replaceColors(data["message"], objArr); + const newStr = replaceColors(data['message'], objArr); - data["message"] = newStr; - } - } + data['message'] = newStr; + } + } - const notification = $(` + const notification = $(`
${data["message"]}
+ ${types[data.type]['icon']} +${data['message']}
|n#NY{Ew2>CPLQ5hn< zMB}N-`ZKz6(P?DQ(x}ITK zhyD|T;qW-1s_WNS>yCW~1SFIM?>$l}gb+AuN#t1MQWWKoqAWvsxk!ZYj$;>A&$;K$ zoIc_`s5C_?`Mk=|X|~8S7z{^bX@*o1??bO})?uursx^Cd?x50!{;(iT6y7;%Q-xq? zjj1)-XoP@9mQa*6WgUXmYB#y<<{RjbN}Trr-N#_~IP%tYE$X`b4=>4pIPb#Ck0@Hi zrY!)W!UL#CRR?C((jN{21s>~`Hu?uw*Ux=vb#+Z7NrF-eftc`7N=mxz7DY9pKNylG zNt~7)#zd^44Mscm?q1}?nH4q$1u9W^XECP6XpPo^yE4`wyeAPb7?sqOrY>uyr=~b| z_z>&8A H kCK785Nt#k=jTd30> @ zNS6L^L|tpjvSRPPz3f=pL4Q~xl|Xof^%}fH%0Rt4Z*k7kOtX(JEiAmnTKks^49EPE zwH8O%@z#fORMr*Eyn(ekG+`@3Bagkr88^u&k4FkMlc)ZZYrW;0%CaVpyWWTC7~!Fj z=SbnWu(Cq4(LhLr_n~oHV=&gDjir${Xf!hJ|MCg)JPAA68jLkqYa*!_N>rXHbgdbc zfg;hh=D=0^nVO!VH!Ony6$&v@C=f*AQsBI0y4892{QUfn3lF2R_{*EJq?CdFj-pU_ zsS>>3qBy+6y8!4WxWYN45Qs=oBue3&OLy& pD@^LZGBqHhOoyUt16c=UB zQr9%I2G(e#k~r%oS)vk!sSVcZ!%GWOk1lVllc _r>6g2yWRdd;eDX+g&<4*LQD>!>5ef%$cC-HG4?$XRXHWc zSrY!-jYnQ7CQ>TiBcvov)jRg@+x6(EtjLm#L?zD)z7&FPr%h1|DC>$W3z^{&0b@ie zB#gC-oH@73@zWQ`vjl}B5gz9(-UlwqSxc5D%ye6 +%){ Qs3QK`=VfVMv k9wEGxYC z+ RN9xLqpi?bvQ 2)bFJPV>FFM zgQ^Z$@@+3!?RFQHq%m8=%kkblkM6rz8Jp1J<0kCKo~VEevLvOhYotoR`>EYK7w>Cz zJ3m^CD)KB3qS6>;cu%v@B+nG*m(L-kKq(b83hx3n9!r!IlHH37eCEC{(P(63X+oAt z^2Ei=2vodOf<~S&)o!u2IixHrMn#2C3CFIzhKC (BAs&~<9)FI?3~~6 zrcS4Gudx>63__?$SvA&1JCOhO2E=<$qtPVKTd{fjiBZ7fQIR9s`ub33g_IFv$XFp9 zDpDAs&se0AEH2J{dbPiK`(QXkB}rgw$NZp_bUPiq)vT|t&}cMKDhWS3%B FJ?SM$ z6o=Sq*pvA@Ht(3m7t5Msdrqp CGv2DmW7oSHwd(FWENh0M_LI|v}q*;QFK^t$VG2{HFFgXNn$=VX{ z>KCxqI9jb1S=N|jgA`+<8KIVYcQIQs5r#Yjs>FwhE0KykOa8|zF5ml=_04{gXE{ld zBIFj2<-BKcW`>Q8H8y)ak|dqbE84~~rGtldVSbLyjR6mQ fYocLBl1a70zs^oIqVPKTN944-}QtE7>6_RdAU#73umoFF}C_wCtztMkr=XY$c? zpCY2NC`1shq!3hfO{39xu>sjSCLm&y)%C^;W{FY>?e-KR>J~(iD6q5QB2FhZ4HtIj zcmxh*%F%8$ez? )Q%E6^N=<650MayJVQz-!&YZ-WfH9O*ksu8C!e~QTRqWfd z#PO$3^MyyBAZw%~3YwWjDT$CElVE&Em126T!^%dF&Hj+Gs2Pq*78mB}wx@XP_-XPi znM{g49$Bz4E8^fXx^n+zM+IuxSO;;696wi@q+tMv=sk#=?xL#kO#%{#JP~#0@bauJ z@XowomNc7f(j<>#ut!NXv12MBaNce4SGWl-@v#I=Pqp7&dvo{lT2F?|Pyxxum1Zfk zQ(exSd5$!JG;JWI!Z}YJGo#jqQBkrqKhKAM|MPtD@h8brMJ5G}Ora7P8n+ZEJc$&v zni(r=8x)167*-Ue=Guc-&`29Rb@Dt(68e&h4cmE#vw>&xK$c}+x#60t+liEGLNFQA z$1mF$8)ab;dWn>A;*wN#{o(@RJdp|?J2*u2H1%IFsnRs1)#?N`Fw!A%T$bYDn6LLD z1qAKdSMJ+&zZd)+U0d=ji>~l6g?aC3 3|&hZmpLrOuK<|q|7F>L}#SQ~?Nj{W=g z@_T=HA45H)-E5F1l4c`8sqieRlqdmtmNGZfWiTulRhptK7!(!P9=w7lpE}Q1pFYi) zqqXB;*g!^(Gh?dT`RIYm_8qHqjS@k3aW1d{D2Z^9X^1pQt#t&w3K pbh7XI+rv*&Ib4oiZLkp$;?EOm~^gOFEAl^@;s-RcW}`GB4SgwxIaOs zSZ5dJrW)suKX>Xj5Tt23Q3%JFWbf{sJpR?k_{690CC$@7mBihtwZ@uo5-F96cB9R| z`Nj96ohDU+X0Aw5g;W8Arb;3O Wkd9C zxyguYjAeFa`Zo{m-}gFej8Tc2G;lR07kzN8h(v*N6A&v^g4P;A$Pyu6tjR%y5O^Q3 zgukdMJKdX%s+a0L%~mI5NlbWoQKKJQI$MqG`}gdeUB0lsIp541BuR#lYGQ=8*0Ez@ zo_inoW7al$tgfx|?AZ+xrGkE;Eyg&CvSMax3Txr+-})%iGcEEgq0vZ56N!>cP`6Z) zJWolbVtKtsQHSPT8_R2NyO}?_|8X{Z!|}l#To`QvUP4Tmgv&46`>&2(ec wS;~1YCLfWk0!p@1B2XY|v(WBrKCO0p~H!qT(RpqRCDug_z(J ziBhqbJP(_Fvw#3Xis%G)(dV?qVjA6>jK!DYx7zI~RHT-D>?Ot++O6zg^hbmLxU#w~ zT6v2!&5%hF>6G9e+_|{GfByB~WMyRqV=SX#!Qrb9V4dZW$4_9brL1ZyZRoUfo_P8c zN#vxmOa+Bec$5kmlBEgVPK%<{EU#@+j4DQ>3hxEiUvr4hJn&^2&FmtaGX}$ce2^Gz z4EuKP{^^ 32=aZe#?!vr$A#Fvf3Tz8Fv@ZkLcHNs>;ish5Hg$)y7lYN#L__1em; z&{LePv9>_U>;*>P7FpJ$81*7GAv*^z-}#YK7gk?otfkp#p<*CJG&wXHIh*|vKmVWJ z%l!N_V$-3GL&$_qr^T*a3q1bx8TRd7z!=ZWRGYcE8QQHb>l>S-i9o85jaiZe^qpih zvV{I%#9&l1EGx>QW@@U#m3#K^$ G!4Slc#IVy217 _aiPoMl+9p(G6{#5+r?Y@plv0uR^5j`U9VO^y-uM=fdaQk61P*{Eu*w1 Au}_pZ&^H&%CNEOEQ&`q-mf{WFQ(B=Vn=7@A1J8eT2E$4n}L%H~Vb% z`kcS8!b6Wd!O7DXSYO}Z@uyDHY-CJNb!cW8d7g3EWqS}pkV-)#O^_1uJY%}sq^>mm zVZo>@84e4kraMfxrufh&?nkJY0)9&__LE&5rlgy%yY7yKh528VQihj4#tzX7=A7S} zB&9? `RQj$qOGG5jg3=hKWZ>iL+a{#Mu((^d-|S&?#Mp z!~R?|)sH>+mB*L5?KXLuBgW`EzJP;QT*f^QJjDGEeUWxMM{AAN;nD(KR|w}=U0Y*i zZIk|} W$*4K_V3-nHCJ81>9glal8C~kWNx~{%6gw+Q8FrOhQpGn znQ0Um_dfI(t#%{y0ddi+KN-m_h@`y!*wI%{Pj??EtC~ihlVush;Rx^Ztv(yembI27 zOQ_2Vr+k28mI z2BQ%hE35R@m-*;(&v5^}pX1=6t9j#_-^fkJ4zX|761|NTq>wZl8RssnQ) 3gk $d$rLi?d;asw6>J15qbRk_2bJ#p4Kqz=nD+CcY?R!$y))V$6snGk}QyZCG1f zWi%QEQ*lwh9~!T4#{Y AYlg#;veMjm^bn^{ zt@G&dXC@lFACsqEOypyLEX}z6)|>Zv!6_jnR)_wejU~wxS(Y&x6(JxO`Ny1dSnEi# z1YOrSDFb#Bp_iyQW!YFkUT9r9L*iW^ 6RFb+jWLXmLOo_f->qxT%d|(nXrEp_@ z%ejfm<{P?mzLAG&oF&m}@F(dMA+TmhRh_5XwKUs~yy;n7=(4adO{0}DKR^GJC;R_& zUB}WE9(G}_OA^&X>$bG_vZxu2O3JFnSVzCNiK*+5;vRPFSmdXE^6xMhj`;H9PXLxQ z3RC@2$)Knhjw-6U=6i0tk%zzXG@HZTV9t|q z6QpT^jpd<{Wx-^9(K~Y11!JA_v1z->fuV27E_F#dU0y^6#;=luD O-Z_4Pq*WdYQPQGU-q?LQ6Rjdu50ovVfU^jybO(QJP6cP&2Usv)|y79 z@TSCBgG>}i$yHbF=V$)WPauS1FdWj(Gx9tIDJUw OH HC1t)RPTttq3eb2utlnp@ ?Q|+yZam?5P3a~ynU3M-lee}qY z!*8jz#=DwEG}T#WkzSD{2}NB`w2(AQDT@l1CZtJ1Rn;+2a)LYltm}mXA_T_SKoyUh zyA(JlP~M`X!a5U0CLhg-Tk7B3?Cc+W?316m(;7>brbrP4Auw1gn4g`c*=$jaMj)QS z15@oB?+jICfslna-f%saU$!fl9GoRhTH$bw)>N*hs5MosIePWgT()NqzwoOcpflC_ zle%>bN^LAk2^JT2{?2vR9sTc}wUf)voO3ktoT4mHDj|*RvoR)=usA6hYspj+`dY*o z->#Lsu$C?+8pb$B!XCJoPPsTs;x|-sCQtI?_uPB`oRDEm44+rV?+5cU( XF9OLT!dq~nONS;ZGQYxI!Foq;mq)Kw@4M#~t%D;Qh zuah-WwoaXgK#Ye>>BFbrv-h%Jx#sGFKVpm}&r-@tZ@u^|qZBfTQ9_WXDMel5(-dbN zS(Z@MCZyV*!%DuHLE6}hxGcfMF_H)u4b<@nvT(GU?KfHLKK9@vUnWb_;Gq&*f6o}h z)dvq!RVAPL+!r}{@)W7^ !fZP7-PrYTvPQtKM2 zR2Xwbu fyZSKfLfS)+mR&}wAin6V0H$DIo} zB2fvq-gq6K`1C`3>T_S9+i6ae#_{PZE|#H%^oI^z`xE;wzwF)G=!hKzS{w2#qppW| zAuvXhr72}q1#A)Z@4u+uL-b9(y)s_@=${7^$8<{gn9V% F50qqbn2qcWCGyTuz``#t1o5@!EMMW~1&oR8KU zJg>Or7{B`7kMhu?Pta)OTbpMb3?DvonEEU?+<4uO&dtvLlCEo%N-*f4QN&9#(?nsM zM{7fpq;c&1i~n^{$qNP{-gF=@^5{;0qVT~&>0P>eaq*WPdGyi0S(GK+ZZ|aWXn<3R zqN-~y+q;j|)eC&`zAw^grqrpVt}1G4an_@2!?g#m @n>3>8&6l_=WH zCN~~Cg23>|<4-d;)ur3%gwswk0T08X Hn&T1m+y9*79W z1^MUP8~*GiE8I&oLF5(_kw_4nQzh^J#AolhZDDGftQq7{r2?Dloo8mc%T#xouYC0> zo_yvcQ|%T~De^3h_8rZr5d05seIwd 4bBHN-R?9w zeDF&C?|=0xtZr `b5}e)tF8%I|*s^PIbIh67jZq0?;eeXqHNPu}}5JLYFuSX{uG5R@~| zF7wO3_WO) z7zuD zw{VD!3XV{UhLks5SX;g4_|qqnx#?-rBqfPsVYqC?uxn|7b~ERR6Q`)El5V$6s#5CM zFfpDiNx16`ujXApe>cZZouS)mk>?E-7d`uS&N0(%@x<|y%*;$ qv1B>M$S1f@EQw0q_~h~9 zAL?!N8VfTsq-jc;gc>d*1%3FMs~8Ro?tAbn$VAX?waC*n97pq>5uTCOTz}*U|LC9o z0xP{uoN*Mxf-gGDjvbrK&rfs3-km)8>}j4kd4^p(7Ra)U-Mf~!?pnj=AACGsli{~6 zt&A^ues<=`*T3#Hhr$hR;b3N`)eNH8cgXM0OfGFD^^;=*Lcnyp^HX1a@@qe<%Zk~V zDY7h|?8xAbx9r)wn-Bi(r|I{596q?0Mzb|JHy+qrOQ)H0{ozCW_)q^EmU|oMvIYby zRjjXXQWO>E&acsEHt3Hu_dWCk?|9o%Y}|0!zMVYt+&P{-w;X61za=uwEzCY~=N-4* z?7bsV3KIph@3eJkZ?AC^MP$0${)Nvy@ZisGZuV$48)RvYRAa-iz-Z0v+$^8|%)Rsm zeI9=FDW 9)E4=+!im1ZQlt;&`TKrq8_U&O2}So+19FUzWc0fJBAM zI`e@K{r(^PSRx#)R)aK6P)YElN+3%WOG``q?jL-b*_jTv9y>sLYMMtLe+Ims=nYw# zu(nq41ApTu+3fe}4+liIalGV9Pb!KHKb#-D>kYRoEiL}yt*>~+4;{Sv$Q$#l^Pbg} z!Sa?)3*R-xKWp-m`D_?g!uY*6-URB%3efg85Ebmn>O%q7rTDCm(*~kt>$wrf9ZW zsMx^AH@9`VEryln$A9MEF+0^JkqL*cOnApzZs$Gk`y`hw%`(3*kMnT+#CiVTfB#;Z zokqNcCkdB>xh |jKtBKQW2Q9jfw`u-Jj+s 4T?WGuMP=9+Rvfu%H@kPva?gX0^L?+q73Ty`+IL?Kmzw-y~w zL}{ZLj7Au1QAu*9uIsyb8Lmqf-8^g3ZneLfH0J-oU|1nUIH5E%JjS%?B=ASU1KPX6L)ydgEb|G!4JCCptZ(R2 QB85B=oY`ubqk&Yd4WeB{_&v(r2O zx;Nr;-+SA2dTDVUV=TAdc Ydx&=yp|T*II(y2~ z{I|<%YwuF2?C#yYz$ vMUUGZ+mybM`## zc5}3Q_tN{MQXi;_ov(l0_bmTZe=vObwp(uaKkBjyY;AOdC@C@DCE4(z1Ck^ubrmjr zY;{^3IeO%mH#Rnx&z(E-qsEl4fAi~ZPoI4HInJG135Z!rB=GjT-td}sD}O+#Bph<_ zj#}5uH|A*M86dQ4w?FzrfAz0?{DFrbw%&S@G{IH&B}(pGM vj2+xK^*eonhIwv2*?}R+Rnz#|EjhAog1&y zfA_gl7yj{y=T1NIgKvBDQ6Uv&Rnl%YDa!(tCI~6GuzZ1Hbj9^?TsgV ze6;2ZDdI8aF!^M8qkr_s(SN>Y&)&QL=$?C4k|d=lOOohmb>7l!wip&8@~p|JGiSJL z@7}*uY4kf~iS3v49WeH8ukC F Date: Tue, 6 Aug 2024 18:36:41 +0200 Subject: [PATCH 11/13] fix: attempt to index a nil value (upvalue 'status') --- .../resources/[bpt_addons]/bpt_basicneeds/client/main.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server-data/resources/[bpt_addons]/bpt_basicneeds/client/main.lua b/server-data/resources/[bpt_addons]/bpt_basicneeds/client/main.lua index 2f59bb3c2..ec0e3d965 100644 --- a/server-data/resources/[bpt_addons]/bpt_basicneeds/client/main.lua +++ b/server-data/resources/[bpt_addons]/bpt_basicneeds/client/main.lua @@ -32,13 +32,13 @@ end) AddEventHandler("bpt_status:loaded", function(status) TriggerEvent("bpt_status:registerStatus", "hunger", 1000000, "#CFAD0F", function(status) return Config.Visible - end, function() + end, function(status) status.remove(100) end) TriggerEvent("bpt_status:registerStatus", "thirst", 1000000, "#0C98F1", function() return Config.Visible - end, function() + end, function(status) status.remove(75) end) end) From 98433a536310af323ce008b932707b2ec4bac0fc Mon Sep 17 00:00:00 2001 From: bitpredator <67551273+bitpredator@users.noreply.github.com> Date: Tue, 6 Aug 2024 19:01:42 +0200 Subject: [PATCH 12/13] =?UTF-8?q?chore:=20=F0=9F=8E=A8=20Run=20formatter?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/[bpt_addons]/bpt_farmer/LICENSE | 2 +- .../bpt_farmer/client/animated.lua | 20 +- .../[bpt_addons]/bpt_farmer/client/main.lua | 374 +++++++++--------- .../[bpt_addons]/bpt_farmer/fxmanifest.lua | 18 +- .../[bpt_addons]/bpt_farmer/locales/en.lua | 4 +- .../[bpt_addons]/bpt_farmer/locales/it.lua | 4 +- .../[bpt_addons]/bpt_farmer/server/main.lua | 80 ++-- 7 files changed, 251 insertions(+), 251 deletions(-) diff --git a/server-data/resources/[bpt_addons]/bpt_farmer/LICENSE b/server-data/resources/[bpt_addons]/bpt_farmer/LICENSE index 6d9577f6a..2f3c94cc9 100644 --- a/server-data/resources/[bpt_addons]/bpt_farmer/LICENSE +++ b/server-data/resources/[bpt_addons]/bpt_farmer/LICENSE @@ -652,7 +652,7 @@ Also add information on how to contact you by electronic and paper mail. If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: - Copyright (C) 2022-2024 bitpredator + bpt_farmer Copyright (C) 2022-2024 bitpredator This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. diff --git a/server-data/resources/[bpt_addons]/bpt_farmer/client/animated.lua b/server-data/resources/[bpt_addons]/bpt_farmer/client/animated.lua index d365f2aa8..49c7f3d29 100644 --- a/server-data/resources/[bpt_addons]/bpt_farmer/client/animated.lua +++ b/server-data/resources/[bpt_addons]/bpt_farmer/client/animated.lua @@ -2,22 +2,22 @@ local playerPed RegisterNetEvent("farmer:freeze") AddEventHandler("farmer:freeze", function() - playerPed = PlayerPedId() - ClearPedTasks(PlayerPedId()) - FreezeEntityPosition(playerPed, true) + playerPed = PlayerPedId() + ClearPedTasks(PlayerPedId()) + FreezeEntityPosition(playerPed, true) end) RegisterNetEvent("farmer:unfreeze") AddEventHandler("farmer:freeze", function() - playerPed = PlayerPedId() - FreezeEntityPosition(playerPed, false) - ClearPedTasks(PlayerPedId()) + playerPed = PlayerPedId() + FreezeEntityPosition(playerPed, false) + ClearPedTasks(PlayerPedId()) end) RegisterNetEvent("farmer:anim") AddEventHandler("farmer:anim", function() - local lib, anim = "amb@prop_human_bum_bin@idle_b", "idle_d" - ESX.Streaming.RequestAnimDict(lib, function() - TaskPlayAnim(PlayerPedId(), lib, anim, 1.0, -3.0, 5000, 0, 0, false, false, false) - end) + local lib, anim = "amb@prop_human_bum_bin@idle_b", "idle_d" + ESX.Streaming.RequestAnimDict(lib, function() + TaskPlayAnim(PlayerPedId(), lib, anim, 1.0, -3.0, 5000, 0, 0, false, false, false) + end) end) diff --git a/server-data/resources/[bpt_addons]/bpt_farmer/client/main.lua b/server-data/resources/[bpt_addons]/bpt_farmer/client/main.lua index 6c9bdfe4d..8cb0b9fa0 100644 --- a/server-data/resources/[bpt_addons]/bpt_farmer/client/main.lua +++ b/server-data/resources/[bpt_addons]/bpt_farmer/client/main.lua @@ -1,79 +1,79 @@ local Keys = { - ["ESC"] = 322, - ["F1"] = 288, - ["F2"] = 289, - ["F3"] = 170, - ["F5"] = 166, - ["F6"] = 167, - ["F7"] = 168, - ["F8"] = 169, - ["F9"] = 56, - ["F10"] = 57, - ["~"] = 243, - ["1"] = 157, - ["2"] = 158, - ["3"] = 160, - ["4"] = 164, - ["5"] = 165, - ["6"] = 159, - ["7"] = 161, - ["8"] = 162, - ["9"] = 163, - ["-"] = 84, - ["="] = 83, - ["BACKSPACE"] = 177, - ["TAB"] = 37, - ["Q"] = 44, - ["W"] = 32, - ["E"] = 38, - ["R"] = 45, - ["T"] = 245, - ["Y"] = 246, - ["U"] = 303, - ["P"] = 199, - ["["] = 39, - ["]"] = 40, - ["ENTER"] = 18, - ["CAPS"] = 137, - ["A"] = 34, - ["S"] = 8, - ["D"] = 9, - ["F"] = 23, - ["G"] = 47, - ["H"] = 74, - ["K"] = 311, - ["L"] = 182, - ["LEFTSHIFT"] = 21, - ["Z"] = 20, - ["X"] = 73, - ["C"] = 26, - ["V"] = 0, - ["B"] = 29, - ["N"] = 249, - ["M"] = 244, - [","] = 82, - ["."] = 81, - ["LEFTCTRL"] = 36, - ["LEFTALT"] = 19, - ["SPACE"] = 22, - ["RIGHTCTRL"] = 70, - ["HOME"] = 213, - ["PAGEUP"] = 10, - ["PAGEDOWN"] = 11, - ["DELETE"] = 178, - ["LEFT"] = 174, - ["RIGHT"] = 175, - ["TOP"] = 27, - ["DOWN"] = 173, - ["NENTER"] = 201, - ["N4"] = 108, - ["N5"] = 60, - ["N6"] = 107, - ["N+"] = 96, - ["N-"] = 97, - ["N7"] = 117, - ["N8"] = 61, - ["N9"] = 118, + ["ESC"] = 322, + ["F1"] = 288, + ["F2"] = 289, + ["F3"] = 170, + ["F5"] = 166, + ["F6"] = 167, + ["F7"] = 168, + ["F8"] = 169, + ["F9"] = 56, + ["F10"] = 57, + ["~"] = 243, + ["1"] = 157, + ["2"] = 158, + ["3"] = 160, + ["4"] = 164, + ["5"] = 165, + ["6"] = 159, + ["7"] = 161, + ["8"] = 162, + ["9"] = 163, + ["-"] = 84, + ["="] = 83, + ["BACKSPACE"] = 177, + ["TAB"] = 37, + ["Q"] = 44, + ["W"] = 32, + ["E"] = 38, + ["R"] = 45, + ["T"] = 245, + ["Y"] = 246, + ["U"] = 303, + ["P"] = 199, + ["["] = 39, + ["]"] = 40, + ["ENTER"] = 18, + ["CAPS"] = 137, + ["A"] = 34, + ["S"] = 8, + ["D"] = 9, + ["F"] = 23, + ["G"] = 47, + ["H"] = 74, + ["K"] = 311, + ["L"] = 182, + ["LEFTSHIFT"] = 21, + ["Z"] = 20, + ["X"] = 73, + ["C"] = 26, + ["V"] = 0, + ["B"] = 29, + ["N"] = 249, + ["M"] = 244, + [","] = 82, + ["."] = 81, + ["LEFTCTRL"] = 36, + ["LEFTALT"] = 19, + ["SPACE"] = 22, + ["RIGHTCTRL"] = 70, + ["HOME"] = 213, + ["PAGEUP"] = 10, + ["PAGEDOWN"] = 11, + ["DELETE"] = 178, + ["LEFT"] = 174, + ["RIGHT"] = 175, + ["TOP"] = 27, + ["DOWN"] = 173, + ["NENTER"] = 201, + ["N4"] = 108, + ["N5"] = 60, + ["N6"] = 107, + ["N+"] = 96, + ["N-"] = 97, + ["N7"] = 117, + ["N8"] = 61, + ["N9"] = 118, } local incollect = false @@ -81,160 +81,160 @@ local incollect = false ESX = exports["es_extended"]:getSharedObject() RegisterNetEvent("esx:playerLoaded") AddEventHandler("esx:playerLoaded", function(xPlayer) - PlayerData = xPlayer + PlayerData = xPlayer end) function DrawText3D(x, y, z, text, scale) - local _, _x, _y = World3dToScreen2d(x, y, z) + local _, _x, _y = World3dToScreen2d(x, y, z) - SetTextScale(scale, scale) - SetTextFont(4) - SetTextProportional(1) - SetTextEntry("STRING") - SetTextCentre(1) - SetTextColour(255, 255, 255, 255) - SetTextOutline() + SetTextScale(scale, scale) + SetTextFont(4) + SetTextProportional(1) + SetTextEntry("STRING") + SetTextCentre(1) + SetTextColour(255, 255, 255, 255) + SetTextOutline() - AddTextComponentString(text) - DrawText(_x, _y) + AddTextComponentString(text) + DrawText(_x, _y) - local factor = (string.len(text)) / 370 - DrawRect(_x, _y + 0.0125, 0.015 + factor, 0.03, 41, 11, 41, 90) + local factor = (string.len(text)) / 370 + DrawRect(_x, _y + 0.0125, 0.015 + factor, 0.03, 41, 11, 41, 90) end -- collection potato CreateThread(function() - while true do - Wait(0) - local coords = GetEntityCoords(PlayerPedId()) - if GetDistanceBetweenCoords(coords, 2233.21, 5081.3, 48.08, true) < 10.0 then - DrawText3D(2233.21, 5081.3, 48.08, TranslateCap("press_collect"), 0.4) - if ESX.GetPlayerData().job.name then - if GetDistanceBetweenCoords(coords, 2233.21, 5081.3, 48.08, true) < 5.0 then - if IsControlJustReleased(0, Keys["E"]) then - if incollect == false then - collectionpotato() - end - end - end - end - end - end + while true do + Wait(0) + local coords = GetEntityCoords(PlayerPedId()) + if GetDistanceBetweenCoords(coords, 2233.21, 5081.3, 48.08, true) < 10.0 then + DrawText3D(2233.21, 5081.3, 48.08, TranslateCap("press_collect"), 0.4) + if ESX.GetPlayerData().job.name then + if GetDistanceBetweenCoords(coords, 2233.21, 5081.3, 48.08, true) < 5.0 then + if IsControlJustReleased(0, Keys["E"]) then + if incollect == false then + collectionpotato() + end + end + end + end + end + end end) -- collection cotton CreateThread(function() - while true do - Wait(0) - local coords = GetEntityCoords(PlayerPedId()) - if GetDistanceBetweenCoords(coords, 1582.035156, 2167.279053, 79.307007, true) < 10.0 then - DrawText3D(1582.035156, 2167.279053, 79.307007, TranslateCap("press_collect"), 0.4) - if ESX.GetPlayerData().job.name then - if GetDistanceBetweenCoords(coords, 1582.035156, 2167.279053, 79.307007, true) < 5.0 then - if IsControlJustReleased(0, Keys["E"]) then - if incollect == false then - collectioncotton() - end - end - end - end - end - end + while true do + Wait(0) + local coords = GetEntityCoords(PlayerPedId()) + if GetDistanceBetweenCoords(coords, 1582.035156, 2167.279053, 79.307007, true) < 10.0 then + DrawText3D(1582.035156, 2167.279053, 79.307007, TranslateCap("press_collect"), 0.4) + if ESX.GetPlayerData().job.name then + if GetDistanceBetweenCoords(coords, 1582.035156, 2167.279053, 79.307007, true) < 5.0 then + if IsControlJustReleased(0, Keys["E"]) then + if incollect == false then + collectioncotton() + end + end + end + end + end + end end) -- collection apple CreateThread(function() - while true do - Wait(0) - local coords = GetEntityCoords(PlayerPedId()) - if GetDistanceBetweenCoords(coords, 2343.850586, 4756.087891, 34.806641, true) < 10.0 then - DrawText3D(2343.850586, 4756.087891, 34.806641, TranslateCap("press_collect"), 0.4) - if ESX.GetPlayerData().job.name then - if GetDistanceBetweenCoords(coords, 2343.850586, 4756.087891, 34.806641, true) < 5.0 then - if IsControlJustReleased(0, Keys["E"]) then - if incollect == false then - collectionapple() - end - end - end - end - end - end + while true do + Wait(0) + local coords = GetEntityCoords(PlayerPedId()) + if GetDistanceBetweenCoords(coords, 2343.850586, 4756.087891, 34.806641, true) < 10.0 then + DrawText3D(2343.850586, 4756.087891, 34.806641, TranslateCap("press_collect"), 0.4) + if ESX.GetPlayerData().job.name then + if GetDistanceBetweenCoords(coords, 2343.850586, 4756.087891, 34.806641, true) < 5.0 then + if IsControlJustReleased(0, Keys["E"]) then + if incollect == false then + collectionapple() + end + end + end + end + end + end end) -- collection grain CreateThread(function() - while true do - Wait(0) - local coords = GetEntityCoords(PlayerPedId()) - if GetDistanceBetweenCoords(coords, 2607.942871, 4399.490234, 40.973633, true) < 10.0 then - DrawText3D(2607.942871, 4399.490234, 40.973633, TranslateCap("press_collect"), 0.4) - if ESX.GetPlayerData().job.name then - if GetDistanceBetweenCoords(coords, 2607.942871, 4399.490234, 40.973633, true) < 5.0 then - if IsControlJustReleased(0, Keys["E"]) then - if incollect == false then - collectiongrain() - end - end - end - end - end - end + while true do + Wait(0) + local coords = GetEntityCoords(PlayerPedId()) + if GetDistanceBetweenCoords(coords, 2607.942871, 4399.490234, 40.973633, true) < 10.0 then + DrawText3D(2607.942871, 4399.490234, 40.973633, TranslateCap("press_collect"), 0.4) + if ESX.GetPlayerData().job.name then + if GetDistanceBetweenCoords(coords, 2607.942871, 4399.490234, 40.973633, true) < 5.0 then + if IsControlJustReleased(0, Keys["E"]) then + if incollect == false then + collectiongrain() + end + end + end + end + end + end end) local blips = { - { title = "Potato harvest", colour = 0, id = 398, x = 2233.21, y = 5081.3, z = 48.08 }, - { title = "Cotton harvesting", colour = 0, id = 398, x = 1582.035156, y = 2167.279053, z = 79.307007 }, - { title = "Apple picking", colour = 0, id = 398, x = 2343.850586, y = 4756.087891, z = 34.806641 }, - { title = "Wheat harvest", colour = 0, id = 398, x = 2607.942871, y = 4399.490234, z = 40.973633 }, + { title = "Potato harvest", colour = 0, id = 398, x = 2233.21, y = 5081.3, z = 48.08 }, + { title = "Cotton harvesting", colour = 0, id = 398, x = 1582.035156, y = 2167.279053, z = 79.307007 }, + { title = "Apple picking", colour = 0, id = 398, x = 2343.850586, y = 4756.087891, z = 34.806641 }, + { title = "Wheat harvest", colour = 0, id = 398, x = 2607.942871, y = 4399.490234, z = 40.973633 }, } CreateThread(function() - for _, info in pairs(blips) do - info.blip = AddBlipForCoord(info.x, info.y, info.z) - SetBlipSprite(info.blip, info.id) - SetBlipDisplay(info.blip, 4) - SetBlipScale(info.blip, 0.85) - SetBlipColour(info.blip, info.colour) - SetBlipAsShortRange(info.blip, true) - BeginTextCommandSetBlipName("STRING") - AddTextComponentString(info.title) - EndTextCommandSetBlipName(info.blip) - end + for _, info in pairs(blips) do + info.blip = AddBlipForCoord(info.x, info.y, info.z) + SetBlipSprite(info.blip, info.id) + SetBlipDisplay(info.blip, 4) + SetBlipScale(info.blip, 0.85) + SetBlipColour(info.blip, info.colour) + SetBlipAsShortRange(info.blip, true) + BeginTextCommandSetBlipName("STRING") + AddTextComponentString(info.title) + EndTextCommandSetBlipName(info.blip) + end end) --potato function collectionpotato() - TriggerServerEvent("farmer:collectionpotato") - exports["esx_notify"]:Notify("info", 3000, TranslateCap("collection_progress")) - incollect = true - Wait(6000) - incollect = false + TriggerServerEvent("farmer:collectionpotato") + exports["esx_notify"]:Notify("info", 3000, TranslateCap("collection_progress")) + incollect = true + Wait(6000) + incollect = false end -- cotton function collectioncotton() - TriggerServerEvent("farmer:collectioncotton") - exports["esx_notify"]:Notify("info", 3000, TranslateCap("collection_progress")) - incollect = true - Wait(6000) - incollect = false + TriggerServerEvent("farmer:collectioncotton") + exports["esx_notify"]:Notify("info", 3000, TranslateCap("collection_progress")) + incollect = true + Wait(6000) + incollect = false end -- apple function collectionapple() - TriggerServerEvent("farmer:collectionapple") - exports["esx_notify"]:Notify("info", 3000, TranslateCap("collection_progress")) - incollect = true - Wait(6000) - incollect = false + TriggerServerEvent("farmer:collectionapple") + exports["esx_notify"]:Notify("info", 3000, TranslateCap("collection_progress")) + incollect = true + Wait(6000) + incollect = false end -- grain function collectiongrain() - TriggerServerEvent("farmer:collectiongrain") - exports["esx_notify"]:Notify("info", 3000, TranslateCap("collection_progress")) - incollect = true - Wait(6000) - incollect = false + TriggerServerEvent("farmer:collectiongrain") + exports["esx_notify"]:Notify("info", 3000, TranslateCap("collection_progress")) + incollect = true + Wait(6000) + incollect = false end diff --git a/server-data/resources/[bpt_addons]/bpt_farmer/fxmanifest.lua b/server-data/resources/[bpt_addons]/bpt_farmer/fxmanifest.lua index 08a257ac6..f2f5469d0 100644 --- a/server-data/resources/[bpt_addons]/bpt_farmer/fxmanifest.lua +++ b/server-data/resources/[bpt_addons]/bpt_farmer/fxmanifest.lua @@ -7,16 +7,16 @@ version("1.0.1") shared_script("@es_extended/imports.lua") client_script({ - "@es_extended/locale.lua", - "client/*.lua", - "locales/*.lua", - "config.lua", + "@es_extended/locale.lua", + "client/*.lua", + "locales/*.lua", + "config.lua", }) server_scripts({ - "@es_extended/locale.lua", - "server/*.lua", - "@oxmysql/lib/MySQL.lua", - "locales/*.lua", - "config.lua", + "@es_extended/locale.lua", + "server/*.lua", + "@oxmysql/lib/MySQL.lua", + "locales/*.lua", + "config.lua", }) diff --git a/server-data/resources/[bpt_addons]/bpt_farmer/locales/en.lua b/server-data/resources/[bpt_addons]/bpt_farmer/locales/en.lua index 8a5f1e8e4..062b01536 100644 --- a/server-data/resources/[bpt_addons]/bpt_farmer/locales/en.lua +++ b/server-data/resources/[bpt_addons]/bpt_farmer/locales/en.lua @@ -1,4 +1,4 @@ Locales["en"] = { - ["press_collect"] = "Press ~b~[E] to collect", - ["collection_progress"] = "Collection in progress", + ["press_collect"] = "Press ~b~[E] to collect", + ["collection_progress"] = "Collection in progress", } diff --git a/server-data/resources/[bpt_addons]/bpt_farmer/locales/it.lua b/server-data/resources/[bpt_addons]/bpt_farmer/locales/it.lua index fe7872122..0cfef6bc2 100644 --- a/server-data/resources/[bpt_addons]/bpt_farmer/locales/it.lua +++ b/server-data/resources/[bpt_addons]/bpt_farmer/locales/it.lua @@ -1,4 +1,4 @@ Locales["en"] = { - ["press_collect"] = "Premi ~b~[E] per raccogliere", - ["collection_progress"] = "Raccolta in corso", + ["press_collect"] = "Premi ~b~[E] per raccogliere", + ["collection_progress"] = "Raccolta in corso", } diff --git a/server-data/resources/[bpt_addons]/bpt_farmer/server/main.lua b/server-data/resources/[bpt_addons]/bpt_farmer/server/main.lua index a69bb1850..8dcb941f6 100644 --- a/server-data/resources/[bpt_addons]/bpt_farmer/server/main.lua +++ b/server-data/resources/[bpt_addons]/bpt_farmer/server/main.lua @@ -3,59 +3,59 @@ ESX = exports["es_extended"]:getSharedObject() -- collection potato RegisterServerEvent("farmer:collectionpotato") AddEventHandler("farmer:collectionpotato", function() - local _source = source - local xPlayer = ESX.GetPlayerFromId(_source) - local potato = xPlayer.getInventoryItem("potato").count - if potato < 50 then - TriggerClientEvent("farmer:anim", _source) - Wait(5000) - local countpotato = math.random(1, 5) - xPlayer.addInventoryItem("potato", countpotato) - TriggerClientEvent("farmer:unfreeze", _source) - end + local _source = source + local xPlayer = ESX.GetPlayerFromId(_source) + local potato = xPlayer.getInventoryItem("potato").count + if potato < 50 then + TriggerClientEvent("farmer:anim", _source) + Wait(5000) + local countpotato = math.random(1, 5) + xPlayer.addInventoryItem("potato", countpotato) + TriggerClientEvent("farmer:unfreeze", _source) + end end) -- collection cotton RegisterServerEvent("farmer:collectioncotton") AddEventHandler("farmer:collectioncotton", function() - local _source = source - local xPlayer = ESX.GetPlayerFromId(_source) - local cotton = xPlayer.getInventoryItem("cotton").count - if cotton < 50 then - TriggerClientEvent("farmer:anim", _source) - Wait(5000) - local countcotton = math.random(1, 5) - xPlayer.addInventoryItem("cotton", countcotton) - TriggerClientEvent("farmer:unfreeze", _source) - end + local _source = source + local xPlayer = ESX.GetPlayerFromId(_source) + local cotton = xPlayer.getInventoryItem("cotton").count + if cotton < 50 then + TriggerClientEvent("farmer:anim", _source) + Wait(5000) + local countcotton = math.random(1, 5) + xPlayer.addInventoryItem("cotton", countcotton) + TriggerClientEvent("farmer:unfreeze", _source) + end end) -- collection apple RegisterServerEvent("farmer:collectionapple") AddEventHandler("farmer:collectionapple", function() - local _source = source - local xPlayer = ESX.GetPlayerFromId(_source) - local apple = xPlayer.getInventoryItem("apple").count - if apple < 50 then - TriggerClientEvent("farmer:anim", _source) - Wait(5000) - local countapple = math.random(1, 5) - xPlayer.addInventoryItem("apple", countapple) - TriggerClientEvent("farmer:unfreeze", _source) - end + local _source = source + local xPlayer = ESX.GetPlayerFromId(_source) + local apple = xPlayer.getInventoryItem("apple").count + if apple < 50 then + TriggerClientEvent("farmer:anim", _source) + Wait(5000) + local countapple = math.random(1, 5) + xPlayer.addInventoryItem("apple", countapple) + TriggerClientEvent("farmer:unfreeze", _source) + end end) -- collection grain RegisterServerEvent("farmer:collectiongrain") AddEventHandler("farmer:collectiongrain", function() - local _source = source - local xPlayer = ESX.GetPlayerFromId(_source) - local grain = xPlayer.getInventoryItem("grain").count - if grain < 50 then - TriggerClientEvent("farmer:anim", _source) - Wait(5000) - local countgrain = math.random(1, 5) - xPlayer.addInventoryItem("grain", countgrain) - TriggerClientEvent("farmer:unfreeze", _source) - end + local _source = source + local xPlayer = ESX.GetPlayerFromId(_source) + local grain = xPlayer.getInventoryItem("grain").count + if grain < 50 then + TriggerClientEvent("farmer:anim", _source) + Wait(5000) + local countgrain = math.random(1, 5) + xPlayer.addInventoryItem("grain", countgrain) + TriggerClientEvent("farmer:unfreeze", _source) + end end) From 59032d82a8e932821cc74070031d7de0eafb2845 Mon Sep 17 00:00:00 2001 From: bitpredator <67551273+bitpredator@users.noreply.github.com> Date: Tue, 6 Aug 2024 19:06:43 +0200 Subject: [PATCH 13/13] =?UTF-8?q?chore:=20=F0=9F=8E=A8=20Run=20formatter?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../[bpt_addons]/bpt_deliveries/LICENSE | 4 +- .../bpt_deliveries/client/main.lua | 1378 +++++++---------- .../[bpt_addons]/bpt_deliveries/config.lua | 316 ++-- .../bpt_deliveries/fxmanifest.lua | 16 +- .../bpt_deliveries/locales/en.lua | 46 +- .../bpt_deliveries/locales/fr.lua | 46 +- .../bpt_deliveries/locales/it.lua | 46 +- .../bpt_deliveries/locales/zh.lua | 46 +- .../bpt_deliveries/server/main.lua | 86 +- 9 files changed, 851 insertions(+), 1133 deletions(-) diff --git a/server-data/resources/[bpt_addons]/bpt_deliveries/LICENSE b/server-data/resources/[bpt_addons]/bpt_deliveries/LICENSE index f288702d2..69faedd06 100644 --- a/server-data/resources/[bpt_addons]/bpt_deliveries/LICENSE +++ b/server-data/resources/[bpt_addons]/bpt_deliveries/LICENSE @@ -632,7 +632,7 @@ state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. - Copyright (C) + Copyright (C) 2024 bitpredator This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -652,7 +652,7 @@ Also add information on how to contact you by electronic and paper mail. If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: - Copyright (C) + bpt_deliveries Copyright (C) 2024 bitpredator This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. diff --git a/server-data/resources/[bpt_addons]/bpt_deliveries/client/main.lua b/server-data/resources/[bpt_addons]/bpt_deliveries/client/main.lua index 4763a1744..e6b59e42e 100644 --- a/server-data/resources/[bpt_addons]/bpt_deliveries/client/main.lua +++ b/server-data/resources/[bpt_addons]/bpt_deliveries/client/main.lua @@ -1,10 +1,10 @@ local Status = { - DELIVERY_INACTIVE = 0, - PLAYER_STARTED_DELIVERY = 1, - PLAYER_REACHED_VEHICLE_POINT = 2, - PLAYER_REMOVED_GOODS_FROM_VEHICLE = 3, - PLAYER_REACHED_DELIVERY_POINT = 4, - PLAYER_RETURNING_TO_BASE = 5, + DELIVERY_INACTIVE = 0, + PLAYER_STARTED_DELIVERY = 1, + PLAYER_REACHED_VEHICLE_POINT = 2, + PLAYER_REMOVED_GOODS_FROM_VEHICLE = 3, + PLAYER_REACHED_DELIVERY_POINT = 4, + PLAYER_RETURNING_TO_BASE = 5, } -- Don't touch this, pls :) @@ -23,925 +23,643 @@ local FinishedJobs = 0 -- Make player look like a worker function LoadWorkPlayerSkin(deliveryType) - local playerPed = PlayerPedId() - - if deliveryType == "scooter" then - if IsPedMale(playerPed) then - for k, v in pairs(Config.OutfitScooter) do - SetPedComponentVariation(playerPed, k, v.drawables, v.texture, 1) - end - else - for k, v in pairs(Config.OutfitScooterF) do - SetPedComponentVariation(playerPed, k, v.drawables, v.texture, 1) - end - end - else - if IsPedMale(playerPed) then - for k, v in pairs(Config.OutfitVan) do - SetPedComponentVariation(playerPed, k, v.drawables, v.texture, 1) - end - else - for k, v in pairs(Config.OutfitVanF) do - SetPedComponentVariation(playerPed, k, v.drawables, v.texture, 1) - end - end - end + local playerPed = PlayerPedId() + + if deliveryType == "scooter" then + if IsPedMale(playerPed) then + for k, v in pairs(Config.OutfitScooter) do + SetPedComponentVariation(playerPed, k, v.drawables, v.texture, 1) + end + else + for k, v in pairs(Config.OutfitScooterF) do + SetPedComponentVariation(playerPed, k, v.drawables, v.texture, 1) + end + end + else + if IsPedMale(playerPed) then + for k, v in pairs(Config.OutfitVan) do + SetPedComponentVariation(playerPed, k, v.drawables, v.texture, 1) + end + else + for k, v in pairs(Config.OutfitVanF) do + SetPedComponentVariation(playerPed, k, v.drawables, v.texture, 1) + end + end + end end -- Load the default player skin (for esx_skin) function LoadDefaultPlayerSkin() - ESX.TriggerServerCallback("esx_skin:getPlayerSkin", function(skin) - TriggerEvent("skinchanger:loadSkin", skin) - end) + ESX.TriggerServerCallback("esx_skin:getPlayerSkin", function(skin) + TriggerEvent("skinchanger:loadSkin", skin) + end) end -- Control the input function HandleInput() - if PlayerJob ~= "delivery" then - return - end - - if CurrentStatus == Status.PLAYER_REMOVED_GOODS_FROM_VEHICLE then - DisableControlAction(0, 21, true) - else - Wait(500) - end + if PlayerJob ~= "delivery" then + return + end + + if CurrentStatus == Status.PLAYER_REMOVED_GOODS_FROM_VEHICLE then + DisableControlAction(0, 21, true) + else + Wait(500) + end end -- Main logic handler function HandleLogic() - if PlayerJob ~= "delivery" then - return - end - - local playerPed = PlayerPedId() - local pCoords = GetEntityCoords(playerPed) - - if CurrentStatus ~= Status.DELIVERY_INACTIVE then - if IsPedDeadOrDying(playerPed, true) then - FinishDelivery(CurrentType, false) - return - elseif GetVehicleEngineHealth(CurrentVehicle) < 20 and CurrentVehicle ~= nil then - FinishDelivery(CurrentType, false) - return - end - - if CurrentStatus == Status.PLAYER_STARTED_DELIVERY then - if not IsPlayerInsideDeliveryVehicle() then - CurrentSubtitle = TranslateCap("get_back_in_vehicle") - else - CurrentSubtitle = nil - end - - if - GetDistanceBetweenCoords( - pCoords.x, - pCoords.y, - pCoords.z, - DeliveryLocation.Item1.x, - DeliveryLocation.Item1.y, - DeliveryLocation.Item1.z, - true - ) < 1.5 - then - CurrentStatus = Status.PLAYER_REACHED_VEHICLE_POINT - CurrentSubtitle = TranslateCap("remove_goods_subtext") - PlaySound(-1, "Menu_Accept", "Phone_SoundSet_Default", false, 0, true) - end - end - - if CurrentStatus == Status.PLAYER_REMOVED_GOODS_FROM_VEHICLE then - if CurrentType == "van" or CurrentType == "truck" then - CurrentSubtitle = TranslateCap("deliver_inside_shop") - if CurrentType == "van" and not IsEntityPlayingAnim(playerPed, "anim@heists@box_carry@", "walk", 3) then - ForceCarryAnimation() - end - end - - if - GetDistanceBetweenCoords( - pCoords.x, - pCoords.y, - pCoords.z, - DeliveryLocation.Item2.x, - DeliveryLocation.Item2.y, - DeliveryLocation.Item2.z, - true - ) < 1.5 - then - TriggerServerEvent("bpt_deliveries:finishDelivery:server", CurrentType) - PlaySound(-1, "Menu_Accept", "Phone_SoundSet_Default", false, 0, true) - FinishedJobs = FinishedJobs + 1 - - ESX.ShowNotification(TranslateCap("finish_job") .. FinishedJobs .. "/" .. #DeliveryRoutes) - - if FinishedJobs >= #DeliveryRoutes then - RemovePlayerProps() - RemoveBlip(CurrentBlip) - DeliveryLocation.Item1 = Config.Base.retveh - DeliveryLocation.Item2 = { x = 0, y = 0, z = 0 } - CurrentBlip = - CreateBlipAt(DeliveryLocation.Item1.x, DeliveryLocation.Item1.y, DeliveryLocation.Item1.z) - CurrentSubtitle = TranslateCap("get_back_to_deliveryhub") - CurrentStatus = Status.PLAYER_RETURNING_TO_BASE - return - else - RemovePlayerProps() - GetNextDeliveryPoint(false) - CurrentStatus = Status.PLAYER_STARTED_DELIVERY - CurrentSubtitle = TranslateCap("drive_next_point") - PlaySound(-1, "Menu_Accept", "Phone_SoundSet_Default", false, 0, true) - end - end - end - Wait(500) - else - Wait(1000) - end + if PlayerJob ~= "delivery" then + return + end + + local playerPed = PlayerPedId() + local pCoords = GetEntityCoords(playerPed) + + if CurrentStatus ~= Status.DELIVERY_INACTIVE then + if IsPedDeadOrDying(playerPed, true) then + FinishDelivery(CurrentType, false) + return + elseif GetVehicleEngineHealth(CurrentVehicle) < 20 and CurrentVehicle ~= nil then + FinishDelivery(CurrentType, false) + return + end + + if CurrentStatus == Status.PLAYER_STARTED_DELIVERY then + if not IsPlayerInsideDeliveryVehicle() then + CurrentSubtitle = TranslateCap("get_back_in_vehicle") + else + CurrentSubtitle = nil + end + + if GetDistanceBetweenCoords(pCoords.x, pCoords.y, pCoords.z, DeliveryLocation.Item1.x, DeliveryLocation.Item1.y, DeliveryLocation.Item1.z, true) < 1.5 then + CurrentStatus = Status.PLAYER_REACHED_VEHICLE_POINT + CurrentSubtitle = TranslateCap("remove_goods_subtext") + PlaySound(-1, "Menu_Accept", "Phone_SoundSet_Default", false, 0, true) + end + end + + if CurrentStatus == Status.PLAYER_REMOVED_GOODS_FROM_VEHICLE then + if CurrentType == "van" or CurrentType == "truck" then + CurrentSubtitle = TranslateCap("deliver_inside_shop") + if CurrentType == "van" and not IsEntityPlayingAnim(playerPed, "anim@heists@box_carry@", "walk", 3) then + ForceCarryAnimation() + end + end + + if GetDistanceBetweenCoords(pCoords.x, pCoords.y, pCoords.z, DeliveryLocation.Item2.x, DeliveryLocation.Item2.y, DeliveryLocation.Item2.z, true) < 1.5 then + TriggerServerEvent("bpt_deliveries:finishDelivery:server", CurrentType) + PlaySound(-1, "Menu_Accept", "Phone_SoundSet_Default", false, 0, true) + FinishedJobs = FinishedJobs + 1 + + ESX.ShowNotification(TranslateCap("finish_job") .. FinishedJobs .. "/" .. #DeliveryRoutes) + + if FinishedJobs >= #DeliveryRoutes then + RemovePlayerProps() + RemoveBlip(CurrentBlip) + DeliveryLocation.Item1 = Config.Base.retveh + DeliveryLocation.Item2 = { x = 0, y = 0, z = 0 } + CurrentBlip = CreateBlipAt(DeliveryLocation.Item1.x, DeliveryLocation.Item1.y, DeliveryLocation.Item1.z) + CurrentSubtitle = TranslateCap("get_back_to_deliveryhub") + CurrentStatus = Status.PLAYER_RETURNING_TO_BASE + return + else + RemovePlayerProps() + GetNextDeliveryPoint(false) + CurrentStatus = Status.PLAYER_STARTED_DELIVERY + CurrentSubtitle = TranslateCap("drive_next_point") + PlaySound(-1, "Menu_Accept", "Phone_SoundSet_Default", false, 0, true) + end + end + end + Wait(500) + else + Wait(1000) + end end -- Handling markers and object status function HandleMarkers() - if PlayerJob ~= "delivery" then - return - end - - local pCoords = GetEntityCoords(PlayerPedId()) - local deleter = Config.Base.deleter - - if CurrentStatus ~= Status.DELIVERY_INACTIVE then - DrawMarker( - 20, - deleter.x, - deleter.y, - deleter.z, - 0, - 0, - 0, - 0, - 180.0, - 0, - 1.5, - 1.5, - 1.5, - 249, - 38, - 114, - 150, - true, - true - ) - if GetDistanceBetweenCoords(pCoords.x, pCoords.y, pCoords.z, deleter.x, deleter.y, deleter.z) < 1.5 then - DisplayHelpText(TranslateCap("end_delivery")) - if IsControlJustReleased(0, 51) then - EndDelivery() - return - end - end - - if CurrentStatus == Status.PLAYER_STARTED_DELIVERY then - if not IsPlayerInsideDeliveryVehicle() and CurrentVehicle ~= nil then - local VehiclePos = GetEntityCoords(CurrentVehicle) - local ArrowHeight = VehiclePos.z - - if CurrentType == "van" then - ArrowHeight = ArrowHeight + 1.0 - elseif CurrentType == "truck" then - ArrowHeight = ArrowHeight + 2.0 - end - - DrawMarker( - 20, - VehiclePos.x, - VehiclePos.y, - ArrowHeight, - 0, - 0, - 0, - 0, - 180.0, - 0, - 0.8, - 0.8, - 0.8, - 102, - 217, - 239, - 150, - true, - true - ) - else - local dl = DeliveryLocation.Item1 - if GetDistanceBetweenCoords(pCoords.x, pCoords.y, pCoords.z, dl.x, dl.y, dl.z, true) < 150 then - DrawMarker( - 20, - dl.x, - dl.y, - dl.z, - 0, - 0, - 0, - 0, - 180.0, - 0, - 1.5, - 1.5, - 1.5, - 102, - 217, - 239, - 150, - true, - true - ) - end - end - end - - if CurrentStatus == Status.PLAYER_REACHED_VEHICLE_POINT then - if not IsPlayerInsideDeliveryVehicle() then - local TrunkPos = GetEntityCoords(CurrentVehicle) - local TrunkForward = GetEntityForwardVector(CurrentVehicle) - local ScaleFactor = 1.0 - local TrunkHeight - - for k, v in pairs(Config.Scales) do - if k == CurrentType then - ScaleFactor = v - end - end - - TrunkPos = TrunkPos - (TrunkForward * ScaleFactor) - TrunkHeight = TrunkPos.z + 0.7 - - local ArrowSize = { x = 0.8, y = 0.8, z = 0.8 } - - if CurrentType == "scooter" then - ArrowSize = { x = 0.15, y = 0.15, z = 0.15 } - end - - DrawMarker( - 20, - TrunkPos.x, - TrunkPos.y, - TrunkHeight, - 0, - 0, - 0, - 180.0, - 0, - 0, - ArrowSize.x, - ArrowSize.y, - ArrowSize.z, - 102, - 217, - 239, - 150, - true, - true - ) - - if - GetDistanceBetweenCoords(pCoords.x, pCoords.y, pCoords.z, TrunkPos.x, TrunkPos.y, TrunkHeight, true) - < 1.0 - then - DisplayHelpText(TranslateCap("remove_goods")) - if IsControlJustReleased(0, 51) then - PlayTrunkAnimation() - GetPlayerPropsForDelivery(CurrentType) - CurrentStatus = Status.PLAYER_REMOVED_GOODS_FROM_VEHICLE - end - end - end - end - - if CurrentStatus == Status.PLAYER_REMOVED_GOODS_FROM_VEHICLE then - local dp = DeliveryLocation.Item2 - DrawMarker(20, dp.x, dp.y, dp.z, 0, 0, 0, 0, 180.0, 0, 1.5, 1.5, 1.5, 102, 217, 239, 150, true, true) - end - - if CurrentStatus == Status.PLAYER_RETURNING_TO_BASE then - local dp = Config.Base.deleter - DrawMarker(20, dp.x, dp.y, dp.z, 0, 0, 0, 0, 180.0, 0, 1.5, 1.5, 1.5, 102, 217, 239, 150, true, true) - end - else - local bCoords = Config.Base.coords - if GetDistanceBetweenCoords(pCoords.x, pCoords.y, pCoords.z, bCoords.x, bCoords.y, bCoords.z, true) < 150.0 then - local ScooterPos = Config.Base.scooter - local VanPos = Config.Base.van - local TruckPos = Config.Base.truck - - DrawMarker( - 37, - ScooterPos.x, - ScooterPos.y, - ScooterPos.z, - 0, - 0, - 0, - 0, - 0, - 0, - 2.5, - 2.5, - 2.5, - 243, - 56, - 56, - 150, - true, - true - ) - DrawMarker(36, VanPos.x, VanPos.y, VanPos.z, 0, 0, 0, 0, 0, 0, 2.5, 2.5, 2.5, 250, 170, 60, 150, true, true) - DrawMarker( - 39, - TruckPos.x, - TruckPos.y, - TruckPos.z, - 0, - 0, - 0, - 0, - 0, - 0, - 2.5, - 2.5, - 2.5, - 230, - 219, - 91, - 150, - true, - true - ) - - local SelectType - - if - GetDistanceBetweenCoords( - pCoords.x, - pCoords.y, - pCoords.z, - ScooterPos.x, - ScooterPos.y, - ScooterPos.z, - true - ) < 1.5 - then - DisplayHelpText(TranslateCap("start_delivery") .. tostring(Config.Safe.scooter)) - SelectType = "scooter" - elseif - GetDistanceBetweenCoords(pCoords.x, pCoords.y, pCoords.z, VanPos.x, VanPos.y, VanPos.z, true) < 1.5 - then - DisplayHelpText(TranslateCap("start_delivery") .. tostring(Config.Safe.van)) - SelectType = "van" - elseif - GetDistanceBetweenCoords(pCoords.x, pCoords.y, pCoords.z, TruckPos.x, TruckPos.y, TruckPos.z, true) - < 1.5 - then - DisplayHelpText(TranslateCap("start_delivery") .. tostring(Config.Safe.truck)) - SelectType = "truck" - else - SelectType = false - end - - if SelectType ~= false then - if IsControlJustReleased(0, 51) then - StartDelivery(SelectType) - PlaySound(-1, "Menu_Accept", "Phone_SoundSet_Default", false, 0, true) - end - end - end - end + if PlayerJob ~= "delivery" then + return + end + + local pCoords = GetEntityCoords(PlayerPedId()) + local deleter = Config.Base.deleter + + if CurrentStatus ~= Status.DELIVERY_INACTIVE then + DrawMarker(20, deleter.x, deleter.y, deleter.z, 0, 0, 0, 0, 180.0, 0, 1.5, 1.5, 1.5, 249, 38, 114, 150, true, true) + if GetDistanceBetweenCoords(pCoords.x, pCoords.y, pCoords.z, deleter.x, deleter.y, deleter.z) < 1.5 then + DisplayHelpText(TranslateCap("end_delivery")) + if IsControlJustReleased(0, 51) then + EndDelivery() + return + end + end + + if CurrentStatus == Status.PLAYER_STARTED_DELIVERY then + if not IsPlayerInsideDeliveryVehicle() and CurrentVehicle ~= nil then + local VehiclePos = GetEntityCoords(CurrentVehicle) + local ArrowHeight = VehiclePos.z + + if CurrentType == "van" then + ArrowHeight = ArrowHeight + 1.0 + elseif CurrentType == "truck" then + ArrowHeight = ArrowHeight + 2.0 + end + + DrawMarker(20, VehiclePos.x, VehiclePos.y, ArrowHeight, 0, 0, 0, 0, 180.0, 0, 0.8, 0.8, 0.8, 102, 217, 239, 150, true, true) + else + local dl = DeliveryLocation.Item1 + if GetDistanceBetweenCoords(pCoords.x, pCoords.y, pCoords.z, dl.x, dl.y, dl.z, true) < 150 then + DrawMarker(20, dl.x, dl.y, dl.z, 0, 0, 0, 0, 180.0, 0, 1.5, 1.5, 1.5, 102, 217, 239, 150, true, true) + end + end + end + + if CurrentStatus == Status.PLAYER_REACHED_VEHICLE_POINT then + if not IsPlayerInsideDeliveryVehicle() then + local TrunkPos = GetEntityCoords(CurrentVehicle) + local TrunkForward = GetEntityForwardVector(CurrentVehicle) + local ScaleFactor = 1.0 + local TrunkHeight + + for k, v in pairs(Config.Scales) do + if k == CurrentType then + ScaleFactor = v + end + end + + TrunkPos = TrunkPos - (TrunkForward * ScaleFactor) + TrunkHeight = TrunkPos.z + 0.7 + + local ArrowSize = { x = 0.8, y = 0.8, z = 0.8 } + + if CurrentType == "scooter" then + ArrowSize = { x = 0.15, y = 0.15, z = 0.15 } + end + + DrawMarker(20, TrunkPos.x, TrunkPos.y, TrunkHeight, 0, 0, 0, 180.0, 0, 0, ArrowSize.x, ArrowSize.y, ArrowSize.z, 102, 217, 239, 150, true, true) + + if GetDistanceBetweenCoords(pCoords.x, pCoords.y, pCoords.z, TrunkPos.x, TrunkPos.y, TrunkHeight, true) < 1.0 then + DisplayHelpText(TranslateCap("remove_goods")) + if IsControlJustReleased(0, 51) then + PlayTrunkAnimation() + GetPlayerPropsForDelivery(CurrentType) + CurrentStatus = Status.PLAYER_REMOVED_GOODS_FROM_VEHICLE + end + end + end + end + + if CurrentStatus == Status.PLAYER_REMOVED_GOODS_FROM_VEHICLE then + local dp = DeliveryLocation.Item2 + DrawMarker(20, dp.x, dp.y, dp.z, 0, 0, 0, 0, 180.0, 0, 1.5, 1.5, 1.5, 102, 217, 239, 150, true, true) + end + + if CurrentStatus == Status.PLAYER_RETURNING_TO_BASE then + local dp = Config.Base.deleter + DrawMarker(20, dp.x, dp.y, dp.z, 0, 0, 0, 0, 180.0, 0, 1.5, 1.5, 1.5, 102, 217, 239, 150, true, true) + end + else + local bCoords = Config.Base.coords + if GetDistanceBetweenCoords(pCoords.x, pCoords.y, pCoords.z, bCoords.x, bCoords.y, bCoords.z, true) < 150.0 then + local ScooterPos = Config.Base.scooter + local VanPos = Config.Base.van + local TruckPos = Config.Base.truck + + DrawMarker(37, ScooterPos.x, ScooterPos.y, ScooterPos.z, 0, 0, 0, 0, 0, 0, 2.5, 2.5, 2.5, 243, 56, 56, 150, true, true) + DrawMarker(36, VanPos.x, VanPos.y, VanPos.z, 0, 0, 0, 0, 0, 0, 2.5, 2.5, 2.5, 250, 170, 60, 150, true, true) + DrawMarker(39, TruckPos.x, TruckPos.y, TruckPos.z, 0, 0, 0, 0, 0, 0, 2.5, 2.5, 2.5, 230, 219, 91, 150, true, true) + + local SelectType + + if GetDistanceBetweenCoords(pCoords.x, pCoords.y, pCoords.z, ScooterPos.x, ScooterPos.y, ScooterPos.z, true) < 1.5 then + DisplayHelpText(TranslateCap("start_delivery") .. tostring(Config.Safe.scooter)) + SelectType = "scooter" + elseif GetDistanceBetweenCoords(pCoords.x, pCoords.y, pCoords.z, VanPos.x, VanPos.y, VanPos.z, true) < 1.5 then + DisplayHelpText(TranslateCap("start_delivery") .. tostring(Config.Safe.van)) + SelectType = "van" + elseif GetDistanceBetweenCoords(pCoords.x, pCoords.y, pCoords.z, TruckPos.x, TruckPos.y, TruckPos.z, true) < 1.5 then + DisplayHelpText(TranslateCap("start_delivery") .. tostring(Config.Safe.truck)) + SelectType = "truck" + else + SelectType = false + end + + if SelectType ~= false then + if IsControlJustReleased(0, 51) then + StartDelivery(SelectType) + PlaySound(-1, "Menu_Accept", "Phone_SoundSet_Default", false, 0, true) + end + end + end + end end -- The trunk animation when the player remove the goods from the vehicle function PlayTrunkAnimation() - CreateThread(function() - if CurrentType == "truck" then - if Config.Models.vehDoor.usingTrunkForTruck then - SetVehicleDoorOpen(CurrentVehicle, 5, false, false) - else - SetVehicleDoorOpen(CurrentVehicle, 2, false, false) - SetVehicleDoorOpen(CurrentVehicle, 3, false, false) - end - elseif CurrentType == "van" then - if Config.Models.vehDoor.usingTrunkForVan then - SetVehicleDoorOpen(CurrentVehicle, 5, false, false) - end - end - Wait(1000) - if CurrentType == "truck" then - if Config.Models.vehDoor.usingTrunkForTruck then - SetVehicleDoorShut(CurrentVehicle, 5, false) - else - SetVehicleDoorShut(CurrentVehicle, 2, false) - SetVehicleDoorShut(CurrentVehicle, 3, false) - end - elseif CurrentType == "van" then - if Config.Models.vehDoor.usingTrunkForVan then - SetVehicleDoorShut(CurrentVehicle, 5, false) - else - SetVehicleDoorShut(CurrentVehicle, 2, false) - SetVehicleDoorShut(CurrentVehicle, 3, false) - end - end - end) + CreateThread(function() + if CurrentType == "truck" then + if Config.Models.vehDoor.usingTrunkForTruck then + SetVehicleDoorOpen(CurrentVehicle, 5, false, false) + else + SetVehicleDoorOpen(CurrentVehicle, 2, false, false) + SetVehicleDoorOpen(CurrentVehicle, 3, false, false) + end + elseif CurrentType == "van" then + if Config.Models.vehDoor.usingTrunkForVan then + SetVehicleDoorOpen(CurrentVehicle, 5, false, false) + end + end + Wait(1000) + if CurrentType == "truck" then + if Config.Models.vehDoor.usingTrunkForTruck then + SetVehicleDoorShut(CurrentVehicle, 5, false) + else + SetVehicleDoorShut(CurrentVehicle, 2, false) + SetVehicleDoorShut(CurrentVehicle, 3, false) + end + elseif CurrentType == "van" then + if Config.Models.vehDoor.usingTrunkForVan then + SetVehicleDoorShut(CurrentVehicle, 5, false) + else + SetVehicleDoorShut(CurrentVehicle, 2, false) + SetVehicleDoorShut(CurrentVehicle, 3, false) + end + end + end) end -- Create a blip for the location function CreateBlipAt(x, y, z) - local tmpBlip = AddBlipForCoord(x, y, z) - SetBlipSprite(tmpBlip, 1) - SetBlipColour(tmpBlip, 66) - SetBlipAsShortRange(tmpBlip, true) - BeginTextCommandSetBlipName("STRING") - AddTextComponentString(TranslateCap("dst_blip")) - SetBlipAsMissionCreatorBlip(tmpBlip, true) - SetBlipRoute(tmpBlip, true) - - return tmpBlip + local tmpBlip = AddBlipForCoord(x, y, z) + SetBlipSprite(tmpBlip, 1) + SetBlipColour(tmpBlip, 66) + SetBlipAsShortRange(tmpBlip, true) + BeginTextCommandSetBlipName("STRING") + AddTextComponentString(TranslateCap("dst_blip")) + SetBlipAsMissionCreatorBlip(tmpBlip, true) + SetBlipRoute(tmpBlip, true) + + return tmpBlip end local blip function blip() - EndTextCommandSetBlipName(blip) + EndTextCommandSetBlipName(blip) end -- Let the player carry something function ForceCarryAnimation() - TaskPlayAnim(PlayerPedId(), "anim@heists@box_carry@", "walk", 8.0, 8.0, -1, 51) + TaskPlayAnim(PlayerPedId(), "anim@heists@box_carry@", "walk", 8.0, 8.0, -1, 51) end -- Tell the server start delivery job function StartDelivery(deliveryType) - TriggerServerEvent("bpt_deliveries:removeSafeMoney:server", deliveryType) + TriggerServerEvent("bpt_deliveries:removeSafeMoney:server", deliveryType) end -- Check is the player in the delivery vehicle function IsPlayerInsideDeliveryVehicle() - if IsPedSittingInAnyVehicle(PlayerPedId()) then - local playerVehicle = GetVehiclePedIsIn(PlayerPedId(), false) - if playerVehicle == CurrentVehicle then - return true - end - end - return false + if IsPedSittingInAnyVehicle(PlayerPedId()) then + local playerVehicle = GetVehiclePedIsIn(PlayerPedId(), false) + if playerVehicle == CurrentVehicle then + return true + end + end + return false end -- Remove all object from the player ped function RemovePlayerProps() - for i = 0, #CurrentAttachments do - DetachEntity(CurrentAttachments[i]) - DeleteEntity(CurrentAttachments[i]) - end - ClearPedTasks(PlayerPedId()) - CurrentAttachments = {} + for i = 0, #CurrentAttachments do + DetachEntity(CurrentAttachments[i]) + DeleteEntity(CurrentAttachments[i]) + end + ClearPedTasks(PlayerPedId()) + CurrentAttachments = {} end -- Spawn an object and attach it to the player function GetPlayerPropsForDelivery(deliveryType) - RequestAnimDict("anim@heists@box_carry@") - while not HasAnimDictLoaded("anim@heists@box_carry@") do - Wait(0) - end - - if deliveryType == "scooter" then - local ModelHash = GetHashKey("prop_paper_bag_01") - local PlayerPed = PlayerPedId() - local PlayerPos = GetEntityCoords(PlayerPed) - - WaitModelLoad(ModelHash) - - local Object = CreateObject(ModelHash, PlayerPos.x, PlayerPos.y, PlayerPos.z, true, true, false) - - AttachEntityToEntity( - Object, - PlayerPed, - GetPedBoneIndex(PlayerPed, 28422), - 0.25, - 0.0, - 0.06, - 65.0, - -130.0, - -65.0, - true, - true, - false, - true, - 0, - true - ) - table.insert(CurrentAttachments, Object) - end - - if deliveryType == "van" then - TaskPlayAnim(PlayerPedId(), "anim@heists@box_carry@", "walk", 8.0, 8.0, -1, 51) - - local Rand = GetRandomFromRange(1, #Config.VanGoodsPropNames) - local ModelHash = GetHashKey(Config.VanGoodsPropNames[Rand]) - - WaitModelLoad(ModelHash) - - local PlayerPed = PlayerPedId() - local PlayerPos = GetOffsetFromEntityInWorldCoords(PlayerPed, 0.0, 0.0, -5.0) - local Object = CreateObject(ModelHash, PlayerPos.x, PlayerPos.y, PlayerPos.z, true, false, false) - - AttachEntityToEntity( - Object, - PlayerPed, - GetPedBoneIndex(PlayerPed, 28422), - 0.0, - 0.0, - -0.55, - 0.0, - 0.0, - 90.0, - true, - false, - false, - true, - 1, - true - ) - table.insert(CurrentAttachments, Object) - end - - if deliveryType == "truck" then - TaskPlayAnim(PlayerPedId(), "anim@heists@box_carry@", "walk", 8.0, 8.0, -1, 51) - - local ModelHash = GetHashKey("prop_sacktruck_02b") - - WaitModelLoad(ModelHash) - - local PlayerPed = PlayerPedId() - local PlayerPos = GetOffsetFromEntityInWorldCoords(PlayerPed, 0.0, 0.0, -5.0) - local Object = CreateObject(ModelHash, PlayerPos.x, PlayerPos.y, PlayerPos.z, true, false, false) - - AttachEntityToEntity( - Object, - PlayerPed, - GetEntityBoneIndexByName(PlayerPed, "SKEL_Pelvis"), - -0.075, - 0.90, - -0.86, - -20.0, - -0.5, - 181.0, - true, - false, - false, - true, - 1, - true - ) - table.insert(CurrentAttachments, Object) - end - - local JobData = (FinishedJobs + 1) / #DeliveryRoutes - - if JobData >= 0.5 and #CurrentVehicleAttachments > 2 then - DetachEntity(CurrentVehicleAttachments[1]) - DeleteEntity(CurrentVehicleAttachments[1]) - table.remove(CurrentVehicleAttachments, 1) - end - if JobData >= 1.0 and #CurrentVehicleAttachments > 1 then - DetachEntity(CurrentVehicleAttachments[1]) - DeleteEntity(CurrentVehicleAttachments[1]) - table.remove(CurrentVehicleAttachments, 1) - end + RequestAnimDict("anim@heists@box_carry@") + while not HasAnimDictLoaded("anim@heists@box_carry@") do + Wait(0) + end + + if deliveryType == "scooter" then + local ModelHash = GetHashKey("prop_paper_bag_01") + local PlayerPed = PlayerPedId() + local PlayerPos = GetEntityCoords(PlayerPed) + + WaitModelLoad(ModelHash) + + local Object = CreateObject(ModelHash, PlayerPos.x, PlayerPos.y, PlayerPos.z, true, true, false) + + AttachEntityToEntity(Object, PlayerPed, GetPedBoneIndex(PlayerPed, 28422), 0.25, 0.0, 0.06, 65.0, -130.0, -65.0, true, true, false, true, 0, true) + table.insert(CurrentAttachments, Object) + end + + if deliveryType == "van" then + TaskPlayAnim(PlayerPedId(), "anim@heists@box_carry@", "walk", 8.0, 8.0, -1, 51) + + local Rand = GetRandomFromRange(1, #Config.VanGoodsPropNames) + local ModelHash = GetHashKey(Config.VanGoodsPropNames[Rand]) + + WaitModelLoad(ModelHash) + + local PlayerPed = PlayerPedId() + local PlayerPos = GetOffsetFromEntityInWorldCoords(PlayerPed, 0.0, 0.0, -5.0) + local Object = CreateObject(ModelHash, PlayerPos.x, PlayerPos.y, PlayerPos.z, true, false, false) + + AttachEntityToEntity(Object, PlayerPed, GetPedBoneIndex(PlayerPed, 28422), 0.0, 0.0, -0.55, 0.0, 0.0, 90.0, true, false, false, true, 1, true) + table.insert(CurrentAttachments, Object) + end + + if deliveryType == "truck" then + TaskPlayAnim(PlayerPedId(), "anim@heists@box_carry@", "walk", 8.0, 8.0, -1, 51) + + local ModelHash = GetHashKey("prop_sacktruck_02b") + + WaitModelLoad(ModelHash) + + local PlayerPed = PlayerPedId() + local PlayerPos = GetOffsetFromEntityInWorldCoords(PlayerPed, 0.0, 0.0, -5.0) + local Object = CreateObject(ModelHash, PlayerPos.x, PlayerPos.y, PlayerPos.z, true, false, false) + + AttachEntityToEntity(Object, PlayerPed, GetEntityBoneIndexByName(PlayerPed, "SKEL_Pelvis"), -0.075, 0.90, -0.86, -20.0, -0.5, 181.0, true, false, false, true, 1, true) + table.insert(CurrentAttachments, Object) + end + + local JobData = (FinishedJobs + 1) / #DeliveryRoutes + + if JobData >= 0.5 and #CurrentVehicleAttachments > 2 then + DetachEntity(CurrentVehicleAttachments[1]) + DeleteEntity(CurrentVehicleAttachments[1]) + table.remove(CurrentVehicleAttachments, 1) + end + if JobData >= 1.0 and #CurrentVehicleAttachments > 1 then + DetachEntity(CurrentVehicleAttachments[1]) + DeleteEntity(CurrentVehicleAttachments[1]) + table.remove(CurrentVehicleAttachments, 1) + end end -- Spawn the scooter, truck or van function SpawnDeliveryVehicle(deliveryType) - local Rnd = GetRandomFromRange(1, #Config.ParkingSpawns) - local SpawnLocation = Config.ParkingSpawns[Rnd] - - if deliveryType == "scooter" then - local ModelHash = GetHashKey(Config.Models.scooter) - WaitModelLoad(ModelHash) - CurrentVehicle = - CreateVehicle(ModelHash, SpawnLocation.x, SpawnLocation.y, SpawnLocation.z, SpawnLocation.h, true, true) - end - - if deliveryType == "truck" then - local ModelHash = GetHashKey(Config.Models.truck) - WaitModelLoad(ModelHash) - CurrentVehicle = - CreateVehicle(ModelHash, SpawnLocation.x, SpawnLocation.y, SpawnLocation.z, SpawnLocation.h, true, true) - SetVehicleLivery(CurrentVehicle, 2) - end - - if deliveryType == "van" then - local ModelHash = GetHashKey(Config.Models.van) - WaitModelLoad(ModelHash) - CurrentVehicle = - CreateVehicle(ModelHash, SpawnLocation.x, SpawnLocation.y, SpawnLocation.z, SpawnLocation.h, true, true) - SetVehicleExtra(CurrentVehicle, 2, false) - SetVehicleLivery(CurrentVehicle, 0) - SetVehicleColours(CurrentVehicle, 0, 0) - end - - DecorSetInt(CurrentVehicle, "Delivery.Rental", Config.DecorCode) - SetVehicleOnGroundProperly(CurrentVehicle) - - if deliveryType == "scooter" then - local ModelHash = GetHashKey("prop_med_bag_01") - WaitModelLoad(ModelHash) - local Object = CreateObject(ModelHash, SpawnLocation.x, SpawnLocation.y, SpawnLocation.z, true, false, false) - AttachEntityToEntity( - Object, - CurrentVehicle, - GetEntityBoneIndexByName(CurrentVehicle, "misc_a"), - 0.0, - -0.55, - 0.45, - 0.0, - 0.0, - 0.0, - true, - true, - false, - true, - 0, - true - ) - table.insert(CurrentVehicleAttachments, Object) - end - - if deliveryType == "van" then - local ModelHash1 = GetHashKey("prop_crate_11e") - local ModelHash2 = GetHashKey("prop_cardbordbox_02a") - WaitModelLoad(ModelHash1) - WaitModelLoad(ModelHash2) - local Object1 = CreateObject(ModelHash1, SpawnLocation.x, SpawnLocation.y, SpawnLocation.z, true, false, false) - local Object2 = CreateObject(ModelHash1, SpawnLocation.x, SpawnLocation.y, SpawnLocation.z, true, false, false) - local Object3 = CreateObject(ModelHash2, SpawnLocation.x, SpawnLocation.y, SpawnLocation.z, true, false, false) - AttachEntityToEntity( - Object1, - CurrentVehicle, - GetEntityBoneIndexByName(CurrentVehicle, "chassic"), - 0.25, - -1.55, - -0.12, - 0.0, - 0.0, - 0.0, - true, - true, - false, - true, - 0, - true - ) - AttachEntityToEntity( - Object2, - CurrentVehicle, - GetEntityBoneIndexByName(CurrentVehicle, "chassic"), - -0.26, - -1.55, - 0.2, - 0.0, - 0.0, - 0.0, - true, - true, - false, - true, - 0, - true - ) - AttachEntityToEntity( - Object3, - CurrentVehicle, - GetEntityBoneIndexByName(CurrentVehicle, "chassic"), - -0.26, - -1.55, - -0.12, - 0.0, - 0.0, - 0.0, - true, - true, - false, - true, - 0, - true - ) - table.insert(CurrentVehicleAttachments, Object1) - table.insert(CurrentVehicleAttachments, Object2) - table.insert(CurrentVehicleAttachments, Object3) - end + local Rnd = GetRandomFromRange(1, #Config.ParkingSpawns) + local SpawnLocation = Config.ParkingSpawns[Rnd] + + if deliveryType == "scooter" then + local ModelHash = GetHashKey(Config.Models.scooter) + WaitModelLoad(ModelHash) + CurrentVehicle = CreateVehicle(ModelHash, SpawnLocation.x, SpawnLocation.y, SpawnLocation.z, SpawnLocation.h, true, true) + end + + if deliveryType == "truck" then + local ModelHash = GetHashKey(Config.Models.truck) + WaitModelLoad(ModelHash) + CurrentVehicle = CreateVehicle(ModelHash, SpawnLocation.x, SpawnLocation.y, SpawnLocation.z, SpawnLocation.h, true, true) + SetVehicleLivery(CurrentVehicle, 2) + end + + if deliveryType == "van" then + local ModelHash = GetHashKey(Config.Models.van) + WaitModelLoad(ModelHash) + CurrentVehicle = CreateVehicle(ModelHash, SpawnLocation.x, SpawnLocation.y, SpawnLocation.z, SpawnLocation.h, true, true) + SetVehicleExtra(CurrentVehicle, 2, false) + SetVehicleLivery(CurrentVehicle, 0) + SetVehicleColours(CurrentVehicle, 0, 0) + end + + DecorSetInt(CurrentVehicle, "Delivery.Rental", Config.DecorCode) + SetVehicleOnGroundProperly(CurrentVehicle) + + if deliveryType == "scooter" then + local ModelHash = GetHashKey("prop_med_bag_01") + WaitModelLoad(ModelHash) + local Object = CreateObject(ModelHash, SpawnLocation.x, SpawnLocation.y, SpawnLocation.z, true, false, false) + AttachEntityToEntity(Object, CurrentVehicle, GetEntityBoneIndexByName(CurrentVehicle, "misc_a"), 0.0, -0.55, 0.45, 0.0, 0.0, 0.0, true, true, false, true, 0, true) + table.insert(CurrentVehicleAttachments, Object) + end + + if deliveryType == "van" then + local ModelHash1 = GetHashKey("prop_crate_11e") + local ModelHash2 = GetHashKey("prop_cardbordbox_02a") + WaitModelLoad(ModelHash1) + WaitModelLoad(ModelHash2) + local Object1 = CreateObject(ModelHash1, SpawnLocation.x, SpawnLocation.y, SpawnLocation.z, true, false, false) + local Object2 = CreateObject(ModelHash1, SpawnLocation.x, SpawnLocation.y, SpawnLocation.z, true, false, false) + local Object3 = CreateObject(ModelHash2, SpawnLocation.x, SpawnLocation.y, SpawnLocation.z, true, false, false) + AttachEntityToEntity(Object1, CurrentVehicle, GetEntityBoneIndexByName(CurrentVehicle, "chassic"), 0.25, -1.55, -0.12, 0.0, 0.0, 0.0, true, true, false, true, 0, true) + AttachEntityToEntity(Object2, CurrentVehicle, GetEntityBoneIndexByName(CurrentVehicle, "chassic"), -0.26, -1.55, 0.2, 0.0, 0.0, 0.0, true, true, false, true, 0, true) + AttachEntityToEntity(Object3, CurrentVehicle, GetEntityBoneIndexByName(CurrentVehicle, "chassic"), -0.26, -1.55, -0.12, 0.0, 0.0, 0.0, true, true, false, true, 0, true) + table.insert(CurrentVehicleAttachments, Object1) + table.insert(CurrentVehicleAttachments, Object2) + table.insert(CurrentVehicleAttachments, Object3) + end end -- Get the next destination function GetNextDeliveryPoint(firstTime) - if CurrentBlip ~= nil then - RemoveBlip(CurrentBlip) - end - - for i = 1, #DeliveryComplete do - if not DeliveryComplete[i] then - if not firstTime then - DeliveryComplete[i] = true - break - end - end - end - - for i = 1, #DeliveryComplete do - if not DeliveryComplete[i] then - CurrentBlip = CreateBlipAt(DeliveryRoutes[i].Item1.x, DeliveryRoutes[i].Item1.y, DeliveryRoutes[i].Item1.z) - DeliveryLocation = DeliveryRoutes[i] - break - end - end + if CurrentBlip ~= nil then + RemoveBlip(CurrentBlip) + end + + for i = 1, #DeliveryComplete do + if not DeliveryComplete[i] then + if not firstTime then + DeliveryComplete[i] = true + break + end + end + end + + for i = 1, #DeliveryComplete do + if not DeliveryComplete[i] then + CurrentBlip = CreateBlipAt(DeliveryRoutes[i].Item1.x, DeliveryRoutes[i].Item1.y, DeliveryRoutes[i].Item1.z) + DeliveryLocation = DeliveryRoutes[i] + break + end + end end -- Create some random destinations function CreateRoute(deliveryType) - local TotalDeliveries = GetRandomFromRange(Config.Deliveries.min, Config.Deliveries.max) - local DeliveryPoints - - if deliveryType == "scooter" then - DeliveryPoints = Config.DeliveryLocationsScooter - elseif deliveryType == "van" then - DeliveryPoints = Config.DeliveryLocationsVan - else - DeliveryPoints = Config.DeliveryLocationsTruck - end - - while #DeliveryRoutes < TotalDeliveries do - Wait(1) - if #DeliveryRoutes < 1 then - PreviousPoint = GetEntityCoords(PlayerPedId()) - else - PreviousPoint = DeliveryRoutes[#DeliveryRoutes].Item1 - end - - local Rnd = GetRandomFromRange(1, #DeliveryPoints) - local NextPoint = DeliveryPoints[Rnd] - local HasPlayerAround = false - - for i = 1, #DeliveryRoutes do - local Distance = GetDistanceBetweenCoords( - NextPoint.Item1.x, - NextPoint.Item1.y, - NextPoint.Item1.z, - DeliveryRoutes[i].x, - DeliveryRoutes[i].y, - DeliveryRoutes[i].z, - true - ) - if Distance < 50 then - HasPlayerAround = true - end - end - - if not HasPlayerAround then - table.insert(DeliveryRoutes, NextPoint) - table.insert(DeliveryComplete, false) - end - end + local TotalDeliveries = GetRandomFromRange(Config.Deliveries.min, Config.Deliveries.max) + local DeliveryPoints + + if deliveryType == "scooter" then + DeliveryPoints = Config.DeliveryLocationsScooter + elseif deliveryType == "van" then + DeliveryPoints = Config.DeliveryLocationsVan + else + DeliveryPoints = Config.DeliveryLocationsTruck + end + + while #DeliveryRoutes < TotalDeliveries do + Wait(1) + if #DeliveryRoutes < 1 then + PreviousPoint = GetEntityCoords(PlayerPedId()) + else + PreviousPoint = DeliveryRoutes[#DeliveryRoutes].Item1 + end + + local Rnd = GetRandomFromRange(1, #DeliveryPoints) + local NextPoint = DeliveryPoints[Rnd] + local HasPlayerAround = false + + for i = 1, #DeliveryRoutes do + local Distance = GetDistanceBetweenCoords(NextPoint.Item1.x, NextPoint.Item1.y, NextPoint.Item1.z, DeliveryRoutes[i].x, DeliveryRoutes[i].y, DeliveryRoutes[i].z, true) + if Distance < 50 then + HasPlayerAround = true + end + end + + if not HasPlayerAround then + table.insert(DeliveryRoutes, NextPoint) + table.insert(DeliveryComplete, false) + end + end end -- End Delivery, is the player finish or failed? function EndDelivery() - local PlayerPed = PlayerPedId() - if not IsPedSittingInAnyVehicle(PlayerPed) or GetVehiclePedIsIn(PlayerPed) ~= CurrentVehicle then - TriggerEvent("MpGameMessage:send", TranslateCap("delivery_end"), TranslateCap("delivery_failed"), 3500, "error") - FinishDelivery(CurrentType, false) - else - TriggerEvent("MpGameMessage:send", TranslateCap("delivery_end"), TranslateCap("delivery_finish"), 3500, "success") - ReturnVehicle(CurrentType) - end + local PlayerPed = PlayerPedId() + if not IsPedSittingInAnyVehicle(PlayerPed) or GetVehiclePedIsIn(PlayerPed) ~= CurrentVehicle then + TriggerEvent("MpGameMessage:send", TranslateCap("delivery_end"), TranslateCap("delivery_failed"), 3500, "error") + FinishDelivery(CurrentType, false) + else + TriggerEvent("MpGameMessage:send", TranslateCap("delivery_end"), TranslateCap("delivery_finish"), 3500, "success") + ReturnVehicle(CurrentType) + end end -- Return the vehicle to system function ReturnVehicle(deliveryType) - SetVehicleAsNoLongerNeeded(CurrentVehicle) - DeleteEntity(CurrentVehicle) - ESX.ShowNotification(TranslateCap("delivery_vehicle_returned")) - FinishDelivery(deliveryType, true) + SetVehicleAsNoLongerNeeded(CurrentVehicle) + DeleteEntity(CurrentVehicle) + ESX.ShowNotification(TranslateCap("delivery_vehicle_returned")) + FinishDelivery(deliveryType, true) end -- When the delivery mission finish function FinishDelivery(deliveryType, safeReturn) - if CurrentVehicle ~= nil then - for i = 0, #CurrentVehicleAttachments do - DetachEntity(CurrentVehicleAttachments[i]) - DeleteEntity(CurrentVehicleAttachments[i]) - end - CurrentVehicleAttachments = {} - DeleteEntity(CurrentVehicle) - end - - CurrentStatus = Status.DELIVERY_INACTIVE - CurrentVehicle = nil - CurrentSubtitle = nil - FinishedJobs = 0 - DeliveryRoutes = {} - DeliveryComplete = {} - DeliveryLocation = {} - - if CurrentBlip ~= nil then - RemoveBlip(CurrentBlip) - end - - CurrentBlip = nil - CurrentType = "" - - TriggerServerEvent("bpt_deliveries:returnSafe:server", deliveryType, safeReturn) - - LoadDefaultPlayerSkin() + if CurrentVehicle ~= nil then + for i = 0, #CurrentVehicleAttachments do + DetachEntity(CurrentVehicleAttachments[i]) + DeleteEntity(CurrentVehicleAttachments[i]) + end + CurrentVehicleAttachments = {} + DeleteEntity(CurrentVehicle) + end + + CurrentStatus = Status.DELIVERY_INACTIVE + CurrentVehicle = nil + CurrentSubtitle = nil + FinishedJobs = 0 + DeliveryRoutes = {} + DeliveryComplete = {} + DeliveryLocation = {} + + if CurrentBlip ~= nil then + RemoveBlip(CurrentBlip) + end + + CurrentBlip = nil + CurrentType = "" + + TriggerServerEvent("bpt_deliveries:returnSafe:server", deliveryType, safeReturn) + + LoadDefaultPlayerSkin() end -- Some helpful functions function DisplayHelpText(text) - SetTextComponentFormat("STRING") - AddTextComponentString(text) - DisplayHelpTextFromStringLabel(0, 0, 1, -1) + SetTextComponentFormat("STRING") + AddTextComponentString(text) + DisplayHelpTextFromStringLabel(0, 0, 1, -1) end function GetRandomFromRange(a, b) - return GetRandomIntInRange(a, b) + return GetRandomIntInRange(a, b) end function WaitModelLoad(name) - RequestModel(name) - while not HasModelLoaded(name) do - Wait(0) - end + RequestModel(name) + while not HasModelLoaded(name) do + Wait(0) + end end function Draw2DTextCenter(x, y, text, scale) - SetTextFont(0) - SetTextProportional(7) - SetTextScale(scale, scale) - SetTextColour(255, 255, 255, 255) - SetTextDropShadow(0, 0, 0, 0, 255) - SetTextDropShadow() - SetTextEdge(4, 0, 0, 0, 255) - SetTextOutline() - SetTextCentre(true) - SetTextEntry("STRING") - AddTextComponentString(text) - DrawText(x, y) + SetTextFont(0) + SetTextProportional(7) + SetTextScale(scale, scale) + SetTextColour(255, 255, 255, 255) + SetTextDropShadow(0, 0, 0, 0, 255) + SetTextDropShadow() + SetTextEdge(4, 0, 0, 0, 255) + SetTextOutline() + SetTextCentre(true) + SetTextEntry("STRING") + AddTextComponentString(text) + DrawText(x, y) end -- Initialize ESX CreateThread(function() - ESX = exports["es_extended"]:getSharedObject() - while ESX.GetPlayerData().job == nil do - Wait(10) - end - ESX.PlayerData = ESX.GetPlayerData() - TriggerServerEvent("bpt_deliveries:getPlayerJob:server") + ESX = exports["es_extended"]:getSharedObject() + while ESX.GetPlayerData().job == nil do + Wait(10) + end + ESX.PlayerData = ESX.GetPlayerData() + TriggerServerEvent("bpt_deliveries:getPlayerJob:server") end) -- Main thread CreateThread(function() - blip = AddBlipForCoord(Config.Base.coords.x, Config.Base.coords.y, Config.Base.coords.z) - SetBlipSprite(blip, 85) - SetBlipColour(blip, 5) - SetBlipAsShortRange(blip, true) - BeginTextCommandSetBlipName("STRING") - AddTextComponentString(TranslateCap("blip_name")) - EndTextCommandSetBlipName(blip) + blip = AddBlipForCoord(Config.Base.coords.x, Config.Base.coords.y, Config.Base.coords.z) + SetBlipSprite(blip, 85) + SetBlipColour(blip, 5) + SetBlipAsShortRange(blip, true) + BeginTextCommandSetBlipName("STRING") + AddTextComponentString(TranslateCap("blip_name")) + EndTextCommandSetBlipName(blip) end) -- The other 4 threads CreateThread(function() - while true do - Wait(0) - HandleInput() - end + while true do + Wait(0) + HandleInput() + end end) CreateThread(function() - while true do - Wait(0) - HandleLogic() - end + while true do + Wait(0) + HandleLogic() + end end) CreateThread(function() - while true do - Wait(0) - HandleMarkers() - end + while true do + Wait(0) + HandleMarkers() + end end) CreateThread(function() - while true do - if CurrentSubtitle ~= nil then - Draw2DTextCenter(0.5, 0.88, CurrentSubtitle, 0.7) - end - Wait(1) - end + while true do + if CurrentSubtitle ~= nil then + Draw2DTextCenter(0.5, 0.88, CurrentSubtitle, 0.7) + end + Wait(1) + end end) -- Register events and handlers @@ -950,22 +668,22 @@ RegisterNetEvent("bpt_deliveries:setPlayerJob:client") RegisterNetEvent("bpt_deliveries:startJob:client") AddEventHandler("esx:setJob", function(job) - PlayerJob = job.name + PlayerJob = job.name end) AddEventHandler("bpt_deliveries:setPlayerJob:client", function(job) - print("Player job: " .. job) - PlayerJob = job + print("Player job: " .. job) + PlayerJob = job end) AddEventHandler("bpt_deliveries:startJob:client", function(deliveryType) - TriggerEvent("MpGameMessage:send", TranslateCap("delivery_start"), TranslateCap("delivery_tips"), 3500, "success") - LoadWorkPlayerSkin(deliveryType) - local ModelHash = GetHashKey("prop_paper_bag_01") - WaitModelLoad(ModelHash) - SpawnDeliveryVehicle(deliveryType) - CreateRoute(deliveryType) - GetNextDeliveryPoint(true) - CurrentType = deliveryType - CurrentStatus = Status.PLAYER_STARTED_DELIVERY + TriggerEvent("MpGameMessage:send", TranslateCap("delivery_start"), TranslateCap("delivery_tips"), 3500, "success") + LoadWorkPlayerSkin(deliveryType) + local ModelHash = GetHashKey("prop_paper_bag_01") + WaitModelLoad(ModelHash) + SpawnDeliveryVehicle(deliveryType) + CreateRoute(deliveryType) + GetNextDeliveryPoint(true) + CurrentType = deliveryType + CurrentStatus = Status.PLAYER_STARTED_DELIVERY end) diff --git a/server-data/resources/[bpt_addons]/bpt_deliveries/config.lua b/server-data/resources/[bpt_addons]/bpt_deliveries/config.lua index a22317d75..e35ee4e3d 100644 --- a/server-data/resources/[bpt_addons]/bpt_deliveries/config.lua +++ b/server-data/resources/[bpt_addons]/bpt_deliveries/config.lua @@ -5,221 +5,221 @@ Config.Locale = "it" -- Delivery Base Location Config.Base = { - -- Blip coords - coords = { x = -314.0, y = -1035.21, z = 30.53 }, - -- Scooter mark - scooter = { x = -319.17, y = -1032.14, z = 30.53 }, - -- Van mark - van = { x = -323.17, y = -1030.63, z = 30.53 }, - -- Truck mark - truck = { x = -326.75, y = -1029.23, z = 30.53 }, - -- Return vehicle mark - retveh = { x = -271.3, y = -1009.66, z = 29.87 }, - -- Delete vehicle mark - deleter = { x = -338.26, y = -1023.18, z = 30.38 }, - -- Heading - heading = 245.0, + -- Blip coords + coords = { x = -314.0, y = -1035.21, z = 30.53 }, + -- Scooter mark + scooter = { x = -319.17, y = -1032.14, z = 30.53 }, + -- Van mark + van = { x = -323.17, y = -1030.63, z = 30.53 }, + -- Truck mark + truck = { x = -326.75, y = -1029.23, z = 30.53 }, + -- Return vehicle mark + retveh = { x = -271.3, y = -1009.66, z = 29.87 }, + -- Delete vehicle mark + deleter = { x = -338.26, y = -1023.18, z = 30.38 }, + -- Heading + heading = 245.0, } Config.DecorCode = 0 -- Min and max deliveries jobs Config.Deliveries = { - min = 5, - max = 7, + min = 5, + max = 7, } -- The salary of jobs Config.Rewards = { - scooter = 800, - van = 1000, - truck = 1500, + scooter = 800, + van = 1000, + truck = 1500, } -- Vehicle model Config.Models = { - scooter = "faggio3", - van = "blista", -- Chinese car Wuling hong guang S1 - truck = "mule", - vehDoor = { - -- If this value is true, it will open the vehicle trunk when player remove the goods from the vehicle. - usingTrunkForVan = true, -- If you using original game vehicle, set this to false - usingTrunkForTruck = false, - }, + scooter = "faggio3", + van = "blista", -- Chinese car Wuling hong guang S1 + truck = "mule", + vehDoor = { + -- If this value is true, it will open the vehicle trunk when player remove the goods from the vehicle. + usingTrunkForVan = true, -- If you using original game vehicle, set this to false + usingTrunkForTruck = false, + }, } -- Scale of the arrow, usually not modified it Config.Scales = { - scooter = 0.6, - van = 3.0, - truck = 4.5, + scooter = 0.6, + van = 3.0, + truck = 4.5, } -- Rental money of the vehicles Config.Safe = { - scooter = 4000, - van = 6000, - truck = 8000, + scooter = 4000, + van = 6000, + truck = 8000, } -- Random parking locations Config.ParkingSpawns = { - { x = -310.50, y = -1011.08, z = 30.39, h = 252.00 }, - { x = -309.35, y = -1008.24, z = 30.39, h = 251.15 }, - { x = -311.53, y = -1013.72, z = 30.39, h = 252.00 }, - { x = -305.17, y = -1013.04, z = 30.39, h = 70.78 }, - { x = -307.33, y = -1002.65, z = 30.39, h = 248.33 }, - { x = -322.99, y = -1000.16, z = 30.39, h = 73.11 }, - { x = -329.65, y = -1004.10, z = 30.39, h = 253.11 }, - { x = -324.65, y = -1006.08, z = 30.39, h = 69.82 }, - { x = -326.87, y = -1011.45, z = 30.39, h = 73.49 }, + { x = -310.50, y = -1011.08, z = 30.39, h = 252.00 }, + { x = -309.35, y = -1008.24, z = 30.39, h = 251.15 }, + { x = -311.53, y = -1013.72, z = 30.39, h = 252.00 }, + { x = -305.17, y = -1013.04, z = 30.39, h = 70.78 }, + { x = -307.33, y = -1002.65, z = 30.39, h = 248.33 }, + { x = -322.99, y = -1000.16, z = 30.39, h = 73.11 }, + { x = -329.65, y = -1004.10, z = 30.39, h = 253.11 }, + { x = -324.65, y = -1006.08, z = 30.39, h = 69.82 }, + { x = -326.87, y = -1011.45, z = 30.39, h = 73.49 }, } -- Random delivery locations of scooter -- Item1 = parking location, Item2 = Place goods location Config.DeliveryLocationsScooter = { - { Item1 = { x = -153.19, y = -838.31, z = 30.12 }, Item2 = { x = -143.85, y = -846.3, z = 30.6 } }, - { Item1 = { x = 37.72, y = -795.71, z = 30.93 }, Item2 = { x = 44.94, y = -803.24, z = 31.52 } }, - { Item1 = { x = 111.7, y = -809.56, z = 30.71 }, Item2 = { x = 102.19, y = -818.22, z = 31.35 } }, - { Item1 = { x = 132.61, y = -889.41, z = 29.71 }, Item2 = { x = 121.25, y = -879.82, z = 31.12 } }, - { Item1 = { x = 54.41, y = -994.86, z = 28.7 }, Item2 = { x = 43.89, y = -997.98, z = 29.34 } }, - { Item1 = { x = 54.41, y = -994.86, z = 28.7 }, Item2 = { x = 57.65, y = -1003.72, z = 29.36 } }, - { Item1 = { x = 142.87, y = -1026.78, z = 28.67 }, Item2 = { x = 135.44, y = -1031.19, z = 29.35 } }, - { Item1 = { x = 248.03, y = -1005.49, z = 28.61 }, Item2 = { x = 254.83, y = -1013.25, z = 29.27 } }, - { Item1 = { x = 275.68, y = -929.64, z = 28.47 }, Item2 = { x = 285.55, y = -937.26, z = 29.39 } }, - { Item1 = { x = 294.29, y = -877.33, z = 28.61 }, Item2 = { x = 301.12, y = -883.47, z = 29.28 } }, - { Item1 = { x = 247.68, y = -832.03, z = 29.16 }, Item2 = { x = 258.66, y = -830.44, z = 29.58 } }, - { Item1 = { x = 227.21, y = -705.26, z = 35.07 }, Item2 = { x = 232.2, y = -714.55, z = 35.78 } }, - { Item1 = { x = 241.06, y = -667.74, z = 37.44 }, Item2 = { x = 245.5, y = -677.7, z = 37.75 } }, - { Item1 = { x = 257.05, y = -628.21, z = 40.59 }, Item2 = { x = 268.54, y = -640.44, z = 42.02 } }, - { Item1 = { x = 211.33, y = -605.63, z = 41.42 }, Item2 = { x = 222.32, y = -596.71, z = 43.87 } }, - { Item1 = { x = 126.27, y = -555.46, z = 42.66 }, Item2 = { x = 168.11, y = -567.17, z = 43.87 } }, - { Item1 = { x = 254.2, y = -377.17, z = 43.96 }, Item2 = { x = 239.06, y = -409.27, z = 47.92 } }, - { Item1 = { x = 244.49, y = 349.05, z = 105.46 }, Item2 = { x = 252.86, y = 357.13, z = 105.53 } }, - { Item1 = { x = 130.77, y = -307.27, z = 44.58 }, Item2 = { x = 138.67, y = -285.45, z = 50.45 } }, - { Item1 = { x = 54.44, y = -280.4, z = 46.9 }, Item2 = { x = 61.86, y = -260.86, z = 52.35 } }, - { Item1 = { x = 55.15, y = -225.54, z = 50.44 }, Item2 = { x = 76.29, y = -233.15, z = 51.4 } }, - { Item1 = { x = 44.6, y = -138.99, z = 54.66 }, Item2 = { x = 50.78, y = -136.23, z = 55.2 } }, - { Item1 = { x = 32.51, y = -162.61, z = 54.86 }, Item2 = { x = 26.84, y = -168.84, z = 55.54 } }, - { Item1 = { x = -29.6, y = -110.84, z = 56.51 }, Item2 = { x = -23.5, y = -106.74, z = 57.04 } }, - { Item1 = { x = -96.86, y = -86.84, z = 57.44 }, Item2 = { x = -87.82, y = -83.55, z = 57.82 } }, - { Item1 = { x = -146.26, y = -71.46, z = 53.9 }, Item2 = { x = -132.92, y = -69.02, z = 55.42 } }, - { Item1 = { x = -238.41, y = 91.97, z = 68.11 }, Item2 = { x = -263.61, y = 98.88, z = 69.3 } }, - { Item1 = { x = -251.45, y = 20.43, z = 53.9 }, Item2 = { x = -273.35, y = 28.21, z = 54.75 } }, - { Item1 = { x = -322.4, y = -10.06, z = 47.42 }, Item2 = { x = -315.48, y = -3.76, z = 48.2 } }, - { Item1 = { x = -431.22, y = 14.6, z = 45.5 }, Item2 = { x = -424.83, y = 21.74, z = 46.27 } }, - { Item1 = { x = -497.33, y = -8.38, z = 44.33 }, Item2 = { x = -500.95, y = -18.65, z = 45.13 } }, - { Item1 = { x = -406.69, y = -44.87, z = 45.13 }, Item2 = { x = -429.07, y = -24.12, z = 46.23 } }, - { Item1 = { x = -433.94, y = -76.33, z = 40.93 }, Item2 = { x = -437.89, y = -66.91, z = 43 } }, - { Item1 = { x = -583.22, y = -154.84, z = 37.51 }, Item2 = { x = -582.8, y = -146.8, z = 38.23 } }, - { Item1 = { x = -613.68, y = -213.46, z = 36.51 }, Item2 = { x = -622.23, y = -210.97, z = 37.33 } }, - { Item1 = { x = -582.44, y = -322.69, z = 34.33 }, Item2 = { x = -583.02, y = -330.38, z = 34.97 } }, - { Item1 = { x = -658.25, y = -329, z = 34.2 }, Item2 = { x = -666.69, y = -329.06, z = 35.2 } }, - { Item1 = { x = -645.84, y = -419.67, z = 34.1 }, Item2 = { x = -654.84, y = -414.21, z = 35.45 } }, - { Item1 = { x = -712.7, y = -668.08, z = 29.81 }, Item2 = { x = -714.58, y = -675.37, z = 30.63 } }, - { Item1 = { x = -648.24, y = -681.53, z = 30.61 }, Item2 = { x = -656.77, y = -678.12, z = 31.46 } }, - { Item1 = { x = -648.87, y = -904.3, z = 23.8 }, Item2 = { x = -660.88, y = -900.72, z = 24.61 } }, - { Item1 = { x = -529.01, y = -848.03, z = 29.26 }, Item2 = { x = -531.0, y = -854.04, z = 29.79 } }, + { Item1 = { x = -153.19, y = -838.31, z = 30.12 }, Item2 = { x = -143.85, y = -846.3, z = 30.6 } }, + { Item1 = { x = 37.72, y = -795.71, z = 30.93 }, Item2 = { x = 44.94, y = -803.24, z = 31.52 } }, + { Item1 = { x = 111.7, y = -809.56, z = 30.71 }, Item2 = { x = 102.19, y = -818.22, z = 31.35 } }, + { Item1 = { x = 132.61, y = -889.41, z = 29.71 }, Item2 = { x = 121.25, y = -879.82, z = 31.12 } }, + { Item1 = { x = 54.41, y = -994.86, z = 28.7 }, Item2 = { x = 43.89, y = -997.98, z = 29.34 } }, + { Item1 = { x = 54.41, y = -994.86, z = 28.7 }, Item2 = { x = 57.65, y = -1003.72, z = 29.36 } }, + { Item1 = { x = 142.87, y = -1026.78, z = 28.67 }, Item2 = { x = 135.44, y = -1031.19, z = 29.35 } }, + { Item1 = { x = 248.03, y = -1005.49, z = 28.61 }, Item2 = { x = 254.83, y = -1013.25, z = 29.27 } }, + { Item1 = { x = 275.68, y = -929.64, z = 28.47 }, Item2 = { x = 285.55, y = -937.26, z = 29.39 } }, + { Item1 = { x = 294.29, y = -877.33, z = 28.61 }, Item2 = { x = 301.12, y = -883.47, z = 29.28 } }, + { Item1 = { x = 247.68, y = -832.03, z = 29.16 }, Item2 = { x = 258.66, y = -830.44, z = 29.58 } }, + { Item1 = { x = 227.21, y = -705.26, z = 35.07 }, Item2 = { x = 232.2, y = -714.55, z = 35.78 } }, + { Item1 = { x = 241.06, y = -667.74, z = 37.44 }, Item2 = { x = 245.5, y = -677.7, z = 37.75 } }, + { Item1 = { x = 257.05, y = -628.21, z = 40.59 }, Item2 = { x = 268.54, y = -640.44, z = 42.02 } }, + { Item1 = { x = 211.33, y = -605.63, z = 41.42 }, Item2 = { x = 222.32, y = -596.71, z = 43.87 } }, + { Item1 = { x = 126.27, y = -555.46, z = 42.66 }, Item2 = { x = 168.11, y = -567.17, z = 43.87 } }, + { Item1 = { x = 254.2, y = -377.17, z = 43.96 }, Item2 = { x = 239.06, y = -409.27, z = 47.92 } }, + { Item1 = { x = 244.49, y = 349.05, z = 105.46 }, Item2 = { x = 252.86, y = 357.13, z = 105.53 } }, + { Item1 = { x = 130.77, y = -307.27, z = 44.58 }, Item2 = { x = 138.67, y = -285.45, z = 50.45 } }, + { Item1 = { x = 54.44, y = -280.4, z = 46.9 }, Item2 = { x = 61.86, y = -260.86, z = 52.35 } }, + { Item1 = { x = 55.15, y = -225.54, z = 50.44 }, Item2 = { x = 76.29, y = -233.15, z = 51.4 } }, + { Item1 = { x = 44.6, y = -138.99, z = 54.66 }, Item2 = { x = 50.78, y = -136.23, z = 55.2 } }, + { Item1 = { x = 32.51, y = -162.61, z = 54.86 }, Item2 = { x = 26.84, y = -168.84, z = 55.54 } }, + { Item1 = { x = -29.6, y = -110.84, z = 56.51 }, Item2 = { x = -23.5, y = -106.74, z = 57.04 } }, + { Item1 = { x = -96.86, y = -86.84, z = 57.44 }, Item2 = { x = -87.82, y = -83.55, z = 57.82 } }, + { Item1 = { x = -146.26, y = -71.46, z = 53.9 }, Item2 = { x = -132.92, y = -69.02, z = 55.42 } }, + { Item1 = { x = -238.41, y = 91.97, z = 68.11 }, Item2 = { x = -263.61, y = 98.88, z = 69.3 } }, + { Item1 = { x = -251.45, y = 20.43, z = 53.9 }, Item2 = { x = -273.35, y = 28.21, z = 54.75 } }, + { Item1 = { x = -322.4, y = -10.06, z = 47.42 }, Item2 = { x = -315.48, y = -3.76, z = 48.2 } }, + { Item1 = { x = -431.22, y = 14.6, z = 45.5 }, Item2 = { x = -424.83, y = 21.74, z = 46.27 } }, + { Item1 = { x = -497.33, y = -8.38, z = 44.33 }, Item2 = { x = -500.95, y = -18.65, z = 45.13 } }, + { Item1 = { x = -406.69, y = -44.87, z = 45.13 }, Item2 = { x = -429.07, y = -24.12, z = 46.23 } }, + { Item1 = { x = -433.94, y = -76.33, z = 40.93 }, Item2 = { x = -437.89, y = -66.91, z = 43 } }, + { Item1 = { x = -583.22, y = -154.84, z = 37.51 }, Item2 = { x = -582.8, y = -146.8, z = 38.23 } }, + { Item1 = { x = -613.68, y = -213.46, z = 36.51 }, Item2 = { x = -622.23, y = -210.97, z = 37.33 } }, + { Item1 = { x = -582.44, y = -322.69, z = 34.33 }, Item2 = { x = -583.02, y = -330.38, z = 34.97 } }, + { Item1 = { x = -658.25, y = -329, z = 34.2 }, Item2 = { x = -666.69, y = -329.06, z = 35.2 } }, + { Item1 = { x = -645.84, y = -419.67, z = 34.1 }, Item2 = { x = -654.84, y = -414.21, z = 35.45 } }, + { Item1 = { x = -712.7, y = -668.08, z = 29.81 }, Item2 = { x = -714.58, y = -675.37, z = 30.63 } }, + { Item1 = { x = -648.24, y = -681.53, z = 30.61 }, Item2 = { x = -656.77, y = -678.12, z = 31.46 } }, + { Item1 = { x = -648.87, y = -904.3, z = 23.8 }, Item2 = { x = -660.88, y = -900.72, z = 24.61 } }, + { Item1 = { x = -529.01, y = -848.03, z = 29.26 }, Item2 = { x = -531.0, y = -854.04, z = 29.79 } }, } -- Random delivery locations of van Config.DeliveryLocationsVan = { - { Item1 = { x = -51.95, y = -1761.67, z = 28.89 }, Item2 = { x = -41.15, y = -1751.66, z = 29.42 } }, - { Item1 = { x = 369.38, y = 317.44, z = 103.21 }, Item2 = { x = 375.08, y = 333.65, z = 103.57 } }, - { Item1 = { x = -702.38, y = -920.38, z = 18.8 }, Item2 = { x = -705.7, y = -905.46, z = 19.22 } }, - { Item1 = { x = -1225.49, y = -893.3, z = 12.13 }, Item2 = { x = -1223.77, y = -912.26, z = 12.33 } }, - { Item1 = { x = -1506.82, y = -383.06, z = 40.64 }, Item2 = { x = -1482.29, y = -378.95, z = 40.16 } }, - { Item1 = { x = 1149.13, y = -985.08, z = 45.64 }, Item2 = { x = 1131.86, y = -979.32, z = 46.42 } }, - { Item1 = { x = 1157.19, y = -331.77, z = 68.64 }, Item2 = { x = 1163.79, y = -314.6, z = 69.21 } }, - { Item1 = { x = -1145.42, y = -1590.97, z = 4.06 }, Item2 = { x = -1150.31, y = -1601.7, z = 4.39 } }, - { Item1 = { x = 48.18, y = -992.62, z = 29.03 }, Item2 = { x = 38.41, y = -1005.3, z = 29.48 } }, - { Item1 = { x = 370.05, y = -1036.4, z = 28.99 }, Item2 = { x = 376.7, y = -1028.82, z = 29.34 } }, - { Item1 = { x = 785.95, y = -761.67, z = 26.33 }, Item2 = { x = 797.0, y = -757.31, z = 26.89 } }, - { Item1 = { x = 41.53, y = -138.21, z = 55.08 }, Item2 = { x = 50.96, y = -135.49, z = 55.2 } }, - { Item1 = { x = 106.8, y = 304.21, z = 109.81 }, Item2 = { x = 90.86, y = 298.51, z = 110.21 } }, - { Item1 = { x = -565.73, y = 268.54, z = 82.55 }, Item2 = { x = -562.25, y = 283.98, z = 82.18 } }, + { Item1 = { x = -51.95, y = -1761.67, z = 28.89 }, Item2 = { x = -41.15, y = -1751.66, z = 29.42 } }, + { Item1 = { x = 369.38, y = 317.44, z = 103.21 }, Item2 = { x = 375.08, y = 333.65, z = 103.57 } }, + { Item1 = { x = -702.38, y = -920.38, z = 18.8 }, Item2 = { x = -705.7, y = -905.46, z = 19.22 } }, + { Item1 = { x = -1225.49, y = -893.3, z = 12.13 }, Item2 = { x = -1223.77, y = -912.26, z = 12.33 } }, + { Item1 = { x = -1506.82, y = -383.06, z = 40.64 }, Item2 = { x = -1482.29, y = -378.95, z = 40.16 } }, + { Item1 = { x = 1149.13, y = -985.08, z = 45.64 }, Item2 = { x = 1131.86, y = -979.32, z = 46.42 } }, + { Item1 = { x = 1157.19, y = -331.77, z = 68.64 }, Item2 = { x = 1163.79, y = -314.6, z = 69.21 } }, + { Item1 = { x = -1145.42, y = -1590.97, z = 4.06 }, Item2 = { x = -1150.31, y = -1601.7, z = 4.39 } }, + { Item1 = { x = 48.18, y = -992.62, z = 29.03 }, Item2 = { x = 38.41, y = -1005.3, z = 29.48 } }, + { Item1 = { x = 370.05, y = -1036.4, z = 28.99 }, Item2 = { x = 376.7, y = -1028.82, z = 29.34 } }, + { Item1 = { x = 785.95, y = -761.67, z = 26.33 }, Item2 = { x = 797.0, y = -757.31, z = 26.89 } }, + { Item1 = { x = 41.53, y = -138.21, z = 55.08 }, Item2 = { x = 50.96, y = -135.49, z = 55.2 } }, + { Item1 = { x = 106.8, y = 304.21, z = 109.81 }, Item2 = { x = 90.86, y = 298.51, z = 110.21 } }, + { Item1 = { x = -565.73, y = 268.54, z = 82.55 }, Item2 = { x = -562.25, y = 283.98, z = 82.18 } }, } -- Random delivery locations of truck Config.DeliveryLocationsTruck = { - { Item1 = { x = -1395.82, y = -653.76, z = 28.91 }, Item2 = { x = -1413.43, y = -635.47, z = 28.67 } }, - { Item1 = { x = 164.18, y = -1280.21, z = 29.38 }, Item2 = { x = 136.5, y = -1278.69, z = 29.36 } }, - { Item1 = { x = 75.71, y = 164.41, z = 104.93 }, Item2 = { x = 78.55, y = 180.44, z = 104.63 } }, - { Item1 = { x = -226.62, y = 308.87, z = 92.4 }, Item2 = { x = -229.54, y = 293.59, z = 92.19 } }, - { Item1 = { x = -365.87, y = 297.27, z = 85.04 }, Item2 = { x = -370.5, y = 277.98, z = 86.42 } }, - { Item1 = { x = -403.95, y = 196.11, z = 82.67 }, Item2 = { x = -395.17, y = 208.6, z = 83.59 } }, - { Item1 = { x = -412.26, y = 297.95, z = 83.46 }, Item2 = { x = -427.08, y = 294.19, z = 83.23 } }, - { Item1 = { x = -606.23, y = -901.52, z = 25.39 }, Item2 = { x = -592.48, y = -892.76, z = 25.93 } }, - { Item1 = { x = -837.03, y = -1142.46, z = 7.44 }, Item2 = { x = -841.89, y = -1127.91, z = 6.97 } }, - { Item1 = { x = -1061.56, y = -1382.19, z = 5.44 }, Item2 = { x = -1039.38, y = -1396.88, z = 5.55 } }, - { Item1 = { x = 156.41, y = -1651.21, z = 29.53 }, Item2 = { x = 169.11, y = -1633.38, z = 29.29 } }, - { Item1 = { x = 168.13, y = -1470.07, z = 29.37 }, Item2 = { x = 175.78, y = -1461.16, z = 29.24 } }, - { Item1 = { x = 118.99, y = -1486.21, z = 29.38 }, Item2 = { x = 143.54, y = -1481.18, z = 29.36 } }, - { Item1 = { x = -548.34, y = 308.19, z = 83.34 }, Item2 = { x = -546.6, y = 291.46, z = 83.02 } }, + { Item1 = { x = -1395.82, y = -653.76, z = 28.91 }, Item2 = { x = -1413.43, y = -635.47, z = 28.67 } }, + { Item1 = { x = 164.18, y = -1280.21, z = 29.38 }, Item2 = { x = 136.5, y = -1278.69, z = 29.36 } }, + { Item1 = { x = 75.71, y = 164.41, z = 104.93 }, Item2 = { x = 78.55, y = 180.44, z = 104.63 } }, + { Item1 = { x = -226.62, y = 308.87, z = 92.4 }, Item2 = { x = -229.54, y = 293.59, z = 92.19 } }, + { Item1 = { x = -365.87, y = 297.27, z = 85.04 }, Item2 = { x = -370.5, y = 277.98, z = 86.42 } }, + { Item1 = { x = -403.95, y = 196.11, z = 82.67 }, Item2 = { x = -395.17, y = 208.6, z = 83.59 } }, + { Item1 = { x = -412.26, y = 297.95, z = 83.46 }, Item2 = { x = -427.08, y = 294.19, z = 83.23 } }, + { Item1 = { x = -606.23, y = -901.52, z = 25.39 }, Item2 = { x = -592.48, y = -892.76, z = 25.93 } }, + { Item1 = { x = -837.03, y = -1142.46, z = 7.44 }, Item2 = { x = -841.89, y = -1127.91, z = 6.97 } }, + { Item1 = { x = -1061.56, y = -1382.19, z = 5.44 }, Item2 = { x = -1039.38, y = -1396.88, z = 5.55 } }, + { Item1 = { x = 156.41, y = -1651.21, z = 29.53 }, Item2 = { x = 169.11, y = -1633.38, z = 29.29 } }, + { Item1 = { x = 168.13, y = -1470.07, z = 29.37 }, Item2 = { x = 175.78, y = -1461.16, z = 29.24 } }, + { Item1 = { x = 118.99, y = -1486.21, z = 29.38 }, Item2 = { x = 143.54, y = -1481.18, z = 29.36 } }, + { Item1 = { x = -548.34, y = 308.19, z = 83.34 }, Item2 = { x = -546.6, y = 291.46, z = 83.02 } }, } -- Player outfit of scooter Config.OutfitScooter = { - [1] = { drawables = 0, texture = 0 }, - [3] = { drawables = 66, texture = 0 }, - [4] = { drawables = 97, texture = 3 }, - [5] = { drawables = 0, texture = 0 }, - [6] = { drawables = 32, texture = 14 }, - [7] = { drawables = 0, texture = 0 }, - [8] = { drawables = 15, texture = 0 }, - [9] = { drawables = 0, texture = 0 }, - [11] = { drawables = 184, texture = 0 }, - [12] = { drawables = 18, texture = 5 }, - [13] = { drawables = 1280, texture = 2 }, + [1] = { drawables = 0, texture = 0 }, + [3] = { drawables = 66, texture = 0 }, + [4] = { drawables = 97, texture = 3 }, + [5] = { drawables = 0, texture = 0 }, + [6] = { drawables = 32, texture = 14 }, + [7] = { drawables = 0, texture = 0 }, + [8] = { drawables = 15, texture = 0 }, + [9] = { drawables = 0, texture = 0 }, + [11] = { drawables = 184, texture = 0 }, + [12] = { drawables = 18, texture = 5 }, + [13] = { drawables = 1280, texture = 2 }, } -- Player outfit of scooter (female) Config.OutfitScooterF = { - [1] = { drawables = 0, texture = 0 }, - [3] = { drawables = 9, texture = 0 }, - [4] = { drawables = 11, texture = 3 }, - [5] = { drawables = 0, texture = 0 }, - [6] = { drawables = 11, texture = 2 }, - [7] = { drawables = 0, texture = 0 }, - [8] = { drawables = 13, texture = 0 }, - [9] = { drawables = 0, texture = 0 }, - [11] = { drawables = 295, texture = 0 }, - [12] = { drawables = 18, texture = 5 }, - [13] = { drawables = 1280, texture = 2 }, + [1] = { drawables = 0, texture = 0 }, + [3] = { drawables = 9, texture = 0 }, + [4] = { drawables = 11, texture = 3 }, + [5] = { drawables = 0, texture = 0 }, + [6] = { drawables = 11, texture = 2 }, + [7] = { drawables = 0, texture = 0 }, + [8] = { drawables = 13, texture = 0 }, + [9] = { drawables = 0, texture = 0 }, + [11] = { drawables = 295, texture = 0 }, + [12] = { drawables = 18, texture = 5 }, + [13] = { drawables = 1280, texture = 2 }, } -- Player outfit of van and truck Config.OutfitVan = { - [1] = { drawables = 0, texture = 0 }, - [3] = { drawables = 66, texture = 0 }, - [4] = { drawables = 97, texture = 3 }, - [5] = { drawables = 0, texture = 0 }, - [6] = { drawables = 32, texture = 14 }, - [7] = { drawables = 0, texture = 0 }, - [8] = { drawables = 141, texture = 0 }, - [9] = { drawables = 0, texture = 0 }, - [11] = { drawables = 230, texture = 3 }, - [12] = { drawables = 45, texture = 7 }, - [13] = { drawables = 1280, texture = 2 }, + [1] = { drawables = 0, texture = 0 }, + [3] = { drawables = 66, texture = 0 }, + [4] = { drawables = 97, texture = 3 }, + [5] = { drawables = 0, texture = 0 }, + [6] = { drawables = 32, texture = 14 }, + [7] = { drawables = 0, texture = 0 }, + [8] = { drawables = 141, texture = 0 }, + [9] = { drawables = 0, texture = 0 }, + [11] = { drawables = 230, texture = 3 }, + [12] = { drawables = 45, texture = 7 }, + [13] = { drawables = 1280, texture = 2 }, } -- Player outfit of van and truck (female) Config.OutfitVanF = { - [1] = { drawables = 0, texture = 0 }, - [3] = { drawables = 14, texture = 0 }, - [4] = { drawables = 45, texture = 1 }, - [5] = { drawables = 0, texture = 0 }, - [6] = { drawables = 27, texture = 0 }, - [7] = { drawables = 0, texture = 0 }, - [8] = { drawables = 14, texture = 0 }, - [9] = { drawables = 0, texture = 0 }, - [11] = { drawables = 14, texture = 3 }, - [12] = { drawables = 18, texture = 7 }, - [13] = { drawables = 1280, texture = 2 }, + [1] = { drawables = 0, texture = 0 }, + [3] = { drawables = 14, texture = 0 }, + [4] = { drawables = 45, texture = 1 }, + [5] = { drawables = 0, texture = 0 }, + [6] = { drawables = 27, texture = 0 }, + [7] = { drawables = 0, texture = 0 }, + [8] = { drawables = 14, texture = 0 }, + [9] = { drawables = 0, texture = 0 }, + [11] = { drawables = 14, texture = 3 }, + [12] = { drawables = 18, texture = 7 }, + [13] = { drawables = 1280, texture = 2 }, } -- Random van goods Config.VanGoodsPropNames = { - "prop_crate_11e", - "prop_cardbordbox_02a", + "prop_crate_11e", + "prop_cardbordbox_02a", } diff --git a/server-data/resources/[bpt_addons]/bpt_deliveries/fxmanifest.lua b/server-data/resources/[bpt_addons]/bpt_deliveries/fxmanifest.lua index c15a84914..c99fdc1c8 100644 --- a/server-data/resources/[bpt_addons]/bpt_deliveries/fxmanifest.lua +++ b/server-data/resources/[bpt_addons]/bpt_deliveries/fxmanifest.lua @@ -4,17 +4,17 @@ description("bpt_deliveries") version("1.0.1") client_scripts({ - "@es_extended/locale.lua", - "locales/*.lua", - "config.lua", - "client/*.lua", + "@es_extended/locale.lua", + "locales/*.lua", + "config.lua", + "client/*.lua", }) server_scripts({ - "@es_extended/locale.lua", - "locales/*.lua", - "config.lua", - "server/*.lua", + "@es_extended/locale.lua", + "locales/*.lua", + "config.lua", + "server/*.lua", }) dependency("es_extended") diff --git a/server-data/resources/[bpt_addons]/bpt_deliveries/locales/en.lua b/server-data/resources/[bpt_addons]/bpt_deliveries/locales/en.lua index e2c20f333..0fed11ce2 100644 --- a/server-data/resources/[bpt_addons]/bpt_deliveries/locales/en.lua +++ b/server-data/resources/[bpt_addons]/bpt_deliveries/locales/en.lua @@ -1,25 +1,25 @@ Locales["en"] = { - ["delivery_not_available"] = "This model is ~r~Unavailable~w~, please use ~g~bike~w~ or ~g~van~w~.", - ["start_delivery"] = "Press ~INPUT_CONTEXT~ to start the delivery job, you need to pay the safe deposit for ~g~$", - ["safe_deposit_received"] = "The safe deposit has been remove from your bank account", - ["safe_deposit_returned"] = "The safe deposit return to your bank account now", - ["safe_deposit_withheld"] = "Mission ~r~failed~w~, your safe deposit has been ~r~detain~w~.", - ["delivery_point_reward"] = "Mission complete, you received ~g~$", - ["get_back_in_vehicle"] = "Enter in your ~y~vehicle~s~", - ["remove_goods"] = "Press ~INPUT_CONTEXT~ to take out the ~y~goods~s~ from the car", - ["remove_goods_subtext"] = "Leave your car and take out the ~y~goods~w~", - ["drive_next_point"] = "Drive the car to next ~y~destination~w~", - ["deliver_inside_shop"] = "Take the ~y~goods~w~ to the next destination", - ["get_back_to_deliveryhub"] = "Back to the delivery hub and return the car", - ["delivery_vehicle_returned"] = "Your car has been return", - ["finish_job"] = "Mission status: ~g~", - ["end_delivery"] = "Press ~INPUT_CONTEXT~ to terminate the mission, please sit in the car, or you will not get the safe deposit", - ["blip_name"] = "Delivery Hub", - ["dst_blip"] = "Delivery", - ["delivery_end"] = "Delivery End", - ["delivery_failed"] = "You will lose the safe deposit because your car broken or lost", - ["delivery_finish"] = "You finished the deliveries mission", - ["delivery_start"] = "Delivery", - ["delivery_tips"] = "Drive the car safely to the destination and delivery the ~y~goods~s~", - ["not_enough_money"] = "Your have not enough bank money to pay the ~r~safe deposit~s~", + ["delivery_not_available"] = "This model is ~r~Unavailable~w~, please use ~g~bike~w~ or ~g~van~w~.", + ["start_delivery"] = "Press ~INPUT_CONTEXT~ to start the delivery job, you need to pay the safe deposit for ~g~$", + ["safe_deposit_received"] = "The safe deposit has been remove from your bank account", + ["safe_deposit_returned"] = "The safe deposit return to your bank account now", + ["safe_deposit_withheld"] = "Mission ~r~failed~w~, your safe deposit has been ~r~detain~w~.", + ["delivery_point_reward"] = "Mission complete, you received ~g~$", + ["get_back_in_vehicle"] = "Enter in your ~y~vehicle~s~", + ["remove_goods"] = "Press ~INPUT_CONTEXT~ to take out the ~y~goods~s~ from the car", + ["remove_goods_subtext"] = "Leave your car and take out the ~y~goods~w~", + ["drive_next_point"] = "Drive the car to next ~y~destination~w~", + ["deliver_inside_shop"] = "Take the ~y~goods~w~ to the next destination", + ["get_back_to_deliveryhub"] = "Back to the delivery hub and return the car", + ["delivery_vehicle_returned"] = "Your car has been return", + ["finish_job"] = "Mission status: ~g~", + ["end_delivery"] = "Press ~INPUT_CONTEXT~ to terminate the mission, please sit in the car, or you will not get the safe deposit", + ["blip_name"] = "Delivery Hub", + ["dst_blip"] = "Delivery", + ["delivery_end"] = "Delivery End", + ["delivery_failed"] = "You will lose the safe deposit because your car broken or lost", + ["delivery_finish"] = "You finished the deliveries mission", + ["delivery_start"] = "Delivery", + ["delivery_tips"] = "Drive the car safely to the destination and delivery the ~y~goods~s~", + ["not_enough_money"] = "Your have not enough bank money to pay the ~r~safe deposit~s~", } diff --git a/server-data/resources/[bpt_addons]/bpt_deliveries/locales/fr.lua b/server-data/resources/[bpt_addons]/bpt_deliveries/locales/fr.lua index 4c22dfc8c..78b101579 100644 --- a/server-data/resources/[bpt_addons]/bpt_deliveries/locales/fr.lua +++ b/server-data/resources/[bpt_addons]/bpt_deliveries/locales/fr.lua @@ -1,25 +1,25 @@ Locales["fr"] = { - ["delivery_not_available"] = "Ce modèle est ~r~indisponible~w~, merci d'utilisé une ~g~moto~w~ ou un ~g~van~w~.", - ["start_delivery"] = "Appuyez sur ~INPUT_CONTEXT~ pour demarrer les livraisons, dépôt de garantie ~g~$", - ["safe_deposit_received"] = "Le dépôt de garantie à été retiré de votre compte bancaire", - ["safe_deposit_returned"] = "Le dépôt de garantie revient maintenant sur votre compte bancaire", - ["safe_deposit_withheld"] = "Mission ~r~échoué~w~, votre dépôt de garantie à été ~r~retenue~w~.", - ["delivery_point_reward"] = "Mission réussie, vous recevez ~g~$", - ["get_back_in_vehicle"] = "Entrez dans votre ~y~véhicule~s~", - ["remove_goods"] = "Appuyez sur ~INPUT_CONTEXT~ pour retirer votre ~y~marchandise~s~ de votre véhicule", - ["remove_goods_subtext"] = "Laissez votre voiture et sortez la ~y~marchandise~w~", - ["drive_next_point"] = "Conduisez à la prochaine ~y~destination~w~", - ["deliver_inside_shop"] = "Ammener votre ~y~marchandise~w~ à la destination", - ["get_back_to_deliveryhub"] = "Retour au centre de livraison et restituer votre véhicule", - ["delivery_vehicle_returned"] = "Vous avez bien rendu le véhicule", - ["finish_job"] = "Status de la mission: ~g~", - ["end_delivery"] = "Appuyez sur ~INPUT_CONTEXT~ pour terminer la mission", - ["blip_name"] = "Centre de livraison", - ["dst_blip"] = "Livraison", - ["delivery_end"] = "Fin de livraison", - ["delivery_failed"] = "Vous avez perdue votre caution, car le véhicule est endommmager", - ["delivery_finish"] = "Vous avez terminer vos missions de livraison", - ["delivery_start"] = "Livraison", - ["delivery_tips"] = "Conduisez votre véhicule en toute sécurité jusqu'à la destination et livrer la ~y~marchandise~s~", - ["not_enough_money"] = "Vous n'avez pas assez d'argent sur votre compte en banque pour payer la ~r~caution~s~", + ["delivery_not_available"] = "Ce modèle est ~r~indisponible~w~, merci d'utilisé une ~g~moto~w~ ou un ~g~van~w~.", + ["start_delivery"] = "Appuyez sur ~INPUT_CONTEXT~ pour demarrer les livraisons, dépôt de garantie ~g~$", + ["safe_deposit_received"] = "Le dépôt de garantie à été retiré de votre compte bancaire", + ["safe_deposit_returned"] = "Le dépôt de garantie revient maintenant sur votre compte bancaire", + ["safe_deposit_withheld"] = "Mission ~r~échoué~w~, votre dépôt de garantie à été ~r~retenue~w~.", + ["delivery_point_reward"] = "Mission réussie, vous recevez ~g~$", + ["get_back_in_vehicle"] = "Entrez dans votre ~y~véhicule~s~", + ["remove_goods"] = "Appuyez sur ~INPUT_CONTEXT~ pour retirer votre ~y~marchandise~s~ de votre véhicule", + ["remove_goods_subtext"] = "Laissez votre voiture et sortez la ~y~marchandise~w~", + ["drive_next_point"] = "Conduisez à la prochaine ~y~destination~w~", + ["deliver_inside_shop"] = "Ammener votre ~y~marchandise~w~ à la destination", + ["get_back_to_deliveryhub"] = "Retour au centre de livraison et restituer votre véhicule", + ["delivery_vehicle_returned"] = "Vous avez bien rendu le véhicule", + ["finish_job"] = "Status de la mission: ~g~", + ["end_delivery"] = "Appuyez sur ~INPUT_CONTEXT~ pour terminer la mission", + ["blip_name"] = "Centre de livraison", + ["dst_blip"] = "Livraison", + ["delivery_end"] = "Fin de livraison", + ["delivery_failed"] = "Vous avez perdue votre caution, car le véhicule est endommmager", + ["delivery_finish"] = "Vous avez terminer vos missions de livraison", + ["delivery_start"] = "Livraison", + ["delivery_tips"] = "Conduisez votre véhicule en toute sécurité jusqu'à la destination et livrer la ~y~marchandise~s~", + ["not_enough_money"] = "Vous n'avez pas assez d'argent sur votre compte en banque pour payer la ~r~caution~s~", } diff --git a/server-data/resources/[bpt_addons]/bpt_deliveries/locales/it.lua b/server-data/resources/[bpt_addons]/bpt_deliveries/locales/it.lua index b671d4ba6..2335d7c5c 100644 --- a/server-data/resources/[bpt_addons]/bpt_deliveries/locales/it.lua +++ b/server-data/resources/[bpt_addons]/bpt_deliveries/locales/it.lua @@ -1,25 +1,25 @@ Locales["it"] = { - ["delivery_not_available"] = "Questo modello è ~r~Unavailable~w~, utilizza ~g~bike~w~ o ~g~van~w~.", - ["start_delivery"] = "Premi ~INPUT_CONTEXT~ per iniziare il lavoro, è necessario pagare la cauzione del veicolo ~g~$", - ["safe_deposit_received"] = "La cauzione è stata rimossa dal tuo conto bancario", - ["safe_deposit_returned"] = "La cauzione verrà restituita sul tuo conto bancario ora", - ["safe_deposit_withheld"] = "Missione ~r~failed~w~, la cauzione è stata ~r~detain~w~.", - ["delivery_point_reward"] = "Missione completata, hai ricevuto ~g~$", - ["get_back_in_vehicle"] = "Ritorna nel veicolo", - ["remove_goods"] = "Premi ~INPUT_CONTEXT~ per estrarre il ~y~merce~s~ dalla macchina", - ["remove_goods_subtext"] = "Lascia la macchina e prendi la ~y~merce~w~", - ["drive_next_point"] = "Guida l'auto fino al prossimo ~y~destination~w~", - ["deliver_inside_shop"] = "Prendi la ~y~merce~w~ e consegnala", - ["get_back_to_deliveryhub"] = "Ritorno all'hub di consegna e riconsegna l'auto", - ["delivery_vehicle_returned"] = "La tua auto è stata restituita", - ["finish_job"] = "Stato della missione: ~g~", - ["end_delivery"] = "Premi ~INPUT_CONTEXT~ per terminare la missione, recati in macchina, altrimenti non riceverai la cauzione", - ["blip_name"] = "Hub di consegna", - ["dst_blip"] = "Consegna", - ["delivery_end"] = "Fine consegna", - ["delivery_failed"] = "Perderai la cauzione del veicolo perché la tua auto è rotta o smarrita", - ["delivery_finish"] = "Hai completato le missioni", - ["delivery_start"] = "Consegna", - ["delivery_tips"] = "Guida l'auto fino alla destinazione e consegnala ~y~goods~s~", - ["not_enough_money"] = "Non hai abbastanza soldi in banca per pagare ~r~safe deposit~s~", + ["delivery_not_available"] = "Questo modello è ~r~Unavailable~w~, utilizza ~g~bike~w~ o ~g~van~w~.", + ["start_delivery"] = "Premi ~INPUT_CONTEXT~ per iniziare il lavoro, è necessario pagare la cauzione del veicolo ~g~$", + ["safe_deposit_received"] = "La cauzione è stata rimossa dal tuo conto bancario", + ["safe_deposit_returned"] = "La cauzione verrà restituita sul tuo conto bancario ora", + ["safe_deposit_withheld"] = "Missione ~r~failed~w~, la cauzione è stata ~r~detain~w~.", + ["delivery_point_reward"] = "Missione completata, hai ricevuto ~g~$", + ["get_back_in_vehicle"] = "Ritorna nel veicolo", + ["remove_goods"] = "Premi ~INPUT_CONTEXT~ per estrarre il ~y~merce~s~ dalla macchina", + ["remove_goods_subtext"] = "Lascia la macchina e prendi la ~y~merce~w~", + ["drive_next_point"] = "Guida l'auto fino al prossimo ~y~destination~w~", + ["deliver_inside_shop"] = "Prendi la ~y~merce~w~ e consegnala", + ["get_back_to_deliveryhub"] = "Ritorno all'hub di consegna e riconsegna l'auto", + ["delivery_vehicle_returned"] = "La tua auto è stata restituita", + ["finish_job"] = "Stato della missione: ~g~", + ["end_delivery"] = "Premi ~INPUT_CONTEXT~ per terminare la missione, recati in macchina, altrimenti non riceverai la cauzione", + ["blip_name"] = "Hub di consegna", + ["dst_blip"] = "Consegna", + ["delivery_end"] = "Fine consegna", + ["delivery_failed"] = "Perderai la cauzione del veicolo perché la tua auto è rotta o smarrita", + ["delivery_finish"] = "Hai completato le missioni", + ["delivery_start"] = "Consegna", + ["delivery_tips"] = "Guida l'auto fino alla destinazione e consegnala ~y~goods~s~", + ["not_enough_money"] = "Non hai abbastanza soldi in banca per pagare ~r~safe deposit~s~", } diff --git a/server-data/resources/[bpt_addons]/bpt_deliveries/locales/zh.lua b/server-data/resources/[bpt_addons]/bpt_deliveries/locales/zh.lua index f1c6eefd3..6be2df8da 100644 --- a/server-data/resources/[bpt_addons]/bpt_deliveries/locales/zh.lua +++ b/server-data/resources/[bpt_addons]/bpt_deliveries/locales/zh.lua @@ -1,25 +1,25 @@ Locales["zh"] = { - ["delivery_not_available"] = "這個模式 ~r~不可用~w~,請使用 ~g~自行車~w~ 或 ~g~廂型車~w~.", - ["start_delivery"] = "按下 ~INPUT_CONTEXT~ 來開始送貨,你需要支付押金 ~g~¥", - ["safe_deposit_received"] = "車輛押金已經從你的銀行賬戶扣除", - ["safe_deposit_returned"] = "車輛押金已經退還到你的銀行賬戶", - ["safe_deposit_withheld"] = "送貨任務 ~r~失敗~w~。你的押金已經被 ~r~扣留~w~ 了", - ["delivery_point_reward"] = "任務完成,你收到了 ~g~¥", - ["get_back_in_vehicle"] = "進入你的 ~b~車輛 ~s~!", - ["remove_goods"] = "按下 ~INPUT_CONTEXT~ 來卸下 ~b~貨物~w~", - ["remove_goods_subtext"] = "離開車輛並從車尾取下 ~b~貨物~w~", - ["drive_next_point"] = "開車出發前往下一個 ~b~送貨地點~w~", - ["deliver_inside_shop"] = "將 ~b~貨物~w~ 送到指定地點", - ["get_back_to_deliveryhub"] = "回到 ~y~調度中心 ~s~並退還車輛", - ["delivery_vehicle_returned"] = "你的車輛已經退還", - ["finish_job"] = "任務完成進度:~g~", - ["end_delivery"] = "按下 ~INPUT_CONTEXT~ 來結束任務,確保你在車里,否則無法退還你的押金", - ["blip_name"] = "物流調度中心", - ["dst_blip"] = "目的地", - ["delivery_end"] = "運輸任務結束", - ["delivery_failed"] = "由於你的車輛損壞或丟失,你失去了所有的押金", - ["delivery_finish"] = "你已經完成了運輸貨物任務", - ["delivery_start"] = "運輸任務開始", - ["delivery_tips"] = "安全駕駛車輛到達目的地並交付 ~b~貨物~s~", - ["not_enough_money"] = "你的銀行賬戶沒有足夠的錢支付 ~r~押金~s~", + ["delivery_not_available"] = "這個模式 ~r~不可用~w~,請使用 ~g~自行車~w~ 或 ~g~廂型車~w~.", + ["start_delivery"] = "按下 ~INPUT_CONTEXT~ 來開始送貨,你需要支付押金 ~g~¥", + ["safe_deposit_received"] = "車輛押金已經從你的銀行賬戶扣除", + ["safe_deposit_returned"] = "車輛押金已經退還到你的銀行賬戶", + ["safe_deposit_withheld"] = "送貨任務 ~r~失敗~w~。你的押金已經被 ~r~扣留~w~ 了", + ["delivery_point_reward"] = "任務完成,你收到了 ~g~¥", + ["get_back_in_vehicle"] = "進入你的 ~b~車輛 ~s~!", + ["remove_goods"] = "按下 ~INPUT_CONTEXT~ 來卸下 ~b~貨物~w~", + ["remove_goods_subtext"] = "離開車輛並從車尾取下 ~b~貨物~w~", + ["drive_next_point"] = "開車出發前往下一個 ~b~送貨地點~w~", + ["deliver_inside_shop"] = "將 ~b~貨物~w~ 送到指定地點", + ["get_back_to_deliveryhub"] = "回到 ~y~調度中心 ~s~並退還車輛", + ["delivery_vehicle_returned"] = "你的車輛已經退還", + ["finish_job"] = "任務完成進度:~g~", + ["end_delivery"] = "按下 ~INPUT_CONTEXT~ 來結束任務,確保你在車里,否則無法退還你的押金", + ["blip_name"] = "物流調度中心", + ["dst_blip"] = "目的地", + ["delivery_end"] = "運輸任務結束", + ["delivery_failed"] = "由於你的車輛損壞或丟失,你失去了所有的押金", + ["delivery_finish"] = "你已經完成了運輸貨物任務", + ["delivery_start"] = "運輸任務開始", + ["delivery_tips"] = "安全駕駛車輛到達目的地並交付 ~b~貨物~s~", + ["not_enough_money"] = "你的銀行賬戶沒有足夠的錢支付 ~r~押金~s~", } diff --git a/server-data/resources/[bpt_addons]/bpt_deliveries/server/main.lua b/server-data/resources/[bpt_addons]/bpt_deliveries/server/main.lua index 590c190ee..19d494616 100644 --- a/server-data/resources/[bpt_addons]/bpt_deliveries/server/main.lua +++ b/server-data/resources/[bpt_addons]/bpt_deliveries/server/main.lua @@ -8,59 +8,59 @@ RegisterServerEvent("bpt_deliveries:getPlayerJob:server") -- Return safe deposit event AddEventHandler("bpt_deliveries:returnSafe:server", function(deliveryType, safeReturn) - local xPlayer = ESX.GetPlayerFromId(source) - if safeReturn then - local SafeMoney = 4000 - for k, v in pairs(Config.Safe) do - if k == deliveryType then - SafeMoney = v - break - end - end - xPlayer.addAccountMoney("bank", SafeMoney) - xPlayer.showNotification(TranslateCap("safe_deposit_returned")) - else - xPlayer.showNotification(TranslateCap("safe_deposit_withheld")) - end + local xPlayer = ESX.GetPlayerFromId(source) + if safeReturn then + local SafeMoney = 4000 + for k, v in pairs(Config.Safe) do + if k == deliveryType then + SafeMoney = v + break + end + end + xPlayer.addAccountMoney("bank", SafeMoney) + xPlayer.showNotification(TranslateCap("safe_deposit_returned")) + else + xPlayer.showNotification(TranslateCap("safe_deposit_withheld")) + end end) -- Finish delivery mission event AddEventHandler("bpt_deliveries:finishDelivery:server", function(deliveryType) - local xPlayer = ESX.GetPlayerFromId(source) - local deliveryMoney = 800 - for k, v in pairs(Config.Rewards) do - if k == deliveryType then - deliveryMoney = v - break - end - end - xPlayer.addMoney(deliveryMoney) - xPlayer.showNotification(TranslateCap("delivery_point_reward") .. tostring(deliveryMoney)) + local xPlayer = ESX.GetPlayerFromId(source) + local deliveryMoney = 800 + for k, v in pairs(Config.Rewards) do + if k == deliveryType then + deliveryMoney = v + break + end + end + xPlayer.addMoney(deliveryMoney) + xPlayer.showNotification(TranslateCap("delivery_point_reward") .. tostring(deliveryMoney)) end) -- Remove safe deposit event (On start mission) AddEventHandler("bpt_deliveries:removeSafeMoney:server", function(deliveryType) - local xPlayer = ESX.GetPlayerFromId(source) - local SafeMoney = 4000 - for k, v in pairs(Config.Safe) do - if k == deliveryType then - SafeMoney = v - break - end - end - local PlayerMoney = xPlayer.getAccount("bank").money - if PlayerMoney >= SafeMoney then - xPlayer.removeAccountMoney("bank", SafeMoney) - xPlayer.showNotification(TranslateCap("safe_deposit_received")) - TriggerClientEvent("bpt_deliveries:startJob:client", source, deliveryType) - else - xPlayer.showNotification(TranslateCap("not_enough_money")) - end + local xPlayer = ESX.GetPlayerFromId(source) + local SafeMoney = 4000 + for k, v in pairs(Config.Safe) do + if k == deliveryType then + SafeMoney = v + break + end + end + local PlayerMoney = xPlayer.getAccount("bank").money + if PlayerMoney >= SafeMoney then + xPlayer.removeAccountMoney("bank", SafeMoney) + xPlayer.showNotification(TranslateCap("safe_deposit_received")) + TriggerClientEvent("bpt_deliveries:startJob:client", source, deliveryType) + else + xPlayer.showNotification(TranslateCap("not_enough_money")) + end end) -- Get the player job name AddEventHandler("bpt_deliveries:getPlayerJob:server", function() - local xPlayer = ESX.GetPlayerFromId(source) - print("Player request job: " .. source .. ", " .. xPlayer.job.name) - TriggerClientEvent("bpt_deliveries:setPlayerJob:client", source, xPlayer.job.name) + local xPlayer = ESX.GetPlayerFromId(source) + print("Player request job: " .. source .. ", " .. xPlayer.job.name) + TriggerClientEvent("bpt_deliveries:setPlayerJob:client", source, xPlayer.job.name) end)