Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- KOD
- --]]
- local utils = exports["dmta_utils"]
- function getPremiumDate(player)
- local q = exports["dmta_xdb"]:wykonaj("SELECT id, premiumdate FROM pystories_users WHERE id=? AND premiumdate > NOW() LIMIT 1", getElementData(player, "player:sid"))
- if q and #q > 0 then
- return q[1].premiumdate
- else
- return false
- end
- end
- function getGoldDate(player)
- local q = exports["dmta_xdb"]:wykonaj("SELECT id, golddate FROM pystories_users WHERE id=? AND golddate > NOW() LIMIT 1", getElementData(player, "player:sid"))
- if q and #q > 0 then
- return q[1].golddate
- else
- return false
- end
- end
- function addPremiumDays(player, count)
- if getPremiumDate(player) then
- exports["dmta_xdb"]:wykonaj("UPDATE pystories_users SET premiumdate = DATE(premiumdate) + INTERVAL ? DAY WHERE id=? LIMIT 1", count, getElementData(player, "player:sid"))
- else
- exports["dmta_xdb"]:wykonaj("UPDATE pystories_users SET premiumdate = NOW() + INTERVAL ? DAY WHERE id=? LIMIT 1", count, getElementData(player, "player:sid"))
- end
- triggerEvent("save:player", root, player)
- triggerEvent("load:player", root, player)
- end
- function addGoldDays(player, count)
- if getGoldDate(player) then
- exports["dmta_xdb"]:wykonaj("UPDATE pystories_users SET golddate = DATE(golddate) + INTERVAL ? DAY WHERE id=? LIMIT 1", count, getElementData(player, "player:sid"))
- else
- exports["dmta_xdb"]:wykonaj("UPDATE pystories_users SET golddate = NOW() + INTERVAL ? DAY WHERE id=? LIMIT 1", count, getElementData(player, "player:sid"))
- end
- triggerEvent("save:player", root, player)
- triggerEvent("load:player", root, player)
- end
- addCommandHandler("nadaj.premium", function(player, cmd, target, days)
- if getElementData(player, "player:level") ~= 4 and getElementType(player) ~= "console" then return end
- if not target or not days or not tonumber(days) then
- outputChatBox("dmta_itemshop > Poprawne użycie: /"..cmd.." <id/nick> <ilość_dni>", player)
- return
- end
- local t = exports["dmta_core"]:findPlayer(player, target)
- if not t then
- outputChatBox("dmta_itemshop > Nie odnaleziono podanego gracza.", player)
- return
- end
- addPremiumDays(t, days)
- outputChatBox("dmta_itemshop > Nadałeś konto premium graczowi: "..utils:removeHex(getPlayerName(t))..", na "..days.." dni.", player)
- outputChatBox("dmta_itemshop > Otrzymałeś konto premium na "..days.." dni", t)
- outputChatBox("#fcc603[dmta_itemshop] > #ffffff"..utils:removeHex(getPlayerName(t)).." #ffd952zakupił konto premium na #ffffff"..days.." #ffd952dni, dziękujemy za wsparcie!", getRootElement(), 255, 255, 255, true)
- end)
- addCommandHandler("nadaj.gold", function(player, cmd, target, days)
- if getElementData(player, "player:level") ~= 4 and getElementType(player) ~= "console" then return end
- if not target or not days or not tonumber(days) then
- outputChatBox("dmta_itemshop > Poprawne użycie: /"..cmd.." <id/nick> <ilość_dni>", player)
- return
- end
- local t = exports["dmta_core"]:findPlayer(player, target)
- if not t then
- outputChatBox("dmta_itemshop > Nie odnaleziono podanego gracza.", player)
- return
- end
- addGoldDays(t, days)
- outputChatBox("dmta_itemshop > Nadałeś konto gold graczowi: "..utils:removeHex(getPlayerName(t))..", na "..days.." dni.", player)
- outputChatBox("dmta_itemshop > Otrzymałeś konto gold na "..days.." dni", t)
- outputChatBox("#fcc603[dmta_itemshop] > #ffffff"..utils:removeHex(getPlayerName(t)).." #ffd952zakupił konto gold na #ffffff"..days.." #ffd952dni, dziękujemy za wsparcie!", getRootElement(), 255, 255, 255, true)
- end)
- addCommandHandler("premium",function(plr,cmd)
- outputChatBox("-------------------------------------------------------------------------------------------------------------------", plr)
- outputChatBox("✔ Aby zakupić premium/golda udaj się na stronę: http://denvermta-shop.mtasa.eu/", plr)
- outputChatBox("✔ Po dokonanym zakupie automatycznie zostaniesz dodany do graczy premium!", plr)
- outputChatBox("✔ Korzyści z posiadania usługi premium oraz golda znajdują się na stronie.", plr)
- outputConsole("✔ Link do premium: http://denvermta-shop.mtasa.eu/", plr)
- outputChatBox("-------------------------------------------------------------------------------------------------------------------", plr)
- end)
- addCommandHandler("podmianki",function(plr,cmd)
- outputChatBox("-------------------------------------------------------------------------------------------------------------------", plr)
- outputChatBox("✔ Poniżej umieszczono listę pojazdów za realne pieniądze:", plr)
- outputChatBox("✔ Audi A5, BMW e30, Bentley, BMW M2, Lamborghini, Corvette, Mercedes C63 AMG, Ferrari, Infernus GT, Agera", plr)
- outputChatBox("✔ Cennik: 20 PSC/PayPal/Przelew/SMS", plr)
- outputChatBox("✔ Dostępne podmianki możesz zobaczyć również w górnym salonie w LV!", plr)
- outputChatBox("✔ Aby zakupić podmiankę zgłoś się do właścicieli!", plr)
- outputChatBox("-------------------------------------------------------------------------------------------------------------------", plr)
- end)
- losowanie = false
- local wygrane = {
- [1] = {wygrana = "premium na 1 dzień", type = "premium", procent = 40},
- [2] = {wygrana = 1000000, type = "money", procent = 30},
- [3] = {wygrana = "-50 RP", type = "rp", procent = 15},
- [4] = {wygrana = -150000, type = "money", procent = 20},
- [5] = {wygrana = 5000000, type = "money", procent = 10},
- [6] = {wygrana = "unikatowa podmianka", type = "veh", procent = 1},
- }
- addCommandHandler("losowanie.gold", function(plr, cmd)
- local zetony = tonumber(getElementData(plr, "player:zeton"))
- if not zetony or zetony < 1 then
- outputChatBox("* Nie posiadasz żetonów!", plr, 255, 0, 0)
- return
- end
- if losowanie == true then
- outputChatBox("* Już trwa jedno losowanie!", plr, 255, 0, 0)
- return
- end
- setElementData(plr, "player:zeton", zetony-1)
- losowanie = true
- outputChatBox("* Ilość Twoich żetonów: "..getElementData(plr, "player:zeton"), plr, 255, 0, 0)
- outputChatBox("* Losowanie rozpocznie się za: 3", plr, 255, 0, 0)
- setTimer(function()
- outputChatBox("* Losowanie rozpocznie się za: 2", plr, 255, 0, 0)
- end, 1000, 1)
- setTimer(function()
- outputChatBox("* Losowanie rozpocznie się za: 1", plr, 255, 0, 0)
- end, 2000, 1)
- setTimer(function()
- outputChatBox("* Losowanie rozpoczęto, proszę czekać..", plr, 0, 255, 0)
- end, 3000, 1)
- setTimer(function(player)
- for i = 1, #wygrane do
- local r = math.random(1, 100)
- if r > 0 and r <= wygrane[i].procent then
- outputChatBox("Losowanie zakończono, wygrałeś: "..wygrane[i].wygrana, plr, 0, 255, 0)
- if wygrane[i].type == "money" then
- givePlayerMoney(plr, wygrane[i].wygrana)
- elseif wygrane[i].type == "veh" then
- local los = math.random(1, 4)
- if los == 1 then
- exports["dmta_xdb"]:wykonaj("INSERT INTO `xyrusek_vehicles` (`model`, `mileage`, `fuel`, `owner`) VALUES (?, ?, ?, ?)", 502, 0, "40,40,0", getElementData(plr, "player:sid"))
- elseif los == 2 then
- exports["dmta_xdb"]:wykonaj("INSERT INTO `xyrusek_vehicles` (`model`, `mileage`, `fuel`, `owner`) VALUES (?, ?, ?, ?)", 421, 0, "40,40,0", getElementData(plr, "player:sid"))
- elseif los == 3 then
- exports["dmta_xdb"]:wykonaj("INSERT INTO `xyrusek_vehicles` (`model`, `mileage`, `fuel`, `owner`) VALUES (?, ?, ?, ?)", 527, 0, "40,40,0", getElementData(plr, "player:sid"))
- elseif los == 4 then
- exports["dmta_xdb"]:wykonaj("INSERT INTO `xyrusek_vehicles` (`model`, `mileage`, `fuel`, `owner`) VALUES (?, ?, ?, ?)", 529, 0, "40,40,0", getElementData(plr, "player:sid"))
- end
- elseif wygrane[i].type == "rp" then
- rp = getElementData(plr, "player:srp")
- setElementData(plr, "player:srp", rp-50)
- elseif wygrane[i].type == "premium" then
- addPremiumDays(plr,1)
- end
- return
- end
- end
- outputChatBox("Losowanie zakończono, wygrałeś: nic", plr, 0, 255, 0)
- end, 5000, 1, plr)
- setTimer(function()
- losowanie = false
- end, 6000, 1)
- end)
- addCommandHandler("dodaj.zetony", function(plr, cmd, cel, value )
- if not exports["bmta_sadm"]:getAdmin(plr, 4) then return end
- if not cel or not value then
- outputChatBox("* Prawidłowe użycie komendy: /dodaj.zetony <nick/id> <ilość>", plr, 255, 0, 0)
- return
- end
- local target = exports["dmta_core"]:findPlayer(plr, cel)
- local zetonki = tonumber(getElementData(target, "player:zeton"))
- setElementData(target, "player:zeton", zetonki+value)
- outputChatBox("* Dodano "..value.." żetonów graczowi "..getPlayerName(target), plr, 255, 0, 0)
- outputChatBox("* Otrzymano "..value.." żetonów od "..getPlayerName(plr), target, 255, 0, 0)
- print(getElementData(target, "player:zeton"))
- end)
- addCommandHandler("autost", function(plr, cmd, uid, pojazd)
- if getElementType(plr) ~= "console" then return end
- if not uid then return end
- if not pojazd then return end
- model = getVehicleModelFromName(pojazd)
- exports["dmta_xdb"]:wykonaj("INSERT INTO `xyrusek_vehicles` (`model`, `mileage`, `fuel`, `owner`, `tunning`) VALUES (?, ?, ?, ?)", model, 0, "40,40,0", uid, "1086, 1010")
- outputConsole("Dodano furę ze stereo i nitro - chojnas")
- end
- function removeHex(string)
- return utils:removeHex(string)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement