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

Wysłany: 2018-10-06, 20:21


AkossPL







Wiek: 25
Na forum: 4221 dni
Posty: 140
Nick w MP: AkossPL

Piwa: 3

Respekt: 50

Siema mam problem jak daje komu? premk? komendom to nie dzia?a tylko jak rc zrobi to wszystko dzia?a. Za pomoc postawie piwo



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,"user:nickname",v.login1)
        setElementData(plr,"player:logged",true)
        --setElementData(plr,"player:shoe",toJSON(v.prize))
        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)
        setElementData(plr,"p:title",v.rp_tytul)
        setElementData(plr,"nanky:x",v.nankyx)
        setElementData(plr,"nanky:y",v.nankyy)
        setElementData(plr,"nanky:z",v.nankyz)
        --if v.prize ~= "" then setElementData(plr, "player:shoe", fromJSON(v.prize)) else setElementData(plr, "player:shoe", {}) end
        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"]:pobierzWyniki(queryA)
        if (resultA) then
            setElementData(plr,"player:premium",true)
            setElementData(plr,"player:premiumdate",v.premiumdate)
            setPlayerName(plr,"#FFBF00"..getPlayerName(plr))
        else
            setElementData(plr,"player:premium",false)
        end
        setElementData(plr,"player:skin",v.skin)
        local org=exports["ogrpg-db"]:dbGet("SELECT * FROM ogrpg_organizations WHERE uid=? LIMIT 1", getElementData(plr,"player:uid")) -- pobieramy tylko JEDEN rekord
        if org and #org > 0 then
            setElementData(plr,"player:organization",org[1].code)
            exports['ogrpg-db']:dbSet("UPDATE ogrpg_organizations SET actived=curdate() WHERE uid=?", getElementData(plr,"player:uid"))
        end
        return true
    end
    return false
end


Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-10-06, 20:42


Kalizman







Wiek: 24
Na forum: 3793 dni
Posty: 1394

Piwa: 4624

Respekt: 358,8
Respekt: 358,8Respekt: 358,8Respekt: 358,8Respekt: 358,8

Do komendy dzi?ki kt?rej nadajesz komu? konto premium dodaj:
setElementData(zmienna_gracza,"player:premium",true)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-10-06, 20:45


AkossPL







Wiek: 25
Na forum: 4221 dni
Posty: 140
Nick w MP: AkossPL

Piwa: 3

Respekt: 50

Kalizman, A gdzie to doda? bo nie wiem

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-10-06, 20:46


Kalizman







Wiek: 24
Na forum: 3793 dni
Posty: 1394

Piwa: 4624

Respekt: 358,8
Respekt: 358,8Respekt: 358,8Respekt: 358,8Respekt: 358,8

Cytat:

Do komendy dzi?ki kt?rej nadajesz komu? konto premium


Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-10-06, 20:48


AkossPL







Wiek: 25
Na forum: 4221 dni
Posty: 140
Nick w MP: AkossPL

Piwa: 3

Respekt: 50

Kalizman, Doda?em i dalej nic

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-10-06, 20:49


Kalizman







Wiek: 24
Na forum: 3793 dni
Posty: 1394

Piwa: 4624

Respekt: 358,8
Respekt: 358,8Respekt: 358,8Respekt: 358,8Respekt: 358,8

poka? kod od bezpo?redniego nadawania konta premium oraz b??dy db3 (po wpisaniu komendy)

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-10-06, 20:50


AkossPL







Wiek: 25
Na forum: 4221 dni
Posty: 140
Nick w MP: AkossPL

Piwa: 3

Respekt: 50

Kalizman, Tak mam zrobione dawanie premek
addCommandHandler("vip",function(plr,cmd,cel,dni) 
    if exports['dutyadmin']:getAdmin(plr,7) then
    if not cel then outputChatBox("/komenda [gracz] [dni]",plr) return end
    if not dni then outputChatBox("/komenda [gracz] [dni]",plr) return end
    if not tonumber(dni) then outputChatBox("/komenda [gracz] [dni]",plr) return end
        local target=exports["ogrpg-core"]:findPlayer(plr,cel)
        if not target then
            outputChatBox("* Nie znaleziono podanego gracza.", plr, 255, 0, 0)
            return
        end
        setPremiumDay(target,dni)
        outputChatBox("Nadano konto premium na "..dni.." dni!", plr, 255, 8, 0)
        outputChatBox("Otrzymales konto premium na "..dni.." dni!", target, 255, 8, 0)
        setElementData(target, "player:premium", true)
        setElementData(target, "player:premiumdate", dni)
        triggerEvent("save:player",root,target)
        triggerEvent("load:player",root,target)
    end
end)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-10-06, 20:58


