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

Wysłany: 2022-12-15, 19:54


Norbert1234

Nie umiem w LUA






Wiek: 22
Na forum: 4128 dni
Posty: 319
Nick w MP: Gusterowskyy

Piwa: 244

Respekt: 60

Witam, mam taki ma?y problem z notyfikacjami.
Chodzi o to, ?e funkcja /cl ma tworzy? notk? dla gracza kt?ry zg?osi? report na danego gracza. Co? mi tu nie hula wi?c szukam ma?ej pomocy :)


function report(plr, _, kto, ...)
    if not getElementData(plr, "user:logged") then return end
    if not kto or not ... then
        exports.rpg_noti:createNotification(plr, "error", "Poprawne u?ycie: /report <id/nick> <tre??>")
        return
    end
    local target = findPlayer(plr, kto)
    if not target then return end
    local tresc = table.concat({...}, " ")
    local target_id = getElementData(target, "user:tempid")
    local target_name = getElementData(target, "user:username")
    local player_id = getElementData(plr, "user:tempid")
    local player_name = getElementData(plr, "user:username")
    exports.rpg_noti:createNotification(plr, "success", "Pomy?lnie wys?ano zg?oszenie na gracza "..target_name)
    triggerClientEvent(root, "addToReports", root, player_name.."/"..player_id.. " > "..target_name.."/"..target_id..": "..tresc, target_id)
end
addCommandHandler("report", report)
addCommandHandler("raport", report)

addCommandHandler("cl", function(plr, _, kto)
    if getElementData(plr, "user:duty") and kto then
        local target = findPlayer(plr, kto)
        if not target then return end
        local id = getElementData(target, "user:tempid")
        local player_name = getElementData(plr, "user:username")

        triggerClientEvent(root, "removeFromReports", root, id)
        exports["rpg_noti"]:createNotification(plr, "success", "Tw?j report przyj?? gracz "..getPlayerName(plr))

        
    end
end)


Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 1 piw(a):
borsuk
Wysłany: 2022-12-15, 21:18


kamison

Przyszły programista .lua






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

Piwa: 599

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

Kod:

exports["rpg_noti"]:createNotification(plr, "success", "Tw?j report przyj?? gracz "..getPlayerName(plr))


Wy?wietlasz to osobie kt?ra zrobi?a reporta, nie wiem o co chodzi

Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 1 piw(a):
borsuk
Wysłany: 2022-12-15, 22:01


Norbert1234

Nie umiem w LUA






Wiek: 22
Na forum: 4128 dni
Posty: 319
Nick w MP: Gusterowskyy

Piwa: 244

Respekt: 60

https://images90.fotosik.pl/635/c35462b405858eccmed.png

function createNotification(player, type, text) 
    triggerClientEvent(player, "notka", player, type, text)
end


Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 1 piw(a):
borsuk
Tagi: powiadomienie :: przyjęciu :: reportu
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA 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