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

Wysłany: 2016-08-26, 14:20


AlaneqYT

Uczeń LUA






Wiek: 25
Na forum: 3884 dni
Posty: 37

Piwa: 20

Respekt: 25,3

Ostrzeżeń: 20%
Witam, mam kod premium, ale jak kto? wejdzie na serwer a nie ma premium to i tak je dostaje.
Kod:
--[[
    ResourceOURGame v2
    DevelopersSplit <split.programista@gmail.com>
    You have no right to use this code without my permission.
    (c2015 <split.programista@gmail.com>. All rights reserved.
]]

function loadPlayerData(plr)
    local result=exports["ogrpg-db"]:dbGet("SELECT * FROM ogrpg_users WHERE id=?"getElementData(plr,"player:uid"))
    if result and #result > 0 then
        local v=result[1]
        setPlayerMoney(plr,v.money)
        setElementModel(plr,v.skin)
        setElementData(plr,"status","Aktywny")
        setElementData(plr,"player:logged",true)
        setElementData(plr,"player:mandate",v.mandate)
        setElementData(plr,"player:license:pjA",v.pjA)
        setElementData(plr,"player:license:pjB",v.pjB)
        setElementData(plr,"player:license:pjC",v.pjC)
        setElementData(plr,"player:license:pjL",v.pjL)
        setElementData(plr,"player:reputation",v.reputation)
        setElementData(plr,"player:workinjob",v.worker)
        setElementData(plr,"player:registerdate",v.registered)
        setElementData(plr,"player:hours",v.hours)
        local queryA=string.format("SELECT * FROM ogrpg_users WHERE id=%d AND premiumdate>NOW() LIMIT 1"getElementData(plr,"player:uid"))
        local resultA=exports["ogrpg-db"]:dbGet(queryA)
        if (resultAthen
            setElementData(plr,"player:premium",true)
            setElementData(plr,"player:premiumdate",v.premiumdate)
            setPlayerName(plr,"#dbb234"..getPlayerName(plr))
        else
            setElementData(plr,"player:premium",false)
        end
        setElementData(plr,"player:skin",v.skin)
        return true
    end
    return false
end

addEvent("load:player",true)
addEventHandler("load:player"root, function(player)
if isElement(player) and player then
if getElementType(player) ~= "player" then return end
loadPlayerData(player)
outputDebugString("Zaladowano statystyki gracza :"..getPlayerName(player))
end
end)
function savePlayerData(plr)
    local uid=getElementData(plr,"player:uid")
    if not uid then return end
    local money=getPlayerMoney(plr)
    local mandate=getElementData(plr,"player:mandate")
    local licensea=getElementData(plr,"player:license:pjA")
    local licenseb=getElementData(plr,"player:license:pjB")
    local licensec=getElementData(plr,"player:license:pjC")
    local licensel=getElementData(plr,"player:license:pjL")
    local reputation=getElementData(plr,"player:reputation")
    local worker =getElementData(plr,"player:workinjob")
    local hourstonumber(getElementData(plr,"player:hours")) or 0
    local query=exports["ogrpg-db"]:dbSet("UPDATE ogrpg_users SET money=?, reputation=?, mandate=?, pjA=?, pjB=?, pjC=?, pjL=?, worker=?, hours=? WHERE id=?",
    moneyreputationmandatelicensealicenseblicenseclicensel,worker,hoursuid)
end
addEvent("save:player",true)
addEventHandler("save:player"root, function(player)
if isElement(player) and player then
if getElementType(player) ~= "player" then return end
savePlayerData(player)
outputDebugString("Zapisano statystyki gracza :"..getPlayerName(player))
end
end)
addEventHandler("onPlayerQuit"root, function() savePlayerData(sourceend)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-08-26, 21:52


Pumelowsky

Amator 3D






Wiek: 23
Na forum: 4182 dni
Posty: 199
Nick w MP: Pumelowsky

Piwa: 1666

Respekt: 200,5
Respekt: 200,5Respekt: 200,5

Usu? to i powiedz czy dzia?a
else
setElementData (plr"player:premium",false)


Podpis
Kontakt:

- Skype: live:pumapl_2
- GG: 56865468
- Discord: Pumelowsky#1126
- PW forum
[/center]
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-08-26, 22:20


AlaneqYT

Uczeń LUA






Wiek: 25
Na forum: 3884 dni
Posty: 37

Piwa: 20

Respekt: 25,3

Ostrzeżeń: 20%
Dalej nie dziala, prosze o szybka pomoc.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-08-26, 22:32


MeeShuffle

Programista/Grafik






Wiek: 32
Na forum: 4395 dni
Posty: 2758
Nick w MP: Shuffle

Piwa: 8575

Respekt: 535,3
Respekt: 535,3

Troche g?upio to zrobi?e?.

Zr?b w tabeli oprpg_users tabel? PREMIUM a w niej 0/1. O wiele wygodniej b?dzie Ci, i kod b?dzie optymalniejszy.

Podpis

https://shufflecode.pl
Static Codes and Graphics - Join our discord!
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-08-26, 22:40


AlaneqYT

Uczeń LUA






Wiek: 25
Na forum: 3884 dni
Posty: 37

Piwa: 20

Respekt: 25,3

Ostrzeżeń: 20%
Niestety, ja tego nie robilem.
Dalo by rade tylko to zrobic zeby gracz ktory nie mial premium nie dostawal tego premium? A kto ma ten dostaje? :/ Prosze o pomoc z tym.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-08-27, 08:40


Pumelowsky

Amator 3D






Wiek: 23
Na forum: 4182 dni
Posty: 199
Nick w MP: Pumelowsky

Piwa: 1666

Respekt: 200,5
Respekt: 200,5Respekt: 200,5

Daj tak a b?dzie dzia?a? na moim serwerze to dzia?a
        local queryA=string.format("SELECT * FROM ogrpg_users WHERE id=%d AND premiumdate>NOW() LIMIT 1"getElementData(plr,"player:uid"))
        local resultA=exports["ogrpg-db"]:dbGet(queryA)
        if #resultA > 0 then
            setElementData(plr,"player:premium",true)
            setElementData(plr,"player:premiumdate",v.premiumdate)
        end


Podpis
Kontakt:

- Skype: live:pumapl_2
- GG: 56865468
- Discord: Pumelowsky#1126
- PW forum
[/center]
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-08-27, 14:15


AlaneqYT

Uczeń LUA






Wiek: 25
Na forum: 3884 dni
Posty: 37

Piwa: 20

Respekt: 25,3

Ostrzeżeń: 20%
Dzi?ki, dzia?a :D

Postaw piwo autorowi tego posta
 

 
Tagi: premium :: raz
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA » Premium po raz 2 Ten temat jest zablokowany bez możliwości zmiany postów lub pisania odpowiedzi

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