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

Wysłany: 2018-08-01, 19:20


Gravgor







Wiek: 22
Na forum: 3761 dni
Posty: 380
Nick w MP: 1944

Piwa: 702

Respekt: 57,8

function login(player, command)
if getAdmin then
    if not getElementData(thePlayer, "player:admin") then
        setElementData(thePlayer, "player:admin")
        triggerClientEvent("create:noti", thePlayer, "Zalogowa?e? si? na duty")
    else
        if getElementData(thePlayer, "player:admin") then
            player:removedata("player:admin")
            triggerClientEvent("create:noti", thePlayer, "Wylogowa?e? si? z duty")
        end
    end

 addCommandHandler("duty", login)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-08-01, 19:27


Kalizman







Wiek: 24
Na forum: 3792 dni
Posty: 1394

Piwa: 4624

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

function login(player, command)
if getAdmin then
    if not getElementData(thePlayer, "player:admin") then
        setElementData(thePlayer, "player:admin")
        triggerClientEvent("create:noti", thePlayer, "Zalogowa?e? si? na duty")
    else
        if getElementData(thePlayer, "player:admin") then
            player:removedata("player:admin")
            triggerClientEvent("create:noti", thePlayer, "Wylogowa?e? si? z duty")
        end
    end
end
end
 addCommandHandler("duty", login)

Zabrak?o end?w od pierwszej instrukcji warunkowej IF oraz od function.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-08-01, 21:20


Kalizman







Wiek: 24
Na forum: 3792 dni
Posty: 1394

Piwa: 4624

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

Adaskokieblasko, Tw?j kod nie dzia?a, bo po co ten nawias na ko?cu skoro:
function login ( player, command )

S? dwa nawiasy, kt?re 'zamykaj?' t? funkcj?.
Nawias si? daje wtedy gdy piszemy skrypt "inaczej", np. tak:
addCommandHandler("test",
    function(player, cmd)
        -- co? tam
    end -- end od 'function'
) -- nawias kt?ry 'zamyka' commandHandler


http://prntscr.com/kdie34

Postaw piwo autorowi tego posta
 

 
Tagi: end :: excepted :: (to :: close :: function :: line :: 20)
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA » 'end' excepted (to close 'if' function at line 20) '<eof& 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