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

Wysłany: 2015-07-14, 20:11


timmer1994

Recon






Wiek: 31
Na forum: 3981 dni
Posty: 60
Nick w MP: Recon

Piwa: 6

Respekt: 50

szuka?em takiego czego?, ale nie moge sobie poradzi?.
Jak zrobic, by z komendy m?g? korzystac tylko admin ?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-07-14, 20:16


Yankes69







Wiek: 31
Na forum: 3983 dni
Posty: 10



Respekt: 50

Ostrzeżeń: 100%
Jaka komenda?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-07-14, 20:26


Fanciak

BOT






Wiek: 25
Na forum: 4446 dni
Posty: 728
Nick w MP: Fanciak

Piwa: 1572

Respekt: 500
Respekt: 500


Więcej informacji znajdziesz w Wikipedii MTA:

isPlayerInACL


Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-07-14, 20:26


timmer1994

Recon






Wiek: 31
Na forum: 3981 dni
Posty: 60
Nick w MP: Recon

Piwa: 6

Respekt: 50

Przykladowo komenda /setplate

Mam skrypt do edytowania tablic, chce zebym tylko ja mogle z niej korzystac jako Admin.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-07-14, 20:29


Maximerr

Programmer PHP, LUA






Wiek: 25
Na forum: 4427 dni
Posty: 548

Piwa: 1051

Respekt: 365,3
Respekt: 365,3Respekt: 365,3Respekt: 365,3Respekt: 365,3

timmer1994,

Więcej informacji znajdziesz w Wikipedii MTA:

isObjectInACLGroup


Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-07-14, 20:54


timmer1994

Recon






Wiek: 31
Na forum: 3981 dni
Posty: 60
Nick w MP: Recon

Piwa: 6

Respekt: 50

taki kod mam, okej, ale zamiast dost?pu do JetPacka, chce mie? dost?p do komendy
/setplate
Tylko ja chce miec do niej dost?p, wykorzysta?em:

addCommandHandler "setplate",
    function ( thePlayer )
        if doesPedHaveJetPack thePlayer then
            removePedJetPack thePlayer )
            return
        end
 
     local accName getAccountName getPlayerAccount thePlayer ) )
     if isObjectInACLGroup ("user."..accNameaclGetGroup "Admin" ) ) then
          if not doesPedHaveJetPack thePlayer then
               givePedJetPack thePlayer )
          end
     end
end


Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-07-14, 21:29


Fanciak

BOT






Wiek: 25
Na forum: 4446 dni
Posty: 728
Nick w MP: Fanciak

Piwa: 1572

Respekt: 500
Respekt: 500

Na co Ci jetpack w dawaniu rejestracji? :O


Więcej informacji znajdziesz w Wikipedii MTA:

setVehiclePlateText


Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-07-14, 21:45


timmer1994

Recon






Wiek: 31
Na forum: 3981 dni
Posty: 60
Nick w MP: Recon

Piwa: 6

Respekt: 50

function (thePlayer)
    if isPlayerInACL thePlayer then
    setVehiclePlateText thePlayer )
    return
end
addCommandHandler "setplate" )
 
     local accName getAccountName getPlayerAccount thePlayer ) )
     if isObjectInACLGroup ("user."..accNameaclGetGroup "Admin" ) ) then
          if not isPlayerInACL thePlayer then
               setVehiclePlateText thePlayer )
          end
     end
end


Lepiej ? Domy?lam si?, ?e nadal robie to zle

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-07-14, 21:52


jg2aviva1

Rusek :D






Wiek: 25
Na forum: 4134 dni
Posty: 445
Nick w MP: _Wolfenstei[N]^.^

Piwa: 1033

Respekt: 240
Respekt: 240Respekt: 240

Ostrzeżeń: 60%
function PlateText(thePlayer,commandName,text)
    local Vehicle getPedOccupiedVehicle(thePlayer)
    if Vehicle then
        if text then
                  if isObjectInACLGroup ("user."..accNameaclGetGroup "Admin" ) ) then
                       setVehiclePlateTextVehicletext )
                  else
                    outputChatBox ("Nie jeste? adminem!"getRootElement (thePlayer), 25500)
                  end
        else
            outputChatBox("You must enter a message.",thePlayer)
        end
    else
        outputChatBox("You must be in a Vehicle.",thePlayer)
    end
end
addCommandHandler("setplate",PlateText)



