Zaloguj się by uzyskać pełen dostęp. Nie masz jeszcze konta? Założ je już teraz w kilka sekund.

Wysłany: 2020-03-23, 16:29


Matikmontana

Modern Stories






Wiek: 22
Na forum: 2473 dni
Posty: 423
Nick w MP: Mazeusz*

Piwa: 1015

Respekt: 130
Respekt: 130

Ostrzeżeń: 60%
Witam, stworzy?em peda kt?ry daje premk? tylko gdy zrobi sie reconnecta mo?na jeszcze raz odbierac i tak w k??ko. Pomo?e kto? zrobi? ?eby mo?na by?o raz odebra? premk? ?


local ped createPed (1395.16, -1516.5932.27)
    setElementDimension(ped0)
    setElementInterior(ped0)    
    setPedAnimation(ped"DEALER""DEALER_IDLE")
    setPedRotation(ped181)
    setElementFrozen(pedtrue)

local t createElement("text")        -- tnp Text nad ped nad skinem )
    setElementData(t"name""Mazeusz*")
    setElementPosition(t,395.16, -1516.5932.27+1)
    setElementInterior(t0)
    setElementDimension(t0)
    
local marker createMarker (395.16, -1516.5932.27-1"cylinder"2012225550)
    





addEventHandler('onMarkerHit'marker, function(plr,id)
local id getElementData(plr,"player:sid")
    
    if getElementData(plr,"free_premium") == 1 then
        outputChatBox("[1]#d95f59 Mazeusz*: #FFFFFFJu? otrzyma?e? darmowe premium!",plr255255255true)
    return 
end


    exports["pystories-db"]:dbSet("UPDATE pystories_users SET free_premium=1 WHERE id=?"id)
    exports['pystories-db']:dbSet("update pystories_users SET premiumdate=now()+interval ? day where id=?"3id)
    setElementData(plr"free_premium"1)
    setElementData(plr"player:premium"true)
    outputChatBox("[1]#d95f59 Mazeusz*: #FFFFFFWitaj otrzymujesz #f6ff00premium #FFFFFFna 3 dni! (Po??cz si? ponownie)",plr255255255true)
end)




Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-03-23, 19:51


kamison

Przyszły programista .lua






Wiek: 25
Na forum: 3302 dni
Posty: 391
Nick w MP: kamison

Piwa: 594

Respekt: 205,3
Respekt: 205,3Respekt: 205,3

Sprawd? czy ma nadan? premk? w bazie.
sprawdz = ("SELECT * FROM pystories_users WHERE id=?",id)
albo
sprawdz = ("SELECT free_premium FROM pystories_users WHERE id=?",id)


if sprawdz.free_premium == 1 then return outputChatBox ("Masz premium"end
albo
if sprawdz == 1 then return outputChatBox ("Masz premium"end


Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-03-23, 21:59


Matikmontana

Modern Stories






Wiek: 22
Na forum: 2473 dni
Posty: 423
Nick w MP: Mazeusz*

Piwa: 1015

Respekt: 130
Respekt: 130

Ostrzeżeń: 60%

local ped createPed (1395.16, -1516.5932.27)
    setElementDimension(ped0)
    setElementInterior(ped0)    
    setPedAnimation(ped"DEALER""DEALER_IDLE")
    setPedRotation(ped181)
    setElementFrozen(pedtrue)

local t createElement("text")        -- tnp Text nad ped nad skinem )
    setElementData(t"name""Mazeusz*")
    setElementPosition(t,395.16, -1516.5932.27+1)
    setElementInterior(t0)
    setElementDimension(t0)
    
local marker createMarker (395.16, -1516.5932.27-1"cylinder"2012225550)
    





addEventHandler('onMarkerHit'marker, function(plr,id)
local id getElementData(plr,"player:sid")
    
    --if getElementData(plr,"free_premium") == 1 then
    --    outputChatBox("[1]#d95f59 Mazeusz*: #FFFFFFJu? otrzyma?e? darmowe premium!",plr255255255true)
--    return 
--end
      exports = ("SELECT free_premium FROM pystories_users WHERE id=?",id)
      if exports == 1 then return outputChatBox ("Masz premium"end

    exports["pystories-db"]:dbSet("UPDATE pystories_users SET free_premium=1 WHERE id=?"id)
    exports['pystories-db']:dbSet("update pystories_users SET premiumdate=now()+interval ? day where id=?"3id)
    setElementData(plr"free_premium"1)
    setElementData(plr"player:premium"true)
    outputChatBox("[1]#d95f59 Mazeusz*: #FFFFFFWitaj otrzymujesz #f6ff00premium #FFFFFFna 3 dni! (Po??cz si? ponownie)",plr255255255true)
end)




Zrobi?em tak ale wywala b??d w db3: https://imgur.com/a/jmbI0zK

Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-03-23, 23:38


Wilq







Wiek: 24
Na forum: 4429 dni
Posty: 3410

Piwa: 739

Respekt: 1225,8
Respekt: 1225,8

Linijka exports jest ?le zrobiona, to ma by? zapytanie do bazy danych czyli przed tym musi by? funkcja. Przyk?ad ?ywcem skopiowales i dziwisz si?, czemu nie dzia?a. Wzoruj sie na tym.

Postaw piwo autorowi tego posta
 

 
Tagi: ped :: premką
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA » ped z premką Odpowiedz do tematu

Nie możesz pisać nowych tematów
Nie możesz odpowiadać w tematach
Nie możesz zmieniać swoich postów
Nie możesz usuwać swoich postów
Nie możesz głosować w ankietach
Dodaj temat do Ulubionych
Wersja do druku