36 |
37 |
38 |
39 |
--------------------------------------------------------------------------------
/locales/sv.lua:
--------------------------------------------------------------------------------
1 | local Translations = {
2 | error = {
3 | no_money = 'Inte tillräckligt med pengar',
4 | too_far = 'Du är för långt ifrån korv-vagnen',
5 | no_stand = 'Du har ingen korv-vagn',
6 | cust_refused = 'Kunden vägrar!',
7 | no_stand_found = 'Din korv-vagn går inte att hitta någonstans, du får inte tillbaka din deposition!',
8 | no_more = 'Du har inga %{value} kvar inför fullmäktige',
9 | deposit_notreturned = 'Du hade ingen korv-vagn',
10 | },
11 | success = {
12 | deposit = 'Du betalade %{deposit} kr i deposition!',
13 | deposit_returned = 'Dina %{deposit} kr för deposition är återlämnade till dig!',
14 | sold_hotdogs = '%{value} x varmkorv(\ar) såldes för %{value2} kr',
15 | made_hotdog = 'Du gjorde %{value} varmkorvar',
16 | made_luck_hotdog = 'Du gjorde %{value} x %{value2} Varmkorvar',
17 | },
18 | info = {
19 | command = "Ta bord korv-vagn (Endast Admin)",
20 | blip_name = 'Korv-vagn',
21 | start_working = '[~g~E~s~] Börja jobba',
22 | start_work = 'Börja jobba',
23 | stop_working = '[~g~E~s~] Sluta jobba',
24 | stop_work = 'Sluta jobba',
25 | grab_stall = '[~g~G~s~] Greppa vagnen',
26 | drop_stall = '[~g~G~s~] Släpp vagnen',
27 | grab = 'Greppa vagnen',
28 | selling_prep = '[~g~E~s~] Förberedelse av korv [Försäljning: ~g~Säljer~w~]',
29 | not_selling = '[~g~E~s~] Förberedelse av korv [Försäljning: ~r~Säljer inte~w~]',
30 | sell_dogs = '[~g~7~s~] Sälj %{value} x varmkorvar för $%{value2} / [~g~8~s~] Avböj',
31 | admin_removed = "Korv-vagnen borttagen",
32 | label_a = "Perfekt (A)",
33 | label_b = "Mycket bra (B)",
34 | label_c = "Ok (C)"
35 | }
36 | }
37 |
38 | if GetConvar('qb_locale', 'en') == 'sv' then
39 | Lang = Locale:new({
40 | phrases = Translations,
41 | warnOnMissing = true,
42 | fallbackLang = Lang,
43 | })
44 | end
45 |
--------------------------------------------------------------------------------
/locales/it.lua:
--------------------------------------------------------------------------------
1 | local Translations = {
2 | error = {
3 | no_money = 'Non hai abbastanza soldi',
4 | too_far = 'Sei troppo lontano dal tuo chiosco degli Hot Dog',
5 | no_stand = 'Non hai un chiosco di hotdog',
6 | cust_refused = 'Il cliente ha rifiutato!',
7 | no_stand_found = 'Il tuo chiosco degli hot dog non è stato riconsegnato, non ricevererai il tuo deposito indietro!',
8 | no_more = 'Non hai nessun %{value} davanti al chiosco',
9 | deposit_notreturned = 'Non hai un chiosco degli Hot Dog',
10 | },
11 | success = {
12 | deposit = 'Hai pagato un deposito di $%{deposit}!',
13 | deposit_returned = 'Il tuo deposito di $%{deposit} ti è stato restituito!',
14 | sold_hotdogs = '%{value} x Hotdog venduti per $%{value2}',
15 | made_hotdog = 'Hai prodotto un %{value} Hot Dogs',
16 | made_luck_hotdog = 'Hai prodotto %{value} x %{value2} Hot Dogs',
17 | },
18 | info = {
19 | command = "Cancella chiosco (Solo Admin)",
20 | blip_name = 'Chiosco Hotdog',
21 | start_working = '[~g~E~s~] Inizia a lavorare',
22 | start_work = 'Inizia a lavorare',
23 | stop_working = '[~g~E~s~] Smetti di lavorare',
24 | stop_work = 'Smetti di lavorare',
25 | grab_stall = '[~g~G~s~] Prendi chiosco',
26 | drop_stall = '[~g~G~s~] Lascia chiosco',
27 | grab = 'Prendi chiosco',
28 | selling_prep = '[~g~E~s~] Prepara Hotdog [Vendite: ~g~Vendendo~w~]',
29 | not_selling = '[~g~E~s~] Prepara Hotdog [Vendite: ~r~Non vendendo~w~]',
30 | sell_dogs = '[~g~7~s~] Vendi %{value} x HotDogs per $%{value2} / [~g~8~s~] Rifiuta',
31 | admin_removed = "Chiosco Hot Dog rimosso",
32 | label_a = "Perfetto (A)",
33 | label_b = "Raro (B)",
34 | label_c = "Comune (C)"
35 | }
36 | }
37 |
38 | if GetConvar('qb_locale', 'en') == 'it' then
39 | Lang = Locale:new({
40 | phrases = Translations,
41 | warnOnMissing = true,
42 | fallbackLang = Lang,
43 | })
44 | end
45 |
--------------------------------------------------------------------------------
/locales/de.lua:
--------------------------------------------------------------------------------
1 | local Translations = {
2 | error = {
3 | no_money = 'Nicht genug Geld',
4 | too_far = 'Sie sind zu weit von Ihrem Hot Dog Stand entfernt',
5 | no_stand = 'Sie haben keinen Hotdog-Stand',
6 | cust_refused = 'Kunde verweigert!',
7 | no_stand_found = 'Ihr Hotdog-Stand war nirgends zu sehen. Sie erhalten Ihre Kaution nicht zurück!',
8 | no_more = 'Du hast keine %{value} in deinem Stand',
9 | deposit_notreturned = 'Du hast keinen HotDog Stand',
10 | },
11 | success = {
12 | deposit = 'Sie haben eine Kaution in Höhe von 250 Dollar hinterlegt!',
13 | deposit_returned = 'Ihre 250 $ Anzahlung wurde zurückerstattet!',
14 | sold_hotdogs = '%{value} x Hotdog(\'s) verkauft für $%{value2}',
15 | made_hotdog = 'Du hast einen %{value} HotDog hergestellt.',
16 | made_luck_hotdog = 'Du hast %{value} x %{value2} Hot Dogs',
17 | },
18 | info = {
19 | command = "Stand Löschen (Admins Only)",
20 | blip_name = 'Hotdog Stand',
21 | start_working = '[~g~E~s~] Starte zu Arbeiten',
22 | start_work = 'Starte zu Arbeiten',
23 | stop_working = '[~g~E~s~] Stope zu Arbeiten',
24 | stop_work = 'Stope zu Arbeiten',
25 | grab_stall = '[~g~G~s~] Stand nehmen',
26 | drop_stall = '[~g~G~s~] Stand hinstellen',
27 | grab = 'Stand nehmen',
28 | selling_prep = '[~g~E~s~] HotDog herstellen [Status: ~g~Verkauf Geöffnet~w~]',
29 | not_selling = '[~g~E~s~] Hotdog prepare [Status: ~r~Verkauf Geschlossen~w~]',
30 | sell_dogs = '[~g~7~s~] Verkaufe %{value} x HotDogs für $%{value2} / [~g~8~s~] Ablehnen',
31 | admin_removed = "Hot Dog Stand Eingelagert.",
32 | label_a = "Perfekt (A)",
33 | label_b = "Selten (B)",
34 | label_c = "Gewöhnlich (C)"
35 | }
36 | }
37 |
38 | if GetConvar('qb_locale', 'en') == 'de' then
39 | Lang = Locale:new({
40 | phrases = Translations,
41 | warnOnMissing = true,
42 | fallbackLang = Lang,
43 | })
44 | end
45 |
--------------------------------------------------------------------------------
/locales/en.lua:
--------------------------------------------------------------------------------
1 | local Translations = {
2 | error = {
3 | no_money = 'Not enough money',
4 | too_far = 'You are too far from your Hot Dog Stand',
5 | no_stand = 'You do not have a hotdog stand',
6 | cust_refused = 'Customer Refused!',
7 | no_stand_found = 'Your hot dog stand was nowhere to be seen, You will not receive your deposit back!',
8 | no_more = 'You have no %{value} more about this in front of council',
9 | deposit_notreturned = 'You did not have a Hot Dog Stand',
10 | no_dogs = 'You do not have any hotdogs',
11 | },
12 | success = {
13 | deposit = 'You paid a $%{deposit} deposit!',
14 | deposit_returned = 'Your $%{deposit} deposit has been returned!',
15 | sold_hotdogs = '%{value} x Hotdog(\'s) sold for $%{value2}',
16 | made_hotdog = 'You made a %{value} Hot Dogs',
17 | made_luck_hotdog = 'You made %{value} x %{value2} Hot Dogs',
18 | },
19 | info = {
20 | command = "Delete Stand (Admin Only)",
21 | blip_name = 'Hotdog Stand',
22 | start_working = '[E] Start Working',
23 | start_work = 'Start Working',
24 | stop_working = '[E] Stop Working',
25 | stop_work = 'Stop Working',
26 | grab_stall = '[~g~G~s~] Grab Stall',
27 | drop_stall = '[~g~G~s~] Release Stall',
28 | grab = 'Grab Stall',
29 | prepare = 'Prepare Hotdog',
30 | toggle_sell = 'Toggle Selling',
31 | selling_prep = '[~g~E~s~] Hotdog prepare [Sale: ~g~Selling~w~]',
32 | not_selling = '[~g~E~s~] Hotdog prepare [Sale: ~r~Not Selling~w~]',
33 | sell_dogs = '[~g~7~s~] Sell %{value} x HotDogs for $%{value2} / [~g~8~s~] Reject',
34 | sell_dogs_target = 'Sell %{value} x HotDogs for $%{value2}',
35 | admin_removed = "Hot Dog Stand Removed",
36 | label_a = "Perfect (A)",
37 | label_b = "Rare (B)",
38 | label_c = "Common (C)"
39 | },
40 | keymapping = {
41 | gkey = 'Let go of hotdog stand',
42 |
43 | }
44 | }
45 |
46 | Lang = Lang or Locale:new({
47 | phrases = Translations,
48 | warnOnMissing = true
49 | })
50 |
--------------------------------------------------------------------------------
/locales/fr.lua:
--------------------------------------------------------------------------------
1 | local Translations = {
2 | error = {
3 | no_money = 'Pas assez d\'argent',
4 | too_far = 'Vous êtes trop loin de votre Stand à Hot-Dogs',
5 | no_stand = 'Vous n\'avez pas de Stand à Hot-Dogs',
6 | cust_refused = 'Client refusé!',
7 | no_stand_found = 'Votre Stand à Hot-Dogs est introuvable, Vous ne recevrez pas votre accompte!',
8 | no_more = 'Vous n\'avez pas %{value} de plus à ce sujet devant le conseil', --no idea how to translate that
9 | deposit_notreturned = 'Vous n\'aviez pas de Stand à Hot-Dogs',
10 | },
11 | success = {
12 | deposit = 'Vous avez payé un accompte de %{deposit}$!',
13 | deposit_returned = 'Votre accompte de %{deposit}$ vous a été rendu!',
14 | sold_hotdogs = '%{value} x Hotdog(\'s) vendu pour $%{value2}',
15 | made_hotdog = 'Vous avez fait un Hot-Dogs de qualité %{value}',
16 | made_luck_hotdog = 'Vous avez fait %{value} x %{value2} Hot-Dogs',
17 | },
18 | info = {
19 | command = "Détruire le Stand à Hot-Dogs (Admin Only)",
20 | blip_name = 'Stand Hot-Dogs',
21 | start_working = '[~g~E~s~] Commencer a travailler',
22 | start_work = 'Commencer a travailler',
23 | stop_working = '[~g~E~s~] Arrêter de travailler',
24 | stop_work = 'Arrêter de travailler',
25 | grab_stall = '[~g~G~s~] Prendre le Stand',
26 | drop_stall = '[~g~G~s~] Lacher le Stand',
27 | grab = 'Prendre le Stand',
28 | selling_prep = '[~g~E~s~] Préparer un Hot-Dogs [Sale: ~g~En vente~w~]',
29 | not_selling = '[~g~E~s~] Préparer un Hot-Dogs [Sale: ~r~Pas en vente~w~]',
30 | sell_dogs = '[~g~7~s~] Vendre %{value} x Hot-Dogs pour $%{value2} / [~g~8~s~] Rejeter',
31 | admin_removed = "Stand à Hot-Dogs retiré",
32 | label_a = "Parfait (A)",
33 | label_b = "Rare (B)",
34 | label_c = "Commun (C)"
35 | },
36 | keymapping = {
37 | gkey = 'Abandonnez le stand de Hot-Dogs',
38 |
39 | }
40 | }
41 |
42 | if GetConvar('qb_locale', 'en') == 'fr' then
43 | Lang = Locale:new({
44 | phrases = Translations,
45 | warnOnMissing = true,
46 | fallbackLang = Lang,
47 | })
48 | end
49 |
--------------------------------------------------------------------------------
/locales/et.lua:
--------------------------------------------------------------------------------
1 | local Translations = {
2 | error = {
3 | no_money = 'Pole piisavalt raha!',
4 | too_far = 'Olete oma Hot Dog Standist liiga kaugel',
5 | no_stand = 'Teil ei ole hotdogi alust',
6 | cust_refused = 'Klient keeldus!',
7 | no_stand_found = 'Teie hot dogi kioski polnud kuskil näha, Te ei saa oma tagatisraha tagasi!',
8 | no_more = 'Teil pole selle kohta volikogu ees %{value} rohkem',
9 | deposit_notreturned = 'Teil ei olnud Hot Dogi Standi',
10 | no_dogs = 'Teil pole hotdoge',
11 | },
12 | success = {
13 | deposit = 'Maksite sissemakse $%{deposit}!',
14 | deposit_returned = 'Teie sissemakse $%{deposit} on tagastatud!',
15 | sold_hotdogs = '%{value} x Hotdog(id) müüdi hinnaga $%{value2}',
16 | made_hotdog = 'Tegite %{value} hot Dogi',
17 | made_luck_hotdog = 'Tegite %{value} x %{value2} hot Dogi',
18 | },
19 | info = {
20 | command = "Kustuta alus (ainult administraator)",
21 | blip_name = 'HotDogi kiosk',
22 | start_working = '[E] Alusta töötamist',
23 | start_work = 'Alusta töötamist',
24 | stop_working = '[E] Lõpeta töötamine',
25 | stop_work = 'Lõpeta töötamine',
26 | grab_stall = '[~g~G~s~] Haara Stall',
27 | drop_stall = '[~g~G~s~] Vabastage Stall',
28 | grab = 'Haara Stall',
29 | prepare = 'Valmistage HotDogi',
30 | toggle_sell = 'Lülitage müümine sisse',
31 | selling_prep = '[~g~E~s~] Hotdog valmistada [Müük: ~g~Müün~w~]',
32 | not_selling = '[~g~E~s~] Hotdog valmistada [Müük: ~r~Ei müü~w~]',
33 | sell_dogs = '[~g~7~s~] Müü %{value} x HotDogs hinnaga $%{value2} / [~g~8~s~] Keeldu',
34 | sell_dogs_target = 'Müü %{value} x HotDogs hinnaga $%{value2}',
35 | admin_removed = "Hot Dogi Stand eemaldatud",
36 | label_a = "Täiuslik (A)",
37 | label_b = "Harv (B)",
38 | label_c = "Tavaline (C)"
39 | },
40 | keymapping = {
41 | gkey = 'Laske hotdogi alus lahti',
42 |
43 | }
44 | }
45 |
46 | if GetConvar('qb_locale', 'en') == 'et' then
47 | Lang = Locale:new({
48 | phrases = Translations,
49 | warnOnMissing = true,
50 | fallbackLang = Lang,
51 | })
52 | end
53 |
--------------------------------------------------------------------------------
/locales/nl.lua:
--------------------------------------------------------------------------------
1 | local Translations = {
2 | error = {
3 | no_money = 'Je hebt niet genoeg geld',
4 | too_far = 'Je bent te ver van je stand',
5 | no_stand = 'Je hebt geen hotdog stand',
6 | cust_refused = 'Klant geweigerd!',
7 | no_stand_found = 'We vinden je hotdog stand niet terug, je krijgt je waarbog niet terug!',
8 | no_more = 'Je hebt geen %{value} meer hierover in de raad.',
9 | deposit_notreturned = 'Je hebt geen hotdog stand meer',
10 | no_dogs = 'Je hebt geen hotdogs',
11 | },
12 | success = {
13 | deposit = 'Je hebt een borg van $%{deposit} betaald!',
14 | deposit_returned = 'Je borg van $%{deposit} is teruggestort!',
15 | sold_hotdogs = '%{value} x Hotdog(s) verkocht voor $%{value2}',
16 | made_hotdog = 'Je hebt %{value} Hot Dogs gemaakt',
17 | made_luck_hotdog = 'Je hebt %{value} x %{value2} Hot Dogs gemaakt',
18 | },
19 | info = {
20 | command = "Stand verwijderen (Admin Only)",
21 | blip_name = 'Hotdog Stand',
22 | start_working = '[E] Start met werken',
23 | start_work = 'Start met werken',
24 | stop_working = '[E] Stop met werken',
25 | stop_work = 'Stop met werken',
26 | grab_stall = '[~g~G~s~] Pak kraam vast',
27 | drop_stall = '[~g~G~s~] Laat kraam los',
28 | grab = 'Pak kraam',
29 | prepare = 'Hotdog bereiden',
30 | toggle_sell = 'Verkopen',
31 | selling_prep = '[~g~E~s~] Hotdog bereiden [Sale: ~g~verkopen~w~]',
32 | not_selling = '[~g~E~s~] Hotdog bereiden [Sale: ~r~niet verkopen~w~]',
33 | sell_dogs = '[~g~7~s~] Verkoop %{value} x HotDogs voor $%{value2} / [~g~8~s~] afwijzen',
34 | sell_dogs_target = 'Verkoop %{value} x HotDogs voor $%{value2}',
35 | admin_removed = "Hot Dog Stand verwijderd",
36 | label_a = "Perfect (A)",
37 | label_b = "goed (B)",
38 | label_c = "matig (C)",
39 | },
40 | keymapping = {
41 | gkey = 'Laat je kraam los',
42 |
43 | }
44 | }
45 |
46 | if GetConvar('qb_locale', 'en') == 'nl' then
47 | Lang = Lang or Locale:new({
48 | phrases = Translations,
49 | warnOnMissing = true,
50 | fallbackLang = Lang,
51 | })
52 | end
53 |
--------------------------------------------------------------------------------
/locales/pt.lua:
--------------------------------------------------------------------------------
1 | local Translations = {
2 | error = {
3 | no_money = 'Dinheiro insuficiente',
4 | too_far = 'Estás muito longe do teu stand',
5 | no_stand = 'Não tens um stand de cachorros quentes',
6 | cust_refused = 'Cliente recusado!',
7 | no_stand_found = 'Não devolvemos o teu depósito, porque não entregaste o teu stand!',
8 | no_more = 'Não consegues carregar mais stock de %{value} no teu rank',
9 | deposit_notreturned = 'Não tens um stand de cachorros quentes',
10 | no_dogs = 'Não tens cachorros quentes',
11 | },
12 | success = {
13 | deposit = 'Pagaste um depósito de %{deposit}€ pelo stand!',
14 | deposit_returned = 'Recebeste um depósito de %{deposit}€ por entregares o stand!',
15 | sold_hotdogs = '%{value} x Cachorros Quente(\'s) vendidos por %{value2}€',
16 | made_hotdog = 'Fizeste %{value} Cachorros Quentes',
17 | made_luck_hotdog = 'Fizeste %{value} x %{value2} Cachorros Quentes',
18 | },
19 | info = {
20 | command = "Apagar Stand (Apenas Admin)",
21 | blip_name = 'Stand De Cachorros Quentes',
22 | start_working = '[~g~E~s~] Começar Trabalho',
23 | start_work = 'Começar Trabalho',
24 | stop_working = '[~g~E~s~] Parar Trabalho',
25 | stop_work = 'Parar Trabalho',
26 | grab_stall = '[~g~G~s~] Empurrar Stand',
27 | drop_stall = '[~g~G~s~] Soltar Stand',
28 | grab = 'Soltar Stand',
29 | prepare = 'Preparar cachorro-quente',
30 | toggle_sell = 'Ativar venda',
31 | selling_prep = '[~g~E~s~] A preparar cachorro [Vendas: ~g~Abertas~w~]',
32 | not_selling = '[~g~E~s~] A preparar cachorro [Vendas: ~r~Fechadas~w~]',
33 | sell_dogs = '[~g~7~s~] Vender %{value} x Cachorros por %{value2}€ / [~g~8~s~] Rejeitar',
34 | sell_dogs_target = 'Vender %{value} x Cachorros for $%{value2}€',
35 | admin_removed = "Stand De Cachorros Quentes Removido",
36 | label_a = "Perfeito (A)",
37 | label_b = "Raro (B)",
38 | label_c = "Comum (C)"
39 | },
40 | keymapping = {
41 | gkey = 'Apagar Stand de Cachorro Quentes',
42 | }
43 | }
44 |
45 | if GetConvar('qb_locale', 'en') == 'pt' then
46 | Lang = Locale:new({
47 | phrases = Translations,
48 | warnOnMissing = true,
49 | fallbackLang = Lang,
50 | })
51 | end
52 |
--------------------------------------------------------------------------------
/locales/pt-br.lua:
--------------------------------------------------------------------------------
1 | local Translations = {
2 | error = {
3 | no_money = 'Dinheiro insuficiente',
4 | too_far = 'Você está muito longe do seu Carrinho de Cachorro-Quente',
5 | no_stand = 'Você não possui um carrinho de cachorro-quente',
6 | cust_refused = 'Cliente recusou!',
7 | no_stand_found = 'Seu carrinho de cachorro-quente não estava em lugar algum. Você não receberá seu depósito de volta!',
8 | no_more = 'Você não tem mais %{value} em frente ao conselho',
9 | deposit_notreturned = 'Você não tinha um Carrinho de Cachorro-Quente',
10 | no_dogs = 'Você não tem nenhum cachorro-quente',
11 | },
12 | success = {
13 | deposit = 'Você pagou um depósito de $%{deposit}!',
14 | deposit_returned = 'Seu depósito de $%{deposit} foi devolvido!',
15 | sold_hotdogs = '%{value} x Cachorro(s)-Quente(s) vendido(s) por $%{value2}',
16 | made_hotdog = 'Você fez %{value} Cachorros-Quentes',
17 | made_luck_hotdog = 'Você fez %{value} x %{value2} Cachorros-Quentes',
18 | },
19 | info = {
20 | command = "Excluir Carrinho (Apenas para Administradores)",
21 | blip_name = 'Carrinho de Cachorro-Quente',
22 | start_working = '[E] Começar a Trabalhar',
23 | start_work = 'Começar a Trabalhar',
24 | stop_working = '[E] Parar de Trabalhar',
25 | stop_work = 'Parar de Trabalhar',
26 | grab_stall = '[~g~G~s~] Pegar Lugar',
27 | drop_stall = '[~g~G~s~] Liberar Lugar',
28 | grab = 'Pegar Lugar',
29 | prepare = 'Preparar Cachorro-Quente',
30 | toggle_sell = 'Alternar Venda',
31 | selling_prep = '[~g~E~s~] Preparar Cachorro-Quente [Venda: ~g~Vendendo~w~]',
32 | not_selling = '[~g~E~s~] Preparar Cachorro-Quente [Venda: ~r~Não Vendendo~w~]',
33 | sell_dogs = '[~g~7~s~] Vender %{value} x Cachorros-Quentes por $%{value2} / [~g~8~s~] Rejeitar',
34 | sell_dogs_target = 'Vender %{value} x Cachorros-Quentes por $%{value2}',
35 | admin_removed = "Carrinho de Cachorro-Quente Removido",
36 | label_a = "Perfeito (A)",
37 | label_b = "Raro (B)",
38 | label_c = "Comum (C)"
39 | },
40 | keymapping = {
41 | gkey = 'Solte o Carrinho de Cachorro-Quente',
42 | }
43 | }
44 |
45 | if GetConvar('qb_locale', 'en') == 'pt-br' then
46 | Lang = Locale:new({
47 | phrases = Translations,
48 | warnOnMissing = true,
49 | fallbackLang = Lang,
50 | })
51 | end
52 |
--------------------------------------------------------------------------------
/locales/ro.lua:
--------------------------------------------------------------------------------
1 | --[[
2 | Romanian language base translation
3 | Martin Riggs#0807 on Discord for any clarifications required
4 | ]]--
5 | local Translations = {
6 | error = {
7 | no_money = 'Nu ai suficienti bani',
8 | too_far = 'Esti prea departe de carutul de Hot Dog',
9 | no_stand = 'Nu ai un carut de Hot Dogs',
10 | cust_refused = 'Client refuzat!',
11 | no_stand_found = 'Se pare ca ai ratacit carutul de Hot Dog, ca atare, nu o sa primesti inapoi garantia depozitata!',
12 | no_more = 'Nu mai ai %{value} in fata consiliului :)',
13 | deposit_notreturned = 'Nu ai avut un carut de Hot Dogs',
14 | no_dogs = 'Se pare ca nu ai niciun Hod Dog!',
15 | },
16 | success = {
17 | deposit = 'Ai platit suma de $%{deposit} ca si garantie!',
18 | deposit_returned = 'Suma de $%{deposit} reprezentand garantia depusa, ti-a fost returnata!',
19 | sold_hotdogs = 'Ai vandut %{value} x Hotdog(\'s) pentru suma de $%{value2}',
20 | made_hotdog = 'Ai preparat %{value} Hot Dogs',
21 | made_luck_hotdog = 'Ai preparat %{value} x %{value2} Hot Dogs',
22 | },
23 | info = {
24 | command = "Sterge carutul (Admin Only)",
25 | blip_name = 'Carut Hotdog',
26 | start_working = '[E]-Incepe munca',
27 | start_work = 'Incepe munca',
28 | stop_working = '[E]-Opreste munca',
29 | stop_work = 'Opreste munca',
30 | grab_stall = '[~g~G~s~]-Misca carutul',
31 | drop_stall = '[~g~G~s~]-Opreste carutul',
32 | grab = 'Misca carutul',
33 | prepare = 'Prepara un Hotdog',
34 | toggle_sell = 'Activeaza/dezactiveaza vanzarea',
35 | selling_prep = '[~g~E~s~]-Pregateste un hotdog [Vanzare: ~g~Activa~w~]',
36 | not_selling = '[~g~E~s~]-Pregateste un hotdog [Vanzare: ~r~Inactiva~w~]',
37 | sell_dogs = '[~g~7~s~] Vinde %{value} x HotDogs pentru suma de $%{value2} / [~g~8~s~] Refuza',
38 | sell_dogs_target = 'Vinde %{value} x HotDogs pentru suma de $%{value2}',
39 | admin_removed = "Carutul de Hot Dog a fost sters",
40 | label_a = "Perfect (A)",
41 | label_b = "Rar (B)",
42 | label_c = "Normal (C)"
43 | },
44 | keymapping = {
45 | gkey = 'Da drumul carutului de Hot Dog',
46 | }
47 | }
48 |
49 | if GetConvar('qb_locale', 'en') == 'ro' then
50 | Lang = Locale:new({
51 | phrases = Translations,
52 | warnOnMissing = true,
53 | fallbackLang = Lang,
54 | })
55 | end
56 |
--------------------------------------------------------------------------------
/locales/es.lua:
--------------------------------------------------------------------------------
1 | local Translations = {
2 | error = {
3 | no_money = 'No hay suficiente dinero',
4 | too_far = 'Estás demasiado lejos de tu puesto de perritos calientes',
5 | no_stand = 'No tienes un puesto de perritos calientes',
6 | cust_refused = '¡Cliente rechazado!',
7 | no_stand_found = 'Su puesto de perritos calientes no aparece por ningún lado, ¡No recibirá su depósito de vuelta!',
8 | no_more = 'No tiene %{valor} más sobre esto frente al consejo',
9 | deposit_notreted = 'Usted no tenía un puesto de perritos calientes',
10 | no_dogs = 'Usted no tiene ningún hotdogs',
11 | },
12 | success = {
13 | deposit = '¡Ha pagado un depósito de $%{deposit}!',
14 | deposit_returned = '¡Su depósito de $%{deposit} ha sido devuelto!',
15 | sold_hotdogs = '%{value} x Hotdog(s) vendidos por $%{value2}',
16 | made_hotdog = 'Has hecho un %{valor} perritos calientes',
17 | made_luck_hotdog = 'Has hecho %{valor} x %{valor2} perritos calientes',
18 | },
19 | info = {
20 | command = "Borrar puesto (sólo para administradores)",
21 | blip_name = 'Puesto de perritos calientes',
22 | start_working = '[E] Empezar a trabajar',
23 | start_work = 'Empezar a trabajar',
24 | stop_working = '[E] Dejar de trabajar',
25 | stop_work = 'Dejar de trabajar',
26 | grab_stall = '[~g~G~s~] Tomar puesto',
27 | drop_stall = '[~g~G~s~] dejar puesto',
28 | grab = 'Puesto de agarre',
29 | prepare = 'Preparar perro caliente',
30 | toggle_sell = 'Alternar la venta',
31 | selling_prep = '[~g~E~s~] preparar perro caliente [Venta: ~g~Vendiendo~w~]',
32 | not_selling = '[~g~E~s~] Hotdog prepare [Sale: ~r~Not Selling~w~]',
33 | sell_dogs = '[~g~7~s~] Vender %{value} x perros caliente por $%{value2} / [~g~8~s~] Rechazar',
34 | sell_dogs_target = 'Vender %{value} x perros caliente por $%{value2}',
35 | admin_removed = "Puesto de perritos calientes eliminado",
36 | label_a = "Perfecto (A)",
37 | label_b = "Raro (B)",
38 | label_c = "Común (C)"
39 | },
40 | keymapping = {
41 | gkey = 'Deja el puesto de perritos calientes',
42 |
43 | }
44 | }
45 |
46 | if GetConvar('qb_locale', 'en') == 'es' then
47 | Lang = Locale:new({
48 | phrases = Translations,
49 | warnOnMissing = true,
50 | fallbackLang = Lang,
51 | })
52 | end
53 |
--------------------------------------------------------------------------------
/config.lua:
--------------------------------------------------------------------------------
1 | Config = Config or {}
2 | Config.UseTarget = GetConvar('UseTarget', 'false') == 'true'
3 | -- Config --
4 |
5 | Config.StandDeposit = 250
6 |
7 | Config.MyLevel = 1
8 | Config.MaxReputation = 200
9 |
10 | Config.Locations = {
11 | ["take"] = {
12 | coords = vector4(39.31, -1005.54, 29.48, 240.57),
13 | },
14 | ["spawn"] = {
15 | coords = vector4(38.15, -1001.65, 29.44, 342.5),
16 | },
17 | }
18 |
19 | Config.Stock = {
20 | ["exotic"] = {
21 | Current = 0,
22 | Max = {
23 | [1] = 15,
24 | [2] = 30,
25 | [3] = 45,
26 | [4] = 60,
27 | },
28 | Label = Lang:t("info.label_a"),
29 | Price = {
30 | [1] = {
31 | min = 8,
32 | max = 12,
33 | },
34 | [2] = {
35 | min = 9,
36 | max = 13,
37 | },
38 | [3] = {
39 | min = 10,
40 | max = 14,
41 | },
42 | [4] = {
43 | min = 11,
44 | max = 15,
45 | },
46 | }
47 | },
48 | ["rare"] = {
49 | Current = 0,
50 | Max = {
51 | [1] = 15,
52 | [2] = 30,
53 | [3] = 45,
54 | [4] = 60,
55 | },
56 | Label = Lang:t("info.label_b"),
57 | Price = {
58 | [1] = {
59 | min = 6,
60 | max = 9,
61 | },
62 | [2] = {
63 | min = 7,
64 | max = 10,
65 | },
66 | [3] = {
67 | min = 8,
68 | max = 11,
69 | },
70 | [4] = {
71 | min = 9,
72 | max = 12,
73 | },
74 | }
75 | },
76 | ["common"] = {
77 | Current = 0,
78 | Max = {
79 | [1] = 15,
80 | [2] = 30,
81 | [3] = 45,
82 | [4] = 60,
83 | },
84 | Label = Lang:t('info.label_c'),
85 | Price = {
86 | [1] = {
87 | min = 4,
88 | max = 6,
89 | },
90 | [2] = {
91 | min = 5,
92 | max = 7,
93 | },
94 | [3] = {
95 | min = 6,
96 | max = 9,
97 | },
98 | [4] = {
99 | min = 7,
100 | max = 9,
101 | },
102 | }
103 | },
104 | }
105 |
--------------------------------------------------------------------------------
/server/main.lua:
--------------------------------------------------------------------------------
1 | local QBCore = exports['qb-core']:GetCoreObject()
2 | local Bail = {}
3 |
4 | -- Callbacks
5 |
6 | QBCore.Functions.CreateCallback('qb-hotdogjob:server:HasMoney', function(source, cb)
7 | local Player = QBCore.Functions.GetPlayer(source)
8 |
9 | if Player.PlayerData.money.bank >= Config.StandDeposit then
10 | Player.Functions.RemoveMoney('bank', Config.StandDeposit, 'hot dog deposit')
11 | Bail[Player.PlayerData.citizenid] = true
12 | cb(true)
13 | else
14 | Bail[Player.PlayerData.citizenid] = false
15 | cb(false)
16 | end
17 | end)
18 |
19 | QBCore.Functions.CreateCallback('qb-hotdogjob:server:BringBack', function(source, cb)
20 | local Player = QBCore.Functions.GetPlayer(source)
21 |
22 | if Bail[Player.PlayerData.citizenid] then
23 | Player.Functions.AddMoney('bank', Config.StandDeposit, 'hot dog deposit')
24 | cb(true)
25 | else
26 | cb(false)
27 | end
28 | end)
29 |
30 | -- Events
31 |
32 | RegisterNetEvent('qb-hotdogjob:server:Sell', function(coords, amount, price)
33 | local src = source
34 | local pCoords = GetEntityCoords(GetPlayerPed(src))
35 | local Player = QBCore.Functions.GetPlayer(src)
36 | if not Player then return end
37 | if #(pCoords - coords) > 4 then exports['qb-core']:ExploitBan(src, 'hotdog job') end
38 | Player.Functions.AddMoney('cash', tonumber(amount * price), 'sold hotdog')
39 | end)
40 |
41 | RegisterNetEvent('qb-hotdogjob:server:UpdateReputation', function(quality)
42 | local src = source
43 | local Player = QBCore.Functions.GetPlayer(src)
44 | if quality == 'exotic' then
45 | if Player.Functions.GetRep('hotdog') + 3 > Config.MaxReputation then
46 | Player.Functions.AddRep('hotdog', Config.MaxReputation - Player.Functions.GetRep('hotdog'))
47 | else
48 | Player.Functions.AddRep('hotdog', 3)
49 | end
50 | elseif quality == 'rare' then
51 | if Player.Functions.GetRep('hotdog') + 2 > Config.MaxReputation then
52 | Player.Functions.AddRep('hotdog', Config.MaxReputation - Player.Functions.GetRep('hotdog'))
53 | else
54 | Player.Functions.AddRep('hotdog', 2)
55 | end
56 | elseif quality == 'common' then
57 | if Player.Functions.GetRep('hotdog') + 1 > Config.MaxReputation then
58 | Player.Functions.AddRep('hotdog', Config.MaxReputation - Player.Functions.GetRep('hotdog'))
59 | else
60 | Player.Functions.AddRep('hotdog', 1)
61 | end
62 | end
63 |
64 | TriggerClientEvent('qb-hotdogjob:client:UpdateReputation', src, Player.PlayerData.metadata['rep'])
65 | end)
66 |
67 | -- Commands
68 |
69 | QBCore.Commands.Add('removestand', Lang:t('info.command'), {}, false, function(source, _)
70 | TriggerClientEvent('qb-hotdogjob:staff:DeletStand', source)
71 | end, 'admin')
72 |
--------------------------------------------------------------------------------
/.github/contributing.md:
--------------------------------------------------------------------------------
1 | # Contributing to QBCore
2 |
3 | First of all, thank you for taking the time to contribute!
4 |
5 | These guidelines will help you help us in the best way possible regardless of your skill level. We ask that you try to read everything related to the way you'd like to contribute and try and use your best judgement for anything not covered.
6 |
7 | ### Table of Contents
8 |
9 | [Code of Conduct](#code-of-conduct)
10 |
11 | [I don't want to read this whole thing, I just have a question!!!](#i-dont-want-to-read-this-whole-thing-i-just-have-a-question)
12 |
13 | [How Can I Contribute?](#how-can-i-contribute)
14 | * [Reporting Bugs](#reporting-bugs)
15 | * [Suggesting Features / Enhancements](#suggesting-features--enhancements)
16 | * [Your First Code Contribution](#your-first-code-contribution)
17 | * [Pull Requests](#pull-requests)
18 |
19 | [Styleguides](#styleguides)
20 | * [Git Commit Messages](#git-commit-messages)
21 | * [Lua Styleguide](#lua-styleguide)
22 | * [JavaScript Styleguide](#javascript-styleguide)
23 |
24 |
25 |
26 | ## Code of Conduct
27 |
28 | - Refrain from using languages other than English.
29 | - Refrain from discussing any politically charged or inflammatory topics.
30 | - Uphold mature conversations and respect each other; excessive profanity, hate speech or any kind of harassment will not be tolerated.
31 | - No advertising of any kind.
32 | - Follow these guidelines.
33 | - Do not mention members of github unless a question is directed at them and can't be answered by anyone else.
34 | - Do not mention any of the development team for any reason. We will read things as we get to them.
35 |
36 | ## I don't want to read this whole thing I just have a question!!!
37 |
38 | > **Note:** Please don't file an issue to ask a question. You'll get faster results by using the resources below.
39 |
40 | * [QBCore Website](https://qbcore.org)
41 | * [QBCore Discord](https://discord.gg/qbcore)
42 | * [FiveM Discord - #qbcore channel](https://discord.gg/fivem)
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 | ## How Can I Contribute?
54 |
55 | ### Reporting Bugs
56 |
57 | The easiest way to contribute for most people is just to report bugs you find cause if nobody reports it there's a chance we'll never know it exists and then we'll never fix it.
58 |
59 | Before creating bug reports, please check [this list](#before-submitting-a-bug-report) as you might find out that you don't need to create one. When you are creating a bug report, please [include as many details as possible](#how-do-i-submit-a-good-bug-report). Fill out the bug-report template with the information it asks for helps us resolve issues faster.
60 |
61 | > **Note:** If you find a **Closed** issue that seems like it is the same thing that you're experiencing, open a new issue and include a link to the original issue in the body of your new one.
62 |
63 | #### Before Submitting A Bug Report
64 |
65 | * **Check the docs** There's a chance what you see as a bug might just work differently than you expect and if you think it could work better consider a feature enhancement report instead.
66 | * **Search the [discord](https://discord.gg/qbcore)** to see if anyone else has run into the issue and see if it was solved through user error or code changes. (if the code change isn't pending a PR and you know what you're doing consider submitting one following [Pull Requests](#pull-requests) )
67 | * **Determine which resource the problem should be reported in**. If the bug is related to the inventory for example report this bug under qb-inventory rather than under qb-core or some other resource.
68 | * **Perform a [cursory search](https://github.com/search?q=+is%3Aissue+user%3Aqbcore-framework)** to see if the problem has already been reported. If it has **and the issue is still open**, add a comment to the existing issue instead of opening a new one.
69 |
70 | #### How Do I Submit A (Good) Bug Report?
71 |
72 | Bugs are tracked as [GitHub issues](https://guides.github.com/features/issues/). After you've determined which resource your bug is related to, create an issue on that repository and provide the following information by filling in bug-report template.
73 |
74 | Explain the problem and include additional details to help maintainers reproduce the problem:
75 |
76 | * **Use a clear and descriptive title** for the issue to identify the problem.
77 | * **Describe the exact steps which reproduce the problem** in as many details as possible.
78 | * **Provide specific examples to demonstrate the steps**. If something happened with only a specific group or single item but not others, specify that.
79 | * **Describe the behavior you observed after following the steps** and point out what exactly is the problem with that behavior.
80 | * **Explain which behavior you expected to see instead and why.**
81 | * **Include screenshots** which show the specific bug in action or before and after.
82 | * **If the problem wasn't triggered by a specific action**, describe what you were doing before the problem happened and share more information using the guidelines below.
83 |
84 | Provide more context by answering these questions if possible:
85 |
86 | * **Did the problem start happening recently** (e.g. after updating to a new version of QBCore?) or was this always a problem?
87 | * If the problem started happening recently, **can you reproduce the problem in an older version of QBCore?** What's the most recent commit in which the problem doesn't happen?
88 | * **Can you reliably reproduce the issue?** If not, provide details about how often the problem happens and under which conditions it normally happens.
89 |
90 | Include details about your setup:
91 |
92 | * **When was your QBCore last updated?**
93 | * **What OS is the server running on**?
94 | * **Which *extra* resources do you have installed?**
95 |
96 |
97 | ---
98 |
99 |
100 | ### Suggesting Features / Enhancements
101 |
102 | This section guides you through submitting an enhancement suggestion for QBCore, including completely new features and minor improvements to existing functionality. Following these guidelines helps maintainers and the community understand your suggestion.
103 |
104 | Before creating enhancement suggestions, please check [this list](#before-submitting-an-enhancement-suggestion) as you might find out that you don't need to create one. When you are creating an enhancement suggestion, please [include as many details as possible](#how-do-i-submit-a-good-enhancement-suggestion). Fill in feature request template, including the steps that you imagine you would take if the feature you're requesting existed.
105 |
106 | #### Before Submitting An Enhancement Suggestion
107 |
108 | * **Make sure it doesn't already exist.** Sounds silly, but there's a lot of features built in to qbcore that people don't realize so take a look through the docs and stuff to make sure it's not already there.
109 | * **Check if there's already PR which provides that enhancement.**
110 | * **Determine which resource the enhancement should be suggested in.** if it fits with another resource suggest it in that resource. if it would be it's own resource suggest it in the main qb-core repository.
111 | * **Perform a [cursory search](https://github.com/search?q=+is%3Aissue+user%3Aqbcore-framework)** to see if the enhancement has already been suggested. If it has, add a comment to the existing issue instead of opening a new one.
112 |
113 | #### How Do I Submit A (Good) Enhancement Suggestion?
114 |
115 | Enhancement suggestions are tracked as [GitHub issues](https://guides.github.com/features/issues/). After you've determined which resource your enhancement suggestion is related to, create an issue on that repository and provide the following information:
116 |
117 | * **Use a clear and descriptive title** for the issue to identify the suggestion.
118 | * **Provide a step-by-step description of the suggested enhancement** in as many details as possible.
119 | * **Provide specific examples to demonstrate the steps**. Include copy/pasteable snippets which you use in those examples, as [Markdown code blocks](https://help.github.com/articles/markdown-basics/#multiple-lines).
120 | * **Describe the current behavior** and **explain which behavior you expected to see instead** and why.
121 | * **Include screenshots and animated GIFs** which help you demonstrate the steps or point out the part of QBCore which the suggestion is related to.
122 | * **Explain why this enhancement would be useful.**
123 | * **Be creative and unique.** Stealing ideas from popular servers 1:1 detail isn't going to get accepted.
124 |
125 |
126 | ---
127 |
128 |
129 |
130 | ### Your First Code Contribution
131 |
132 | Unsure where to begin contributing to QBCore? You can start by looking through these `beginner` and `help-wanted` issues.
133 |
134 |
135 |
136 | ---
137 |
138 |
139 | ### Pull Requests
140 |
141 | The process described here has several goals:
142 |
143 | - Maintain QBCore's quality.
144 | - Fix problems that are important to users.
145 | - Engage the community in working toward the best possible QBCore.
146 | - Enable a sustainable system for QBCore's maintainers to review contributions.
147 |
148 | Please follow these steps to have your contribution considered by the maintainers:
149 |
150 | 1. Follow all instructions in The Pull Request template.
151 | 2. Follow the [styleguides](#styleguides).
152 | 3. Await review by the reviewer(s).
153 |
154 | While the prerequisites above must be satisfied prior to having your pull request reviewed, the reviewer(s) may ask you to complete additional design work, tests, or other changes before your pull request can be ultimately accepted.
155 |
156 |
157 | ---
158 |
159 | ## Styleguides
160 |
161 | ### Git Commit Messages
162 |
163 | * Limit the first line to 72 characters or less.
164 | * Reference issues and pull requests liberally after the first line.
165 | * Consider starting the commit message with an applicable emoji:
166 | * :art: `:art:` when improving the format/structure of the code
167 | * :racehorse: `:racehorse:` when improving performance
168 | * :memo: `:memo:` when writing docs
169 | * :bug: `:bug:` when fixing a bug
170 | * :fire: `:fire:` when removing code or files
171 | * :white_check_mark: `:white_check_mark:` when adding tests
172 | * :lock: `:lock:` when dealing with security
173 | * :arrow_up: `:arrow_up:` when upgrading dependencies
174 | * :arrow_down: `:arrow_down:` when downgrading dependencies
175 | * :shirt: `:shirt:` when removing linter warnings
176 |
177 | ### Lua Styleguide
178 |
179 | All lua code should be done using all the best practices of proper lua using the easiest to read yet fastest/most optimized methods of execution.
180 |
181 | - Use 4 Space indentation
182 | - Aim for lua 5.4 (include `lua54 'yes'` in the fxmanifest.lua)
183 | - Use `PlayerPedId()` instead of `GetPlayerPed(-1)`
184 | - Use `#(vector3 - vector3)` instead of `GetDistanceBetweenCoords()`
185 | - Don't create unnecessary threads. always try to find a better method of triggering events
186 | - Don't repeat yourself.. if you're using the same operations in many different places convert them into a function with flexible variables
187 | - For distance checking loops set longer waits if you're outside of a range
188 | - Job specific loops should only run for players with that job, don't waste cycles
189 | - When possible don't trust the client, esspecially with transactions
190 | - Balance security and optimizations
191 | - [Consider this Lua Performance guide](https://springrts.com/wiki/Lua_Performance)
192 | - Use local varriables everywhere possible
193 | - Make use of config options where it makes sense making features optional or customizable
194 | - Instead of `table.insert(myTable, "Value")` use `myTable[#myTable + 1] = "Value"`
195 | - Instead of `table.insert(ages, "bob", 30)` use `ages["bob"] = 30`
196 |
197 |
198 | ### JavaScript Styleguide
199 |
200 | - Use 4 Space indentation
201 | - Don't repeat yourself.. if you're using the same operations in many different places convert them into a function with flexible variables.
202 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | GNU GENERAL PUBLIC LICENSE
2 | Version 3, 29 June 2007
3 |
4 | Copyright (C) 2007 Free Software Foundation, Inc.
5 | Everyone is permitted to copy and distribute verbatim copies
6 | of this license document, but changing it is not allowed.
7 |
8 | Preamble
9 |
10 | The GNU General Public License is a free, copyleft license for
11 | software and other kinds of works.
12 |
13 | The licenses for most software and other practical works are designed
14 | to take away your freedom to share and change the works. By contrast,
15 | the GNU General Public License is intended to guarantee your freedom to
16 | share and change all versions of a program--to make sure it remains free
17 | software for all its users. We, the Free Software Foundation, use the
18 | GNU General Public License for most of our software; it applies also to
19 | any other work released this way by its authors. You can apply it to
20 | your programs, too.
21 |
22 | When we speak of free software, we are referring to freedom, not
23 | price. Our General Public Licenses are designed to make sure that you
24 | have the freedom to distribute copies of free software (and charge for
25 | them if you wish), that you receive source code or can get it if you
26 | want it, that you can change the software or use pieces of it in new
27 | free programs, and that you know you can do these things.
28 |
29 | To protect your rights, we need to prevent others from denying you
30 | these rights or asking you to surrender the rights. Therefore, you have
31 | certain responsibilities if you distribute copies of the software, or if
32 | you modify it: responsibilities to respect the freedom of others.
33 |
34 | For example, if you distribute copies of such a program, whether
35 | gratis or for a fee, you must pass on to the recipients the same
36 | freedoms that you received. You must make sure that they, too, receive
37 | or can get the source code. And you must show them these terms so they
38 | know their rights.
39 |
40 | Developers that use the GNU GPL protect your rights with two steps:
41 | (1) assert copyright on the software, and (2) offer you this License
42 | giving you legal permission to copy, distribute and/or modify it.
43 |
44 | For the developers' and authors' protection, the GPL clearly explains
45 | that there is no warranty for this free software. For both users' and
46 | authors' sake, the GPL requires that modified versions be marked as
47 | changed, so that their problems will not be attributed erroneously to
48 | authors of previous versions.
49 |
50 | Some devices are designed to deny users access to install or run
51 | modified versions of the software inside them, although the manufacturer
52 | can do so. This is fundamentally incompatible with the aim of
53 | protecting users' freedom to change the software. The systematic
54 | pattern of such abuse occurs in the area of products for individuals to
55 | use, which is precisely where it is most unacceptable. Therefore, we
56 | have designed this version of the GPL to prohibit the practice for those
57 | products. If such problems arise substantially in other domains, we
58 | stand ready to extend this provision to those domains in future versions
59 | of the GPL, as needed to protect the freedom of users.
60 |
61 | Finally, every program is threatened constantly by software patents.
62 | States should not allow patents to restrict development and use of
63 | software on general-purpose computers, but in those that do, we wish to
64 | avoid the special danger that patents applied to a free program could
65 | make it effectively proprietary. To prevent this, the GPL assures that
66 | patents cannot be used to render the program non-free.
67 |
68 | The precise terms and conditions for copying, distribution and
69 | modification follow.
70 |
71 | TERMS AND CONDITIONS
72 |
73 | 0. Definitions.
74 |
75 | "This License" refers to version 3 of the GNU General Public License.
76 |
77 | "Copyright" also means copyright-like laws that apply to other kinds of
78 | works, such as semiconductor masks.
79 |
80 | "The Program" refers to any copyrightable work licensed under this
81 | License. Each licensee is addressed as "you". "Licensees" and
82 | "recipients" may be individuals or organizations.
83 |
84 | To "modify" a work means to copy from or adapt all or part of the work
85 | in a fashion requiring copyright permission, other than the making of an
86 | exact copy. The resulting work is called a "modified version" of the
87 | earlier work or a work "based on" the earlier work.
88 |
89 | A "covered work" means either the unmodified Program or a work based
90 | on the Program.
91 |
92 | To "propagate" a work means to do anything with it that, without
93 | permission, would make you directly or secondarily liable for
94 | infringement under applicable copyright law, except executing it on a
95 | computer or modifying a private copy. Propagation includes copying,
96 | distribution (with or without modification), making available to the
97 | public, and in some countries other activities as well.
98 |
99 | To "convey" a work means any kind of propagation that enables other
100 | parties to make or receive copies. Mere interaction with a user through
101 | a computer network, with no transfer of a copy, is not conveying.
102 |
103 | An interactive user interface displays "Appropriate Legal Notices"
104 | to the extent that it includes a convenient and prominently visible
105 | feature that (1) displays an appropriate copyright notice, and (2)
106 | tells the user that there is no warranty for the work (except to the
107 | extent that warranties are provided), that licensees may convey the
108 | work under this License, and how to view a copy of this License. If
109 | the interface presents a list of user commands or options, such as a
110 | menu, a prominent item in the list meets this criterion.
111 |
112 | 1. Source Code.
113 |
114 | The "source code" for a work means the preferred form of the work
115 | for making modifications to it. "Object code" means any non-source
116 | form of a work.
117 |
118 | A "Standard Interface" means an interface that either is an official
119 | standard defined by a recognized standards body, or, in the case of
120 | interfaces specified for a particular programming language, one that
121 | is widely used among developers working in that language.
122 |
123 | The "System Libraries" of an executable work include anything, other
124 | than the work as a whole, that (a) is included in the normal form of
125 | packaging a Major Component, but which is not part of that Major
126 | Component, and (b) serves only to enable use of the work with that
127 | Major Component, or to implement a Standard Interface for which an
128 | implementation is available to the public in source code form. A
129 | "Major Component", in this context, means a major essential component
130 | (kernel, window system, and so on) of the specific operating system
131 | (if any) on which the executable work runs, or a compiler used to
132 | produce the work, or an object code interpreter used to run it.
133 |
134 | The "Corresponding Source" for a work in object code form means all
135 | the source code needed to generate, install, and (for an executable
136 | work) run the object code and to modify the work, including scripts to
137 | control those activities. However, it does not include the work's
138 | System Libraries, or general-purpose tools or generally available free
139 | programs which are used unmodified in performing those activities but
140 | which are not part of the work. For example, Corresponding Source
141 | includes interface definition files associated with source files for
142 | the work, and the source code for shared libraries and dynamically
143 | linked subprograms that the work is specifically designed to require,
144 | such as by intimate data communication or control flow between those
145 | subprograms and other parts of the work.
146 |
147 | The Corresponding Source need not include anything that users
148 | can regenerate automatically from other parts of the Corresponding
149 | Source.
150 |
151 | The Corresponding Source for a work in source code form is that
152 | same work.
153 |
154 | 2. Basic Permissions.
155 |
156 | All rights granted under this License are granted for the term of
157 | copyright on the Program, and are irrevocable provided the stated
158 | conditions are met. This License explicitly affirms your unlimited
159 | permission to run the unmodified Program. The output from running a
160 | covered work is covered by this License only if the output, given its
161 | content, constitutes a covered work. This License acknowledges your
162 | rights of fair use or other equivalent, as provided by copyright law.
163 |
164 | You may make, run and propagate covered works that you do not
165 | convey, without conditions so long as your license otherwise remains
166 | in force. You may convey covered works to others for the sole purpose
167 | of having them make modifications exclusively for you, or provide you
168 | with facilities for running those works, provided that you comply with
169 | the terms of this License in conveying all material for which you do
170 | not control copyright. Those thus making or running the covered works
171 | for you must do so exclusively on your behalf, under your direction
172 | and control, on terms that prohibit them from making any copies of
173 | your copyrighted material outside their relationship with you.
174 |
175 | Conveying under any other circumstances is permitted solely under
176 | the conditions stated below. Sublicensing is not allowed; section 10
177 | makes it unnecessary.
178 |
179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
180 |
181 | No covered work shall be deemed part of an effective technological
182 | measure under any applicable law fulfilling obligations under article
183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or
184 | similar laws prohibiting or restricting circumvention of such
185 | measures.
186 |
187 | When you convey a covered work, you waive any legal power to forbid
188 | circumvention of technological measures to the extent such circumvention
189 | is effected by exercising rights under this License with respect to
190 | the covered work, and you disclaim any intention to limit operation or
191 | modification of the work as a means of enforcing, against the work's
192 | users, your or third parties' legal rights to forbid circumvention of
193 | technological measures.
194 |
195 | 4. Conveying Verbatim Copies.
196 |
197 | You may convey verbatim copies of the Program's source code as you
198 | receive it, in any medium, provided that you conspicuously and
199 | appropriately publish on each copy an appropriate copyright notice;
200 | keep intact all notices stating that this License and any
201 | non-permissive terms added in accord with section 7 apply to the code;
202 | keep intact all notices of the absence of any warranty; and give all
203 | recipients a copy of this License along with the Program.
204 |
205 | You may charge any price or no price for each copy that you convey,
206 | and you may offer support or warranty protection for a fee.
207 |
208 | 5. Conveying Modified Source Versions.
209 |
210 | You may convey a work based on the Program, or the modifications to
211 | produce it from the Program, in the form of source code under the
212 | terms of section 4, provided that you also meet all of these conditions:
213 |
214 | a) The work must carry prominent notices stating that you modified
215 | it, and giving a relevant date.
216 |
217 | b) The work must carry prominent notices stating that it is
218 | released under this License and any conditions added under section
219 | 7. This requirement modifies the requirement in section 4 to
220 | "keep intact all notices".
221 |
222 | c) You must license the entire work, as a whole, under this
223 | License to anyone who comes into possession of a copy. This
224 | License will therefore apply, along with any applicable section 7
225 | additional terms, to the whole of the work, and all its parts,
226 | regardless of how they are packaged. This License gives no
227 | permission to license the work in any other way, but it does not
228 | invalidate such permission if you have separately received it.
229 |
230 | d) If the work has interactive user interfaces, each must display
231 | Appropriate Legal Notices; however, if the Program has interactive
232 | interfaces that do not display Appropriate Legal Notices, your
233 | work need not make them do so.
234 |
235 | A compilation of a covered work with other separate and independent
236 | works, which are not by their nature extensions of the covered work,
237 | and which are not combined with it such as to form a larger program,
238 | in or on a volume of a storage or distribution medium, is called an
239 | "aggregate" if the compilation and its resulting copyright are not
240 | used to limit the access or legal rights of the compilation's users
241 | beyond what the individual works permit. Inclusion of a covered work
242 | in an aggregate does not cause this License to apply to the other
243 | parts of the aggregate.
244 |
245 | 6. Conveying Non-Source Forms.
246 |
247 | You may convey a covered work in object code form under the terms
248 | of sections 4 and 5, provided that you also convey the
249 | machine-readable Corresponding Source under the terms of this License,
250 | in one of these ways:
251 |
252 | a) Convey the object code in, or embodied in, a physical product
253 | (including a physical distribution medium), accompanied by the
254 | Corresponding Source fixed on a durable physical medium
255 | customarily used for software interchange.
256 |
257 | b) Convey the object code in, or embodied in, a physical product
258 | (including a physical distribution medium), accompanied by a
259 | written offer, valid for at least three years and valid for as
260 | long as you offer spare parts or customer support for that product
261 | model, to give anyone who possesses the object code either (1) a
262 | copy of the Corresponding Source for all the software in the
263 | product that is covered by this License, on a durable physical
264 | medium customarily used for software interchange, for a price no
265 | more than your reasonable cost of physically performing this
266 | conveying of source, or (2) access to copy the
267 | Corresponding Source from a network server at no charge.
268 |
269 | c) Convey individual copies of the object code with a copy of the
270 | written offer to provide the Corresponding Source. This
271 | alternative is allowed only occasionally and noncommercially, and
272 | only if you received the object code with such an offer, in accord
273 | with subsection 6b.
274 |
275 | d) Convey the object code by offering access from a designated
276 | place (gratis or for a charge), and offer equivalent access to the
277 | Corresponding Source in the same way through the same place at no
278 | further charge. You need not require recipients to copy the
279 | Corresponding Source along with the object code. If the place to
280 | copy the object code is a network server, the Corresponding Source
281 | may be on a different server (operated by you or a third party)
282 | that supports equivalent copying facilities, provided you maintain
283 | clear directions next to the object code saying where to find the
284 | Corresponding Source. Regardless of what server hosts the
285 | Corresponding Source, you remain obligated to ensure that it is
286 | available for as long as needed to satisfy these requirements.
287 |
288 | e) Convey the object code using peer-to-peer transmission, provided
289 | you inform other peers where the object code and Corresponding
290 | Source of the work are being offered to the general public at no
291 | charge under subsection 6d.
292 |
293 | A separable portion of the object code, whose source code is excluded
294 | from the Corresponding Source as a System Library, need not be
295 | included in conveying the object code work.
296 |
297 | A "User Product" is either (1) a "consumer product", which means any
298 | tangible personal property which is normally used for personal, family,
299 | or household purposes, or (2) anything designed or sold for incorporation
300 | into a dwelling. In determining whether a product is a consumer product,
301 | doubtful cases shall be resolved in favor of coverage. For a particular
302 | product received by a particular user, "normally used" refers to a
303 | typical or common use of that class of product, regardless of the status
304 | of the particular user or of the way in which the particular user
305 | actually uses, or expects or is expected to use, the product. A product
306 | is a consumer product regardless of whether the product has substantial
307 | commercial, industrial or non-consumer uses, unless such uses represent
308 | the only significant mode of use of the product.
309 |
310 | "Installation Information" for a User Product means any methods,
311 | procedures, authorization keys, or other information required to install
312 | and execute modified versions of a covered work in that User Product from
313 | a modified version of its Corresponding Source. The information must
314 | suffice to ensure that the continued functioning of the modified object
315 | code is in no case prevented or interfered with solely because
316 | modification has been made.
317 |
318 | If you convey an object code work under this section in, or with, or
319 | specifically for use in, a User Product, and the conveying occurs as
320 | part of a transaction in which the right of possession and use of the
321 | User Product is transferred to the recipient in perpetuity or for a
322 | fixed term (regardless of how the transaction is characterized), the
323 | Corresponding Source conveyed under this section must be accompanied
324 | by the Installation Information. But this requirement does not apply
325 | if neither you nor any third party retains the ability to install
326 | modified object code on the User Product (for example, the work has
327 | been installed in ROM).
328 |
329 | The requirement to provide Installation Information does not include a
330 | requirement to continue to provide support service, warranty, or updates
331 | for a work that has been modified or installed by the recipient, or for
332 | the User Product in which it has been modified or installed. Access to a
333 | network may be denied when the modification itself materially and
334 | adversely affects the operation of the network or violates the rules and
335 | protocols for communication across the network.
336 |
337 | Corresponding Source conveyed, and Installation Information provided,
338 | in accord with this section must be in a format that is publicly
339 | documented (and with an implementation available to the public in
340 | source code form), and must require no special password or key for
341 | unpacking, reading or copying.
342 |
343 | 7. Additional Terms.
344 |
345 | "Additional permissions" are terms that supplement the terms of this
346 | License by making exceptions from one or more of its conditions.
347 | Additional permissions that are applicable to the entire Program shall
348 | be treated as though they were included in this License, to the extent
349 | that they are valid under applicable law. If additional permissions
350 | apply only to part of the Program, that part may be used separately
351 | under those permissions, but the entire Program remains governed by
352 | this License without regard to the additional permissions.
353 |
354 | When you convey a copy of a covered work, you may at your option
355 | remove any additional permissions from that copy, or from any part of
356 | it. (Additional permissions may be written to require their own
357 | removal in certain cases when you modify the work.) You may place
358 | additional permissions on material, added by you to a covered work,
359 | for which you have or can give appropriate copyright permission.
360 |
361 | Notwithstanding any other provision of this License, for material you
362 | add to a covered work, you may (if authorized by the copyright holders of
363 | that material) supplement the terms of this License with terms:
364 |
365 | a) Disclaiming warranty or limiting liability differently from the
366 | terms of sections 15 and 16 of this License; or
367 |
368 | b) Requiring preservation of specified reasonable legal notices or
369 | author attributions in that material or in the Appropriate Legal
370 | Notices displayed by works containing it; or
371 |
372 | c) Prohibiting misrepresentation of the origin of that material, or
373 | requiring that modified versions of such material be marked in
374 | reasonable ways as different from the original version; or
375 |
376 | d) Limiting the use for publicity purposes of names of licensors or
377 | authors of the material; or
378 |
379 | e) Declining to grant rights under trademark law for use of some
380 | trade names, trademarks, or service marks; or
381 |
382 | f) Requiring indemnification of licensors and authors of that
383 | material by anyone who conveys the material (or modified versions of
384 | it) with contractual assumptions of liability to the recipient, for
385 | any liability that these contractual assumptions directly impose on
386 | those licensors and authors.
387 |
388 | All other non-permissive additional terms are considered "further
389 | restrictions" within the meaning of section 10. If the Program as you
390 | received it, or any part of it, contains a notice stating that it is
391 | governed by this License along with a term that is a further
392 | restriction, you may remove that term. If a license document contains
393 | a further restriction but permits relicensing or conveying under this
394 | License, you may add to a covered work material governed by the terms
395 | of that license document, provided that the further restriction does
396 | not survive such relicensing or conveying.
397 |
398 | If you add terms to a covered work in accord with this section, you
399 | must place, in the relevant source files, a statement of the
400 | additional terms that apply to those files, or a notice indicating
401 | where to find the applicable terms.
402 |
403 | Additional terms, permissive or non-permissive, may be stated in the
404 | form of a separately written license, or stated as exceptions;
405 | the above requirements apply either way.
406 |
407 | 8. Termination.
408 |
409 | You may not propagate or modify a covered work except as expressly
410 | provided under this License. Any attempt otherwise to propagate or
411 | modify it is void, and will automatically terminate your rights under
412 | this License (including any patent licenses granted under the third
413 | paragraph of section 11).
414 |
415 | However, if you cease all violation of this License, then your
416 | license from a particular copyright holder is reinstated (a)
417 | provisionally, unless and until the copyright holder explicitly and
418 | finally terminates your license, and (b) permanently, if the copyright
419 | holder fails to notify you of the violation by some reasonable means
420 | prior to 60 days after the cessation.
421 |
422 | Moreover, your license from a particular copyright holder is
423 | reinstated permanently if the copyright holder notifies you of the
424 | violation by some reasonable means, this is the first time you have
425 | received notice of violation of this License (for any work) from that
426 | copyright holder, and you cure the violation prior to 30 days after
427 | your receipt of the notice.
428 |
429 | Termination of your rights under this section does not terminate the
430 | licenses of parties who have received copies or rights from you under
431 | this License. If your rights have been terminated and not permanently
432 | reinstated, you do not qualify to receive new licenses for the same
433 | material under section 10.
434 |
435 | 9. Acceptance Not Required for Having Copies.
436 |
437 | You are not required to accept this License in order to receive or
438 | run a copy of the Program. Ancillary propagation of a covered work
439 | occurring solely as a consequence of using peer-to-peer transmission
440 | to receive a copy likewise does not require acceptance. However,
441 | nothing other than this License grants you permission to propagate or
442 | modify any covered work. These actions infringe copyright if you do
443 | not accept this License. Therefore, by modifying or propagating a
444 | covered work, you indicate your acceptance of this License to do so.
445 |
446 | 10. Automatic Licensing of Downstream Recipients.
447 |
448 | Each time you convey a covered work, the recipient automatically
449 | receives a license from the original licensors, to run, modify and
450 | propagate that work, subject to this License. You are not responsible
451 | for enforcing compliance by third parties with this License.
452 |
453 | An "entity transaction" is a transaction transferring control of an
454 | organization, or substantially all assets of one, or subdividing an
455 | organization, or merging organizations. If propagation of a covered
456 | work results from an entity transaction, each party to that
457 | transaction who receives a copy of the work also receives whatever
458 | licenses to the work the party's predecessor in interest had or could
459 | give under the previous paragraph, plus a right to possession of the
460 | Corresponding Source of the work from the predecessor in interest, if
461 | the predecessor has it or can get it with reasonable efforts.
462 |
463 | You may not impose any further restrictions on the exercise of the
464 | rights granted or affirmed under this License. For example, you may
465 | not impose a license fee, royalty, or other charge for exercise of
466 | rights granted under this License, and you may not initiate litigation
467 | (including a cross-claim or counterclaim in a lawsuit) alleging that
468 | any patent claim is infringed by making, using, selling, offering for
469 | sale, or importing the Program or any portion of it.
470 |
471 | 11. Patents.
472 |
473 | A "contributor" is a copyright holder who authorizes use under this
474 | License of the Program or a work on which the Program is based. The
475 | work thus licensed is called the contributor's "contributor version".
476 |
477 | A contributor's "essential patent claims" are all patent claims
478 | owned or controlled by the contributor, whether already acquired or
479 | hereafter acquired, that would be infringed by some manner, permitted
480 | by this License, of making, using, or selling its contributor version,
481 | but do not include claims that would be infringed only as a
482 | consequence of further modification of the contributor version. For
483 | purposes of this definition, "control" includes the right to grant
484 | patent sublicenses in a manner consistent with the requirements of
485 | this License.
486 |
487 | Each contributor grants you a non-exclusive, worldwide, royalty-free
488 | patent license under the contributor's essential patent claims, to
489 | make, use, sell, offer for sale, import and otherwise run, modify and
490 | propagate the contents of its contributor version.
491 |
492 | In the following three paragraphs, a "patent license" is any express
493 | agreement or commitment, however denominated, not to enforce a patent
494 | (such as an express permission to practice a patent or covenant not to
495 | sue for patent infringement). To "grant" such a patent license to a
496 | party means to make such an agreement or commitment not to enforce a
497 | patent against the party.
498 |
499 | If you convey a covered work, knowingly relying on a patent license,
500 | and the Corresponding Source of the work is not available for anyone
501 | to copy, free of charge and under the terms of this License, through a
502 | publicly available network server or other readily accessible means,
503 | then you must either (1) cause the Corresponding Source to be so
504 | available, or (2) arrange to deprive yourself of the benefit of the
505 | patent license for this particular work, or (3) arrange, in a manner
506 | consistent with the requirements of this License, to extend the patent
507 | license to downstream recipients. "Knowingly relying" means you have
508 | actual knowledge that, but for the patent license, your conveying the
509 | covered work in a country, or your recipient's use of the covered work
510 | in a country, would infringe one or more identifiable patents in that
511 | country that you have reason to believe are valid.
512 |
513 | If, pursuant to or in connection with a single transaction or
514 | arrangement, you convey, or propagate by procuring conveyance of, a
515 | covered work, and grant a patent license to some of the parties
516 | receiving the covered work authorizing them to use, propagate, modify
517 | or convey a specific copy of the covered work, then the patent license
518 | you grant is automatically extended to all recipients of the covered
519 | work and works based on it.
520 |
521 | A patent license is "discriminatory" if it does not include within
522 | the scope of its coverage, prohibits the exercise of, or is
523 | conditioned on the non-exercise of one or more of the rights that are
524 | specifically granted under this License. You may not convey a covered
525 | work if you are a party to an arrangement with a third party that is
526 | in the business of distributing software, under which you make payment
527 | to the third party based on the extent of your activity of conveying
528 | the work, and under which the third party grants, to any of the
529 | parties who would receive the covered work from you, a discriminatory
530 | patent license (a) in connection with copies of the covered work
531 | conveyed by you (or copies made from those copies), or (b) primarily
532 | for and in connection with specific products or compilations that
533 | contain the covered work, unless you entered into that arrangement,
534 | or that patent license was granted, prior to 28 March 2007.
535 |
536 | Nothing in this License shall be construed as excluding or limiting
537 | any implied license or other defenses to infringement that may
538 | otherwise be available to you under applicable patent law.
539 |
540 | 12. No Surrender of Others' Freedom.
541 |
542 | If conditions are imposed on you (whether by court order, agreement or
543 | otherwise) that contradict the conditions of this License, they do not
544 | excuse you from the conditions of this License. If you cannot convey a
545 | covered work so as to satisfy simultaneously your obligations under this
546 | License and any other pertinent obligations, then as a consequence you may
547 | not convey it at all. For example, if you agree to terms that obligate you
548 | to collect a royalty for further conveying from those to whom you convey
549 | the Program, the only way you could satisfy both those terms and this
550 | License would be to refrain entirely from conveying the Program.
551 |
552 | 13. Use with the GNU Affero General Public License.
553 |
554 | Notwithstanding any other provision of this License, you have
555 | permission to link or combine any covered work with a work licensed
556 | under version 3 of the GNU Affero General Public License into a single
557 | combined work, and to convey the resulting work. The terms of this
558 | License will continue to apply to the part which is the covered work,
559 | but the special requirements of the GNU Affero General Public License,
560 | section 13, concerning interaction through a network will apply to the
561 | combination as such.
562 |
563 | 14. Revised Versions of this License.
564 |
565 | The Free Software Foundation may publish revised and/or new versions of
566 | the GNU General Public License from time to time. Such new versions will
567 | be similar in spirit to the present version, but may differ in detail to
568 | address new problems or concerns.
569 |
570 | Each version is given a distinguishing version number. If the
571 | Program specifies that a certain numbered version of the GNU General
572 | Public License "or any later version" applies to it, you have the
573 | option of following the terms and conditions either of that numbered
574 | version or of any later version published by the Free Software
575 | Foundation. If the Program does not specify a version number of the
576 | GNU General Public License, you may choose any version ever published
577 | by the Free Software Foundation.
578 |
579 | If the Program specifies that a proxy can decide which future
580 | versions of the GNU General Public License can be used, that proxy's
581 | public statement of acceptance of a version permanently authorizes you
582 | to choose that version for the Program.
583 |
584 | Later license versions may give you additional or different
585 | permissions. However, no additional obligations are imposed on any
586 | author or copyright holder as a result of your choosing to follow a
587 | later version.
588 |
589 | 15. Disclaimer of Warranty.
590 |
591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
599 |
600 | 16. Limitation of Liability.
601 |
602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
610 | SUCH DAMAGES.
611 |
612 | 17. Interpretation of Sections 15 and 16.
613 |
614 | If the disclaimer of warranty and limitation of liability provided
615 | above cannot be given local legal effect according to their terms,
616 | reviewing courts shall apply local law that most closely approximates
617 | an absolute waiver of all civil liability in connection with the
618 | Program, unless a warranty or assumption of liability accompanies a
619 | copy of the Program in return for a fee.
620 |
621 | END OF TERMS AND CONDITIONS
622 |
623 | How to Apply These Terms to Your New Programs
624 |
625 | If you develop a new program, and you want it to be of the greatest
626 | possible use to the public, the best way to achieve this is to make it
627 | free software which everyone can redistribute and change under these terms.
628 |
629 | To do so, attach the following notices to the program. It is safest
630 | to attach them to the start of each source file to most effectively
631 | state the exclusion of warranty; and each file should have at least
632 | the "copyright" line and a pointer to where the full notice is found.
633 |
634 |
635 | Copyright (C)
636 |
637 | This program is free software: you can redistribute it and/or modify
638 | it under the terms of the GNU General Public License as published by
639 | the Free Software Foundation, either version 3 of the License, or
640 | (at your option) any later version.
641 |
642 | This program is distributed in the hope that it will be useful,
643 | but WITHOUT ANY WARRANTY; without even the implied warranty of
644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
645 | GNU General Public License for more details.
646 |
647 | You should have received a copy of the GNU General Public License
648 | along with this program. If not, see .
649 |
650 | Also add information on how to contact you by electronic and paper mail.
651 |
652 | If the program does terminal interaction, make it output a short
653 | notice like this when it starts in an interactive mode:
654 |
655 | Copyright (C)
656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
657 | This is free software, and you are welcome to redistribute it
658 | under certain conditions; type `show c' for details.
659 |
660 | The hypothetical commands `show w' and `show c' should show the appropriate
661 | parts of the General Public License. Of course, your program's commands
662 | might be different; for a GUI interface, you would use an "about box".
663 |
664 | You should also get your employer (if you work as a programmer) or school,
665 | if any, to sign a "copyright disclaimer" for the program, if necessary.
666 | For more information on this, and how to apply and follow the GNU GPL, see
667 | .
668 |
669 | The GNU General Public License does not permit incorporating your program
670 | into proprietary programs. If your program is a subroutine library, you
671 | may consider it more useful to permit linking proprietary applications with
672 | the library. If this is what you want to do, use the GNU Lesser General
673 | Public License instead of this License. But first, please read
674 | .
675 |
--------------------------------------------------------------------------------
/client/main.lua:
--------------------------------------------------------------------------------
1 | local QBCore = exports['qb-core']:GetCoreObject()
2 | local PlayerData = QBCore.Functions.GetPlayerData()
3 | local HotdogBlip = nil
4 | local IsWorking = false
5 | local StandObject = nil
6 | local IsPushing = false
7 | local IsUIActive = false
8 | local PreparingFood = false
9 | local zoneMade = false
10 | local SpatelObject = nil
11 | local SellingData = {
12 | Enabled = false,
13 | Target = nil,
14 | HasTarget = false,
15 | RecentPeds = {},
16 | Hotdog = nil,
17 | }
18 | local OffsetData = {
19 | x = 0.0,
20 | y = -0.8,
21 | z = 1.0,
22 | Distance = 2
23 | }
24 |
25 | local AnimationData = {
26 | lib = 'missfinale_c2ig_11',
27 | anim = 'pushcar_offcliff_f',
28 | }
29 |
30 | local DetachKeys = { 157, 158, 160, 164, 165, 73, 36, 44 }
31 |
32 | -- Handlers
33 |
34 | AddEventHandler('onResourceStop', function(resource)
35 | if resource == GetCurrentResourceName() then
36 | if StandObject ~= nil then
37 | DeleteObject(StandObject)
38 | ClearPedTasksImmediately(PlayerPedId())
39 | end
40 | end
41 | end)
42 |
43 | -- Local Functions
44 |
45 | local function DrawText3Ds(x, y, z, text)
46 | SetTextScale(0.35, 0.35)
47 | SetTextFont(4)
48 | SetTextProportional(1)
49 | SetTextColour(255, 255, 255, 215)
50 | BeginTextCommandDisplayText('STRING')
51 | SetTextCentre(true)
52 | AddTextComponentSubstringPlayerName(text)
53 | SetDrawOrigin(x, y, z, 0)
54 | EndTextCommandDisplayText(0.0, 0.0)
55 | local factor = (string.len(text)) / 370
56 | DrawRect(0.0, 0.0 + 0.0125, 0.017 + factor, 0.03, 0, 0, 0, 75)
57 | ClearDrawOrigin()
58 | end
59 |
60 | local function LoadAnim(dict)
61 | while not HasAnimDictLoaded(dict) do
62 | RequestAnimDict(dict)
63 | Wait(1)
64 | end
65 | end
66 |
67 | local function LoadModel(model)
68 | while not HasModelLoaded(model) do
69 | RequestModel(model)
70 | Wait(1)
71 | end
72 | end
73 |
74 | local function UpdateBlip()
75 | if PlayerData.job.name == 'hotdog' then
76 | CreateThread(function()
77 | local coords = Config.Locations['take'].coords
78 |
79 | if HotdogBlip ~= nil then
80 | RemoveBlip(HotdogBlip)
81 | end
82 |
83 | HotdogBlip = AddBlipForCoord(coords.x, coords.y, coords.z)
84 |
85 | SetBlipSprite(HotdogBlip, 542)
86 | SetBlipDisplay(HotdogBlip, 4)
87 | SetBlipScale(HotdogBlip, 0.6)
88 | SetBlipAsShortRange(HotdogBlip, true)
89 | SetBlipColour(HotdogBlip, 17)
90 | BeginTextCommandSetBlipName('STRING')
91 | AddTextComponentSubstringPlayerName(Lang:t('info.blip_name'))
92 | EndTextCommandSetBlipName(HotdogBlip)
93 | end)
94 | else
95 | if HotdogBlip then
96 | RemoveBlip(HotdogBlip)
97 | end
98 | end
99 | end
100 |
101 | local function GetAvailableHotdog()
102 | local retval = nil
103 | local AvailableHotdogs = {}
104 | for k, v in pairs(Config.Stock) do
105 | if v.Current > 0 then
106 | AvailableHotdogs[#AvailableHotdogs + 1] = {
107 | key = k,
108 | value = v,
109 | }
110 | end
111 | end
112 | if next(AvailableHotdogs) ~= nil then
113 | local Random = math.random(1, #AvailableHotdogs)
114 | retval = AvailableHotdogs[Random].key
115 | end
116 | return retval
117 | end
118 |
119 | local function UpdateLevel()
120 | local MyRep = PlayerData.metadata['rep']['hotdog']
121 |
122 | if MyRep ~= nil then
123 | if MyRep >= 1 and MyRep < 50 then
124 | Config.MyLevel = 1
125 | elseif MyRep >= 50 and MyRep < 100 then
126 | Config.MyLevel = 2
127 | elseif MyRep >= 100 and MyRep < 200 then
128 | Config.MyLevel = 3
129 | elseif MyRep >= 200 then
130 | Config.MyLevel = 4
131 | end
132 | else
133 | Config.MyLevel = 1
134 | end
135 |
136 | local ReturnData = {
137 | lvl = Config.MyLevel,
138 | rep = MyRep
139 | }
140 |
141 | return ReturnData
142 | end
143 |
144 | local function UpdateUI()
145 | IsUIActive = true
146 | CreateThread(function()
147 | while true do
148 | SendNUIMessage({
149 | action = 'UpdateUI',
150 | IsActive = IsUIActive,
151 | Stock = Config.Stock,
152 | Level = UpdateLevel()
153 | })
154 | if not IsUIActive then
155 | break
156 | end
157 | Wait(1000)
158 | end
159 | end)
160 | end
161 |
162 | local function LetKraamLose()
163 | local PlayerPed = PlayerPedId()
164 | DetachEntity(StandObject)
165 | SetEntityCollision(StandObject, true, true)
166 | ClearPedTasks(PlayerPed)
167 | IsPushing = false
168 | end
169 |
170 | if Config.UseTarget then
171 | RegisterCommand('letgostand', function()
172 | if IsPushing then
173 | LetKraamLose()
174 | end
175 | end)
176 | RegisterKeyMapping('letgostand', Lang:t('keymapping.gkey'), 'keyboard', 'G')
177 | end
178 |
179 | local function CheckLoop()
180 | CreateThread(function()
181 | while true do
182 | if IsWorking then
183 | if IsPushing then
184 | for _, PressedKey in pairs(DetachKeys) do
185 | if IsControlJustPressed(0, PressedKey) or IsDisabledControlJustPressed(0, PressedKey) then
186 | LetKraamLose()
187 | end
188 | end
189 |
190 | if IsPedShooting(PlayerPedId()) or IsPlayerFreeAiming(PlayerId()) or IsPedInMeleeCombat(PlayerPedId()) then
191 | LetKraamLose()
192 | end
193 |
194 | if IsPedDeadOrDying(PlayerPedId(), false) then
195 | LetKraamLose()
196 | end
197 |
198 | if IsPedRagdoll(PlayerPedId()) then
199 | LetKraamLose()
200 | end
201 | else
202 | Wait(1000)
203 | end
204 | else
205 | break
206 | end
207 | Wait(5)
208 | end
209 | end)
210 | end
211 |
212 | local function AnimLoop()
213 | CreateThread(function()
214 | while true do
215 | if IsPushing then
216 | local PlayerPed = PlayerPedId()
217 | if not IsEntityPlayingAnim(PlayerPed, AnimationData.lib, AnimationData.anim, 3) then
218 | LoadAnim(AnimationData.lib)
219 | TaskPlayAnim(PlayerPed, AnimationData.lib, AnimationData.anim, 8.0, 8.0, -1, 50, 0, false, false, false)
220 | end
221 | else
222 | break
223 | end
224 | Wait(1000)
225 | end
226 | end)
227 | end
228 |
229 | local function PreparingAnimCheck()
230 | PreparingFood = true
231 | CreateThread(function()
232 | while true do
233 | local ped = PlayerPedId()
234 |
235 | if PreparingFood then
236 | if not IsEntityPlayingAnim(ped, 'amb@prop_human_bbq@male@idle_a', 'idle_b', 3) then
237 | LoadAnim('amb@prop_human_bbq@male@idle_a')
238 | TaskPlayAnim(ped, 'amb@prop_human_bbq@male@idle_a', 'idle_b', 6.0, -6.0, -1, 49, 0, 0, 0, 0)
239 | end
240 | else
241 | DetachEntity(SpatelObject)
242 | DeleteEntity(SpatelObject)
243 | ClearPedTasksImmediately(ped)
244 | break
245 | end
246 |
247 | Wait(200)
248 | end
249 | end)
250 | end
251 |
252 | local function PrepareAnim()
253 | local ped = PlayerPedId()
254 | LoadAnim('amb@prop_human_bbq@male@idle_a')
255 | TaskPlayAnim(ped, 'amb@prop_human_bbq@male@idle_a', 'idle_b', 6.0, -6.0, -1, 47, 0, 0, 0, 0)
256 | SpatelObject = CreateObject(`prop_fish_slice_01`, 0, 0, 0, true, true, true)
257 | AttachEntityToEntity(SpatelObject, ped, GetPedBoneIndex(ped, 57005), 0.08, 0.0, -0.02, 0.0, -25.0, 130.0, true, true, false, true, 1, true)
258 | PreparingAnimCheck()
259 | end
260 |
261 | local function TakeHotdogStand()
262 | local PlayerPed = PlayerPedId()
263 | IsPushing = true
264 | NetworkRequestControlOfEntity(StandObject)
265 | LoadAnim(AnimationData.lib)
266 | TaskPlayAnim(PlayerPed, AnimationData.lib, AnimationData.anim, 8.0, 8.0, -1, 50, 0, false, false, false)
267 | SetTimeout(150, function()
268 | AttachEntityToEntity(StandObject, PlayerPed, GetPedBoneIndex(PlayerPed, 28422), -0.45, -1.2, -0.82, 180.0, 180.0, 270.0, false, false, false, false, 1, true)
269 | end)
270 | FreezeEntityPosition(StandObject, false)
271 | FreezeEntityPosition(PlayerPed, false)
272 | AnimLoop()
273 | end
274 |
275 | local function FinishMinigame(faults)
276 | local Quality = 'common'
277 | if faults == 0 then
278 | Quality = 'exotic'
279 | elseif faults == 1 then
280 | Quality = 'rare'
281 | end
282 | if Config.Stock[Quality].Current + 1 <= Config.Stock[Quality].Max[Config.MyLevel] then
283 | TriggerServerEvent('qb-hotdogjob:server:UpdateReputation', Quality)
284 | if Config.MyLevel == 1 then
285 | QBCore.Functions.Notify(Lang:t('success.made_hotdog', { value = Config.Stock[Quality].Label }), 'success')
286 | Config.Stock[Quality].Current = Config.Stock[Quality].Current + 1
287 | else
288 | local Luck = math.random(1, 2)
289 | local LuckyNumber = math.random(1, 2)
290 | local LuckyAmount = math.random(1, Config.MyLevel)
291 | if Luck == LuckyNumber then
292 | QBCore.Functions.Notify(Lang:t('success.made_luck_hotdog', { value = LuckyAmount, value2 = Config.Stock[Quality].Label }), 'success')
293 | Config.Stock[Quality].Current = Config.Stock[Quality].Current + LuckyAmount
294 | else
295 | QBCore.Functions.Notify(Lang:t('success.made_hotdog', { value = Config.Stock[Quality].Label }), 'success')
296 | Config.Stock[Quality].Current = Config.Stock[Quality].Current + 1
297 | end
298 | end
299 | else
300 | QBCore.Functions.Notify(Lang:t('error.no_more', { value = Config.Stock[Quality].Label }), 'error')
301 | end
302 | PreparingFood = false
303 | end
304 |
305 | local function StartHotdogMinigame()
306 | PrepareAnim()
307 | local result = exports['qb-minigames']:KeyMinigame(10)
308 | if result.quit then return end
309 | FinishMinigame(result.faults)
310 | end
311 |
312 | local function HotdogLoop()
313 | CreateThread(function()
314 | while true do
315 | local PlayerPed = PlayerPedId()
316 | local PlayerPos = GetEntityCoords(PlayerPed)
317 | local ClosestObject = GetClosestObjectOfType(PlayerPos.x, PlayerPos.y, PlayerPos.z, 3.0, `prop_hotdogstand_01`, 0, 0, 0)
318 |
319 | if StandObject ~= nil then
320 | if ClosestObject ~= nil and ClosestObject == StandObject then
321 | local ObjectOffset = GetOffsetFromEntityInWorldCoords(ClosestObject, 1.0, 0.0, 1.0)
322 | local ObjectDistance = #(PlayerPos - vector3(ObjectOffset.x, ObjectOffset.y, ObjectOffset.z))
323 |
324 | if ObjectDistance < 1.0 then
325 | if not IsPushing then
326 | DrawText3Ds(ObjectOffset.x, ObjectOffset.y, ObjectOffset.z, Lang:t('info.grab_stall'))
327 | if IsControlJustPressed(0, 47) then
328 | if SellingData.Enabled then
329 | if SellingData.Target ~= nil then
330 | SetPedKeepTask(SellingData.Target, false)
331 | SetEntityAsNoLongerNeeded(SellingData.Target)
332 | ClearPedTasksImmediately(SellingData.Target)
333 | FreezeEntityPosition(PlayerPed, true)
334 | end
335 | SellingData.Enabled = false
336 | SellingData.Target = nil
337 | SellingData.HasTarget = false
338 | TakeHotdogStand()
339 | else
340 | TakeHotdogStand()
341 | end
342 | end
343 | else
344 | DrawText3Ds(ObjectOffset.x, ObjectOffset.y, ObjectOffset.z, Lang:t('info.drop_stall'))
345 | if IsControlJustPressed(0, 47) then
346 | LetKraamLose()
347 | end
348 | end
349 | elseif ObjectDistance < 3.0 then
350 | DrawText3Ds(ObjectOffset.x, ObjectOffset.y, ObjectOffset.z, Lang:t('info.grab'))
351 | end
352 | end
353 | else
354 | break
355 | end
356 |
357 | Wait(3)
358 | end
359 | end)
360 |
361 | CreateThread(function()
362 | while true do
363 | Wait(0)
364 | if IsPushing then
365 | DisableControlAction(0, 244) -- m
366 | DisableControlAction(0, 23) -- f
367 | end
368 | end
369 | end)
370 |
371 | CreateThread(function()
372 | while true do
373 | local PlayerPed = PlayerPedId()
374 | local PlayerPos = GetEntityCoords(PlayerPed)
375 | local ClosestObject = GetClosestObjectOfType(PlayerPos.x, PlayerPos.y, PlayerPos.z, 3.0, `prop_hotdogstand_01`, 0, 0, 0)
376 |
377 | if StandObject ~= nil then
378 | if ClosestObject ~= nil and ClosestObject == StandObject then
379 | local ObjectOffset = GetOffsetFromEntityInWorldCoords(StandObject, 0.0, 0.0, 1.0)
380 | local ObjectDistance = #(PlayerPos - vector3(ObjectOffset.x, ObjectOffset.y, ObjectOffset.z))
381 |
382 | if ObjectDistance < 1.0 then
383 | if SellingData.Enabled then
384 | DrawText3Ds(ObjectOffset.x, ObjectOffset.y, ObjectOffset.z, Lang:t('info.selling_prep'))
385 | else
386 | DrawText3Ds(ObjectOffset.x, ObjectOffset.y, ObjectOffset.z, Lang:t('info.not_selling'))
387 | end
388 |
389 | if IsControlJustPressed(0, 38) then
390 | StartHotdogMinigame()
391 | end
392 | end
393 | end
394 | else
395 | break
396 | end
397 |
398 | Wait(3)
399 | end
400 | end)
401 | end
402 |
403 | local function StartWorking()
404 | QBCore.Functions.TriggerCallback('qb-hotdogjob:server:HasMoney', function(HasMoney)
405 | if HasMoney then
406 | if Config.UseTarget then
407 | local SpawnCoords = Config.Locations['spawn'].coords
408 | IsWorking = true
409 | LoadModel('prop_hotdogstand_01')
410 | StandObject = CreateObject(`prop_hotdogstand_01`, SpawnCoords.x, SpawnCoords.y, SpawnCoords.z, true)
411 | PlaceObjectOnGroundProperly(StandObject)
412 | SetEntityHeading(StandObject, SpawnCoords.w - 90)
413 | FreezeEntityPosition(StandObject, true)
414 | exports['qb-target']:AddTargetEntity(StandObject, {
415 | options = {
416 | {
417 | icon = 'fas fa-hand',
418 | label = Lang:t('info.grab'),
419 | canInteract = function()
420 | return IsWorking
421 | end,
422 | action = function()
423 | if not IsPushing then
424 | if SellingData.Enabled then
425 | if SellingData.Target ~= nil then
426 | SetPedKeepTask(SellingData.Target, false)
427 | SetEntityAsNoLongerNeeded(SellingData.Target)
428 | ClearPedTasksImmediately(SellingData.Target)
429 | FreezeEntityPosition(PlayerPedId(), true)
430 | end
431 | SellingData.Enabled = false
432 | SellingData.Target = nil
433 | SellingData.HasTarget = false
434 | TakeHotdogStand()
435 | else
436 | TakeHotdogStand()
437 | end
438 | else
439 | LetKraamLose()
440 | end
441 | end
442 | }, {
443 | icon = 'fas fa-hotdog',
444 | label = Lang:t('info.prepare'),
445 | canInteract = function()
446 | return IsWorking
447 | end,
448 | action = function()
449 | if not IsPushing then
450 | StartHotdogMinigame()
451 | end
452 | end
453 | }, {
454 | icon = 'fas fa-hand-holding-usd',
455 | label = Lang:t('info.toggle_sell'),
456 | type = 'client',
457 | event = 'qb-hotdogjob:client:ToggleSell',
458 | canInteract = function()
459 | return IsWorking
460 | end
461 | }
462 | },
463 | distance = 3.0
464 | })
465 | UpdateUI()
466 | QBCore.Functions.Notify(Lang:t('success.deposit', { deposit = Config.StandDeposit }), 'success')
467 | else
468 | local SpawnCoords = Config.Locations['spawn'].coords
469 | IsWorking = true
470 | LoadModel('prop_hotdogstand_01')
471 | StandObject = CreateObject(`prop_hotdogstand_01`, SpawnCoords.x, SpawnCoords.y, SpawnCoords.z, true)
472 | PlaceObjectOnGroundProperly(StandObject)
473 | SetEntityHeading(StandObject, SpawnCoords.w - 90)
474 | FreezeEntityPosition(StandObject, true)
475 | HotdogLoop()
476 | UpdateUI()
477 | CheckLoop()
478 | QBCore.Functions.Notify(Lang:t('success.deposit', { deposit = Config.StandDeposit }), 'success')
479 | end
480 | else
481 | QBCore.Functions.Notify(Lang:t('error.no_money'), 'error')
482 | end
483 | end)
484 | end
485 |
486 | local function StopWorking()
487 | if DoesEntityExist(StandObject) then
488 | QBCore.Functions.TriggerCallback('qb-hotdogjob:server:BringBack', function(DidBail)
489 | if DidBail then
490 | DeleteObject(StandObject)
491 | ClearPedTasksImmediately(PlayerPedId())
492 | IsWorking = false
493 | StandObject = nil
494 | IsPushing = false
495 | IsUIActive = false
496 |
497 | for _, v in pairs(Config.Stock) do
498 | v.Current = 0
499 | end
500 | QBCore.Functions.Notify(Lang:t('success.deposit_returned', { deposit = Config.StandDeposit }), 'success')
501 | else
502 | QBCore.Functions.Notify(Lang:t('error.deposit_notreturned'), 'error')
503 | end
504 | end)
505 | else
506 | QBCore.Functions.Notify(Lang:t('error.no_stand_found'), 'error')
507 | IsWorking = false
508 | StandObject = nil
509 | IsPushing = false
510 | IsUIActive = false
511 |
512 | for _, v in pairs(Config.Stock) do
513 | v.Current = 0
514 | end
515 | end
516 | end
517 |
518 | local function SellToPed(ped)
519 | SellingData.HasTarget = true
520 |
521 | if SellingData.RecentPeds ~= nil then
522 | for i = 1, #SellingData.RecentPeds, 1 do
523 | if SellingData.RecentPeds[i] == ped then
524 | SellingData.HasTarget = false
525 | return
526 | end
527 | end
528 | end
529 |
530 | SetEntityAsNoLongerNeeded(ped)
531 | ClearPedTasks(ped)
532 |
533 | local SellingPrice
534 | local HotdogsForSale
535 |
536 | SellingData.Hotdog = GetAvailableHotdog()
537 |
538 | if SellingData.Hotdog ~= nil then
539 | if Config.Stock[SellingData.Hotdog].Current > 1 then
540 | if Config.Stock[SellingData.Hotdog].Current >= 3 then
541 | HotdogsForSale = math.random(1, 3)
542 | else
543 | HotdogsForSale = math.random(1, Config.Stock[SellingData.Hotdog].Current)
544 | end
545 | elseif Config.Stock[SellingData.Hotdog].Current == 1 then
546 | HotdogsForSale = 1
547 | end
548 |
549 | if SellingData.Hotdog ~= nil then
550 | SellingPrice = math.random(Config.Stock[SellingData.Hotdog].Price[Config.MyLevel].min, Config.Stock[SellingData.Hotdog].Price[Config.MyLevel].max)
551 | end
552 | end
553 |
554 | local coords = GetOffsetFromEntityInWorldCoords(StandObject, OffsetData.x, OffsetData.y, OffsetData.z)
555 | local pedCoords = GetEntityCoords(ped)
556 | local pedDist = #(coords - pedCoords)
557 | local PlayerDist
558 |
559 | TaskGoStraightToCoord(ped, coords, 1.2, -1, 0.0, 0.0)
560 |
561 | while pedDist > OffsetData.Distance do
562 | local playercoords = GetEntityCoords(PlayerPedId())
563 | coords = GetOffsetFromEntityInWorldCoords(StandObject, OffsetData.x, OffsetData.y, OffsetData.z)
564 | PlayerDist = #(playercoords - coords)
565 | pedCoords = GetEntityCoords(ped)
566 | TaskGoStraightToCoord(ped, coords, 1.2, -1, 0.0, 0.0)
567 | pedDist = #(coords - pedCoords)
568 | if PlayerDist > 10.0 then
569 | SellingData.HasTarget = false
570 | SetPedKeepTask(ped, false)
571 | SetEntityAsNoLongerNeeded(ped)
572 | ClearPedTasksImmediately(ped)
573 | SellingData.RecentPeds[#SellingData.RecentPeds + 1] = ped
574 | SellingData.Enabled = false
575 | SellingData.Target = nil
576 | SellingData.HasTarget = false
577 | SellingData.Hotdog = nil
578 | QBCore.Functions.Notify(Lang:t('error.too_far'), 'error')
579 | break
580 | end
581 | Wait(100)
582 | end
583 |
584 | FreezeEntityPosition(ped, true)
585 | TaskLookAtEntity(ped, PlayerPedId(), 5500.0, 2048, 3)
586 | TaskTurnPedToFaceEntity(ped, PlayerPedId(), 5500)
587 | local heading = (GetEntityHeading(PlayerPedId()) + 180)
588 | SetEntityHeading(ped, heading)
589 | TaskStartScenarioInPlace(ped, 'WORLD_HUMAN_STAND_IMPATIENT_UPRIGHT', 0, false)
590 | SellingData.Target = ped
591 |
592 | while pedDist < OffsetData.Distance and SellingData.HasTarget do
593 | local playercoords = GetEntityCoords(PlayerPedId())
594 | coords = GetOffsetFromEntityInWorldCoords(StandObject, OffsetData.x, OffsetData.y, OffsetData.z)
595 | PlayerDist = #(playercoords - coords)
596 | pedCoords = GetEntityCoords(ped)
597 | pedDist = #(coords - pedCoords)
598 |
599 | if PlayerDist < 4 then
600 | if SellingData.Hotdog ~= nil then
601 | if HotdogsForSale == 0 and SellingPrice == 0 then
602 | if Config.Stock[SellingData.Hotdog].Current > 1 then
603 | if Config.Stock[SellingData.Hotdog].Current >= 3 then
604 | HotdogsForSale = math.random(1, 3)
605 | else
606 | HotdogsForSale = math.random(1, Config.Stock[SellingData.Hotdog].Current)
607 | end
608 | elseif Config.Stock[SellingData.Hotdog].Current == 1 then
609 | HotdogsForSale = 1
610 | end
611 |
612 | if SellingData.Hotdog ~= nil then
613 | SellingPrice = math.random(Config.Stock[SellingData.Hotdog].Price.min, Config.Stock[SellingData.Hotdog].Price.max)
614 | end
615 | end
616 |
617 | if Config.UseTarget then
618 | if not zoneMade then
619 | zoneMade = true
620 | exports['qb-target']:AddEntityZone('sellingDogPed', ped, {
621 | name = 'sellingDogPed',
622 | debugPoly = false,
623 | }, {
624 | options = {
625 | {
626 | icon = 'fas fa-hand-holding-dollar',
627 | label = Lang:t('info.sell_dogs_target', { value = HotdogsForSale, value2 = (HotdogsForSale * SellingPrice) }),
628 | action = function(entity)
629 | QBCore.Functions.Notify(Lang:t('success.sold_hotdogs', { value = HotdogsForSale, value2 = (HotdogsForSale * SellingPrice) }), 'success')
630 | TriggerServerEvent('qb-hotdogjob:server:Sell', pedCoords, HotdogsForSale, SellingPrice)
631 | SellingData.HasTarget = false
632 | LoadAnim('mp_common')
633 | TaskPlayAnim(PlayerPedId(), 'mp_common', 'givetake1_b', 8.0, 8.0, 1100, 48, 0.0, 0, 0, 0)
634 | FreezeEntityPosition(entity, false)
635 | SetPedKeepTask(entity, false)
636 | SetEntityAsNoLongerNeeded(entity)
637 | ClearPedTasksImmediately(entity)
638 | SellingData.RecentPeds[#SellingData.RecentPeds + 1] = entity
639 | Config.Stock[SellingData.Hotdog].Current = Config.Stock[SellingData.Hotdog].Current - HotdogsForSale
640 | SellingData.Hotdog = nil
641 | exports['qb-target']:RemoveZone('sellingDogPed')
642 | zoneMade = false
643 | end,
644 | },
645 | {
646 | icon = 'fas fa-x',
647 | label = 'Decline offer',
648 | action = function(entity)
649 | QBCore.Functions.Notify(Lang:t('error.cust_refused'), 'error')
650 | SellingData.HasTarget = false
651 | FreezeEntityPosition(entity, false)
652 | SetPedKeepTask(entity, false)
653 | SetEntityAsNoLongerNeeded(entity)
654 | ClearPedTasksImmediately(entity)
655 | SellingData.RecentPeds[#SellingData.RecentPeds + 1] = entity
656 | SellingData.Hotdog = nil
657 | exports['qb-target']:RemoveZone('sellingDogPed')
658 | zoneMade = false
659 | end,
660 | },
661 | },
662 | distance = 1.5,
663 | })
664 | end
665 | else
666 | DrawText3Ds(pedCoords.x, pedCoords.y, pedCoords.z, Lang:t('info.sell_dogs', { value = HotdogsForSale, value2 = (HotdogsForSale * SellingPrice) }))
667 | if IsControlJustPressed(0, 161) or IsDisabledControlJustPressed(0, 161) then
668 | QBCore.Functions.Notify(Lang:t('success.sold_hotdogs', { value = HotdogsForSale, value2 = (HotdogsForSale * SellingPrice) }), 'success')
669 | TriggerServerEvent('qb-hotdogjob:server:Sell', pedCoords, HotdogsForSale, SellingPrice)
670 | SellingData.HasTarget = false
671 | local Myped = PlayerPedId()
672 |
673 | local Selling = true
674 | local HotdogObject = nil
675 | local AnimPlayed = false
676 |
677 | while Selling do
678 | if not IsEntityPlayingAnim(Myped, 'mp_common', 'givetake1_b', 3) then
679 | LoadAnim('mp_common')
680 | if not AnimPlayed then
681 | TaskPlayAnim(Myped, 'mp_common', 'givetake1_b', 8.0, 8.0, 1100, 48, 0.0, 0, 0, 0)
682 | AnimPlayed = true
683 | end
684 | if HotdogObject == nil then
685 | HotdogObject = CreateObject(`prop_cs_hotdog_01`, 0, 0, 0, true, true, true)
686 | end
687 | AttachEntityToEntity(HotdogObject, Myped, GetPedBoneIndex(Myped, 57005), 0.12, 0.0, -0.05, 220.0, 120.0, 0.0, true, true, false, true, 1, true)
688 | SetTimeout(1250, function()
689 | Selling = false
690 | end)
691 | end
692 |
693 | Wait(0)
694 | end
695 |
696 | if HotdogObject ~= nil then
697 | DetachEntity(HotdogObject, 1, 1)
698 | DeleteEntity(HotdogObject)
699 | end
700 |
701 | FreezeEntityPosition(ped, false)
702 | SetPedKeepTask(ped, false)
703 | SetEntityAsNoLongerNeeded(ped)
704 | ClearPedTasksImmediately(ped)
705 | SellingData.RecentPeds[#SellingData.RecentPeds + 1] = ped
706 | Config.Stock[SellingData.Hotdog].Current = Config.Stock[SellingData.Hotdog].Current - HotdogsForSale
707 | SellingData.Hotdog = nil
708 | break
709 | end
710 |
711 | if IsControlJustPressed(0, 162) or IsDisabledControlJustPressed(0, 162) then
712 | QBCore.Functions.Notify(Lang:t('error.cust_refused'), 'error')
713 | SellingData.HasTarget = false
714 |
715 | FreezeEntityPosition(ped, false)
716 | SetPedKeepTask(ped, false)
717 | SetEntityAsNoLongerNeeded(ped)
718 | ClearPedTasksImmediately(ped)
719 | SellingData.RecentPeds[#SellingData.RecentPeds + 1] = ped
720 | SellingData.Hotdog = nil
721 | break
722 | end
723 | end
724 | else
725 | SellingData.HasTarget = false
726 | FreezeEntityPosition(ped, false)
727 | SetPedKeepTask(ped, false)
728 | SetEntityAsNoLongerNeeded(ped)
729 | ClearPedTasksImmediately(ped)
730 | SellingData.RecentPeds[#SellingData.RecentPeds + 1] = ped
731 | SellingData.Enabled = false
732 | SellingData.Target = nil
733 | SellingData.HasTarget = false
734 | SellingData.Hotdog = nil
735 | QBCore.Functions.Notify(Lang:t('error.no_dogs'), 'error')
736 | break
737 | end
738 | else
739 | SellingData.HasTarget = false
740 | FreezeEntityPosition(ped, false)
741 | SetPedKeepTask(ped, false)
742 | SetEntityAsNoLongerNeeded(ped)
743 | ClearPedTasksImmediately(ped)
744 | SellingData.RecentPeds[#SellingData.RecentPeds + 1] = ped
745 | SellingData.Enabled = false
746 | SellingData.Target = nil
747 | SellingData.HasTarget = false
748 | SellingData.Hotdog = nil
749 | QBCore.Functions.Notify(Lang:t('error.too_far'), 'error')
750 | break
751 | end
752 |
753 | Wait(3)
754 | end
755 | end
756 |
757 | local function ToggleSell()
758 | local pos = GetEntityCoords(PlayerPedId())
759 | local objpos = GetEntityCoords(StandObject)
760 | local dist = #(pos - objpos)
761 |
762 | if StandObject ~= nil then
763 | if dist < 5.0 then
764 | CreateThread(function()
765 | while true do
766 | if SellingData.Enabled then
767 | local coords = GetOffsetFromEntityInWorldCoords(StandObject, OffsetData.x, OffsetData.y, OffsetData.z)
768 |
769 | if not SellingData.HasTarget then
770 | local PlayerPeds = {}
771 | if next(PlayerPeds) == nil then
772 | for _, player in ipairs(GetActivePlayers()) do
773 | local ped = GetPlayerPed(player)
774 | PlayerPeds[#PlayerPeds + 1] = ped
775 | end
776 | end
777 |
778 | local closestPed, closestDistance = QBCore.Functions.GetClosestPed(coords, PlayerPeds)
779 |
780 | if closestDistance < 15.0 and closestPed ~= 0 and not IsPedInAnyVehicle(closestPed, false) then
781 | SellToPed(closestPed)
782 | end
783 | end
784 | else
785 | break
786 | end
787 | Wait(100)
788 | end
789 | end)
790 | else
791 | QBCore.Functions.Notify(Lang:t('error.too_far'), 'error')
792 | end
793 | else
794 | QBCore.Functions.Notify(Lang:t('error.no_stand'), 'error')
795 | end
796 | end
797 |
798 | -- Events
799 |
800 | RegisterNetEvent('QBCore:Client:OnPlayerLoaded', function()
801 | PlayerData = QBCore.Functions.GetPlayerData()
802 | UpdateBlip()
803 | end)
804 |
805 | RegisterNetEvent('QBCore:Client:OnJobUpdate', function(JobInfo)
806 | PlayerData.job = JobInfo
807 | UpdateBlip()
808 | end)
809 |
810 | RegisterNetEvent('qb-hotdogjob:client:UpdateReputation', function(JobRep)
811 | PlayerData.metadata['rep'] = JobRep
812 | UpdateLevel()
813 | end)
814 |
815 | RegisterNetEvent('qb-hotdogjob:client:ToggleSell', function()
816 | if not SellingData.Enabled then
817 | SellingData.Enabled = true
818 | ToggleSell()
819 | else
820 | if SellingData.Target ~= nil then
821 | SetPedKeepTask(SellingData.Target, false)
822 | SetEntityAsNoLongerNeeded(SellingData.Target)
823 | ClearPedTasksImmediately(SellingData.Target)
824 | end
825 | SellingData.Enabled = false
826 | SellingData.Target = nil
827 | SellingData.HasTarget = false
828 | end
829 | end)
830 |
831 | RegisterNetEvent('qb-hotdogjob:staff:DeletStand', function()
832 | local ped = PlayerPedId()
833 | local pos = GetEntityCoords(ped)
834 | local Object = GetClosestObjectOfType(pos.x, pos.y, pos.z, 10.0, `prop_hotdogstand_01`, true, false, false)
835 |
836 | if Object ~= nil then
837 | local ObjectCoords = GetEntityCoords(Object)
838 | local ObjectDistance = #(pos - ObjectCoords)
839 |
840 | if ObjectDistance <= 5 then
841 | NetworkRegisterEntityAsNetworked(Object)
842 | Wait(100)
843 | NetworkRequestControlOfEntity(Object)
844 | if not IsEntityAMissionEntity(Object) then
845 | SetEntityAsMissionEntity(Object)
846 | end
847 | Wait(100)
848 | DeleteEntity(Object)
849 | QBCore.Functions.Notify(Lang:t('info.admin_removed', 'primary'))
850 | end
851 | end
852 | end)
853 |
854 | -- Threads
855 |
856 | CreateThread(function()
857 | if Config.UseTarget then
858 | exports['qb-target']:AddBoxZone('hotdog_start', vector3(Config.Locations['take'].coords.x, Config.Locations['take'].coords.y, Config.Locations['take'].coords.z), 1, 1, {
859 | name = 'hotdog_start',
860 | debugPoly = false,
861 | heading = Config.Locations['take'].coords.w,
862 | minZ = Config.Locations['take'].coords.z - 1,
863 | maxZ = Config.Locations['take'].coords.z + 1,
864 | }, {
865 | options = {
866 | {
867 | label = 'Toggle Work',
868 | job = 'hotdog',
869 | icon = 'fa-solid fa-hotdog',
870 | action = function()
871 | if not IsWorking then
872 | StartWorking()
873 | else
874 | StopWorking()
875 | end
876 | end
877 | }
878 | },
879 | distance = 2.5
880 | })
881 | else
882 | local inZone = false
883 | local hotdogStart = BoxZone:Create(vector3(Config.Locations['take'].coords.x, Config.Locations['take'].coords.y, Config.Locations['take'].coords.z), 1.0, 1.0, {
884 | name = 'hotdog_start',
885 | debugPoly = false,
886 | minZ = Config.Locations['take'].coords.z - 1,
887 | maxZ = Config.Locations['take'].coords.z + 1,
888 | })
889 |
890 | hotdogStart:onPlayerInOut(function(isPointInside)
891 | if isPointInside then
892 | inZone = true
893 | if PlayerData.job.name == 'hotdog' then
894 | if not IsWorking then
895 | exports['qb-core']:DrawText(Lang:t('info.start_working'), 'left')
896 | CreateThread(function()
897 | while inZone do
898 | Wait(0)
899 | if IsControlJustPressed(0, 38) then
900 | StartWorking()
901 | end
902 | end
903 | end)
904 | else
905 | exports['qb-core']:DrawText(Lang:t('info.stop_working'), 'left')
906 | CreateThread(function()
907 | while inZone do
908 | Wait(0)
909 | if IsControlJustPressed(0, 38) then
910 | StopWorking()
911 | end
912 | end
913 | end)
914 | end
915 | end
916 | else
917 | inZone = false
918 | exports['qb-core']:HideText()
919 | end
920 | end)
921 | end
922 | end)
923 |
--------------------------------------------------------------------------------