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

Wysłany: 2016-01-31, 19:23


BlackTen

LUA Dev.






Wiek: 28
Na forum: 4470 dni
Posty: 698

Piwa: 2080

Respekt: 157
Respekt: 157Respekt: 157

S - SIDE

function banPlayerCommand ( theClient, cmd, nick, reason, time, ... )
local accName = getAccountName ( getPlayerAccount ( theClient ))
    if isObjectInACLGroup("user."..accName, aclGetGroup("RCON")) or isObjectInACLGroup("user."..accName, aclGetGroup("Admin")) or isObjectInACLGroup("user."..accName, aclGetGroup("Moderator"))  then
        if cmd and nick and reason and time then
            local who = getPlayerFromName( nick )
            if who then
                local gracz = getPlayerName( theClient )
                local reason = table.concat({...},"")
                --banPlayer ( who, theClient, reason, time )
                triggerClientEvent(getRootElement(),"ban",root, "nick", "reason", "gracz")
            else
                outputChatBox("Nie ma takiego gracza na serwerze!", theClient)
            end
        else
            outputChatBox("U?yj: /zbanuj <nick> <pow?d> <czas>", theClient)
        end
    else
        outputChatBox("Nie masz uprawnie? !", theClient)
    end
end
addCommandHandler ( "zbanuj", banPlayerCommand )


C - SIDE
addEvent("ban",true)
addEventHandler("ban",root,
    function ()
        addEventHandler("onClientRender",root,pban)
    end
)

local screenW, screenH = guiGetScreenSize()

function pban (nick, gracz, reason)
        dxDrawRectangle(screenW * 0.3281, screenH * 0.1046, screenW * 0.2990, screenH * 0.0731, tocolor(229, 0, 0, 83), false)
        dxDrawText("Gracz: "..nick.." zosta? zbanowany przez: "..gracz..".\nPow?d: "..reason..".", screenW * 0.3312, screenH * 0.1102, screenW * 0.6219, screenH * 0.1685, tocolor(254, 254, 254, 254), 1.00, "default-bold", "center", "center", false, false, false, false, false)
end

function sban ()
removeEventHandler("onClientRender",root,pban)
end
setTimer(sban,6000,1)

Problem polega na tym ?e nie triggeruje argument?w :(

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-01-31, 19:51


AteX







Wiek: 27
Na forum: 4156 dni
Posty: 925
Nick w MP: #AteX

Piwa: 8366

Respekt: 775,3
Respekt: 775,3Respekt: 775,3

Nie doda?e? tych argument?w po stronie klienta w evencie ban.

Podpis
MultiTheftAuto++ dla MTA 1.5.7 już dostępne.
Postaw piwo autorowi tego posta
 

 
Tagi: trigger
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






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