Kalizman







Wiek: 24
Na forum: 3793 dni
Posty: 1394

Piwa: 4624

Respekt: 358,8
Respekt: 358,8Respekt: 358,8Respekt: 358,8Respekt: 358,8

wklej to do dowolnego kodu skryptu - mo?e by? nawet do tego, w kt?rym znajduje si? komenda kt?r? mo?na nada? komu? premium (czyli wklej do kodu gdzie znajduje si? komenda /vip):
local sprawdzPremium=(
    function(player,cmd)
        local premium=getElementData(player,"player:premium")
        if premium then
            outputChatBox("Posiadasz element dat? premium",player,0,255,0)
        else
            outputChatBox("Nie posiadasz element daty",player,255,0,0)
        end
    end
)
addCommandHandler("sprawdzpremium",sprawdzPremium)

po czym zrestartuj zas?b z t? komend? i nadaj sobie konto premium za pomoc? tej komendy i wpisz /sprawdzpremium.
je?eli na czacie pojawi si? informacja o tym, ?e posiadasz premium to element data dzia?a.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-10-06, 21:02


AkossPL







Wiek: 25
Na forum: 4221 dni
Posty: 140
Nick w MP: AkossPL

Piwa: 3

Respekt: 50

Kalizman, Nic dalej nawet jak wpisze sprawdzpremium t? komende to dale nic nie pisz?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-10-06, 21:09


Kalizman







Wiek: 24
Na forum: 3793 dni
Posty: 1394

Piwa: 4624

Respekt: 358,8
Respekt: 358,8Respekt: 358,8Respekt: 358,8Respekt: 358,8

U mnie dzia?a komenda.
Upewnij si?, ?e komenda /debugscript 3 nie wywala ?adnego b??du po nadaniu premium czy po restarcie zasobu w kt?rym znajduje si? owa komenda.
Podaj jeszcze stron? skryptu na kt?rej znajduje si? ta komenda (klient czy server)

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-10-06, 21:09


_jvneczek







Wiek: 22
Na forum: 4467 dni
Posty: 1509
Nick w MP: _jvneczek

Piwa: 3960

Respekt: 337,5
Respekt: 337,5Respekt: 337,5Respekt: 337,5

Czekaj, nie daje ci premki w og?le czy dasz premke i po rc znika?

Podpis

Support Team: 04.10.2020 - 01.09.2020
Test Moderator: 03.05.2021 - 01.09.2021
Moderator: 01.09.2021 - 23.10.2021

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-10-06, 21:14


AkossPL







Wiek: 25
Na forum: 4221 dni
Posty: 140
Nick w MP: AkossPL

Piwa: 3

Respekt: 50

Thinks, Daje premke tylko nie od razu tylko jak rc zrobi

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-10-06, 21:27


_jvneczek







Wiek: 22
Na forum: 4467 dni
Posty: 1509
Nick w MP: _jvneczek

Piwa: 3960

Respekt: 337,5
Respekt: 337,5Respekt: 337,5Respekt: 337,5

AkossPL, Jak korzystasz z ogrpg to robisz /przeladuj (nick)
bo musi prze?adowa? dane z bazy, bo w bazie jest a na serwie za 1 razem tej premki nie ma, wi?c musi prze?adowa?(od nowa za?adowa? dane)

Podpis

Support Team: 04.10.2020 - 01.09.2020
Test Moderator: 03.05.2021 - 01.09.2021
Moderator: 01.09.2021 - 23.10.2021

Postaw piwo autorowi tego posta
 

 
Tagi: nie :: daje :: premki :: jak :: jest :: serwerze :: tylko :: jak :: zrobi
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA » Nie daje premki jak jest na serwerze tylko jak zrobi rc 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