Sprawd? czy dzia?a :) . Licz? na R* 8-)

Podpis



GTAO Member: 2015-08-23, 14:26

Ostatnio zmieniony przez jg2aviva1 2015-07-14, 22:02, w całości zmieniany 1 raz  
Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-07-14, 21:52


Maximerr

Programmer PHP, LUA






Wiek: 25
Na forum: 4427 dni
Posty: 548

Piwa: 1051

Respekt: 365,3
Respekt: 365,3Respekt: 365,3Respekt: 365,3Respekt: 365,3

timmer1994,
addCommandHandler "setplate",function ( plrcmdtablica )
    if isObjectInACLGroup ("user."..getAccountName (getPlayerAccount(plr)), aclGetGroup "Admin" )) then --sprawdzamy czy jest w ACLu 'Admin'
    local auto getPedOccupiedVehicle(plr) --pobieramy pojazd gracza wpisuj?cego komende
        if auto then -- je?li siedzi w aucie
            setVehiclePlateText autotablica ) --ustawiamy tablic?
        end--ko?czymy instrukcjwarunkow? if(sprawdzanie auta w tym przypadku)
    end--ko?czymy instrukcjwarunkow? if(sprawdzanie czy jest adminem w tym przypadku)
end)--zaka?czamy funkcj?.

Nawet Ci wszystko opisa?em! :-> :)

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-07-14, 22:03


timmer1994

Recon






Wiek: 31
Na forum: 3981 dni
Posty: 60
Nick w MP: Recon

Piwa: 6

Respekt: 50

Jestescie Mega ! Dzieki w?asnie wam, takim pomocnym ludziom naprawde zaczynam lapac :D Lepiej pomyslec niz klepac na slepo z Wiki i zmieniac.
Dzieki !

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-07-14, 22:07


jg2aviva1

Rusek :D






Wiek: 25
Na forum: 4134 dni
Posty: 445
Nick w MP: _Wolfenstei[N]^.^

Piwa: 1033

Respekt: 240
Respekt: 240Respekt: 240

Ostrzeżeń: 60%
Od tego chyba jest gtao.pl ;) . Pisz a my ci pomo?emy :)

Podpis



GTAO Member: 2015-08-23, 14:26

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-07-14, 22:50


timmer1994

Recon






Wiek: 31
Na forum: 3981 dni
Posty: 60
Nick w MP: Recon

Piwa: 6

Respekt: 50

Zmienilem troche kod:

local Vehicle getPedOccupiedVehicle(thePlayer)
function PlateText(thePlayer,commandName,text)
    if Vehicle then
        if text then
            if isObjectInACLGroup ("user."..accNameaclGetGroup "Admin" ) ) then
                setVehiclePlateTextVehicletext )
    end
addCommandHandler("setplate",PlateText)


Wywala mi b??d.

[2015-07-14 22:48] SCRIPT ERROR: [gameplay]/tablica/plate.lua:8: 'end' expected (to close 'if' at line 4) near ''
[2015-07-14 22:48] ERROR: Loading script failed: [gameplay]/tablica/plate.lua:8: 'end' expected (to close 'if' at line 4) near ''

O co chodzi, bo takie cos mi jeszcze nie wyskakiwalo, a kod wyglada okej.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-07-14, 23:19


Maximerr

Programmer PHP, LUA






Wiek: 25
Na forum: 4427 dni
Posty: 548

Piwa: 1051

Respekt: 365,3
Respekt: 365,3Respekt: 365,3Respekt: 365,3Respekt: 365,3

timmer1994, u?yj kodu, kt?ry ja Ci poda?em, bo w tym brakuje kilku end?w. Alvo je dopisz po prostu pod tym ostatnim. :->

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-07-14, 23:20


timmer1994

Recon






Wiek: 31
Na forum: 3981 dni
Posty: 60
Nick w MP: Recon

Piwa: 6

Respekt: 50

ilu end?w ? :D
domyslam sie ze 2 ?

[ Dodano: 2015-07-14, 23:29 ]
Dziala Twoim kodem.
Szkoda, ze narazie jak robie cos po mojemu to idzie srednio, ale nie zalamuje sie, fajnie, ze pomagacie, na bledach sie uczy najlepiej

Postaw piwo autorowi tego posta
 

 
Tagi: komenda :: tylko :: dla :: admina
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






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