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

Wysłany: 2015-08-23, 15:32


BlackTen

LUA Dev.






Wiek: 28
Na forum: 4329 dni
Posty: 698

Piwa: 2080

Respekt: 157
Respekt: 157Respekt: 157

siemka mam sobie taki kodzik i nie wiem jak zrobi? ?e jak gracz ma 300GP to wtedy moze dolaczyc do tej frakcji ;

local test createMarker (1435.85217, -1489.5474220.20313"cylinder"200255)

function dodaj (graczzgodnosc)

    if zgodnosc then 
    
        if getElementType(gracz) == "player" then 
            if isGuestAccountgetPlayerAccount(gracz) ) then return end
                                local acc getAccountName(getPlayerAccount(gracz)) 
                        if (not isObjectInACLGroup "user"..accaclGetGroup("Policja"))) then
                            aclGroupAddObject (aclGetGroup("Policja"), "user."..acc) 
                        else 
                            outputChatBox("Jeste? juz w Pomocy Drogowej'",gracz) 
                        end  
            end
        end
    end

addEventHandler ("onMarkerHit"testdodaj)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-08-23, 15:40


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%
local test createMarker (1435.85217, -1489.5474220.20313"cylinder"200255)

function dodaj (graczzgodnosc)

    if zgodnosc then 
    
        if getElementType(gracz) == "player" then 
            if isGuestAccountgetPlayerAccount(gracz) ) then return end
                                local acc getAccountName(getPlayerAccount(gracz)) 
                        if (not isObjectInACLGroup "user"..accaclGetGroup("Policja"))) then
                                local punkty getElementData (gracz"gp")
                                   if punkty == 300 then
                                        aclGroupAddObject (aclGetGroup("Policja"), "user."..acc) 
                                        outputChatBox ("Jeste? teraz w pomocy drogowej!"gracz)
                                   else
                                        outputChatBox ("Masz za ma?o GP aby zosta? pomoc? drogow?!"gracz)
                                   end
                        else 
                            outputChatBox("Jeste? juz w Pomocy Drogowej'",gracz) 
                        end  
            end
        end
    end

addEventHandler ("onMarkerHit"testdodaj)


Sprawd? czy dzia?a, podmie? na swoje elementDaty itp :D

Podpis



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

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-08-23, 15:46


BlackTen

LUA Dev.






Wiek: 28
Na forum: 4329 dni
Posty: 698

Piwa: 2080

Respekt: 157
Respekt: 157Respekt: 157

Nie dziala pisze ze mam zamalo gp chociaz ze mam 400

[ Dodano: 2015-08-23, 15:54 ]
ej ej to ma byc strona ( client/server )

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-08-23, 17:28


Jurandovsky

Kurdebele






Wiek: 17
Na forum: 4838 dni
Posty: 915

Piwa: 2697

Respekt: 955,3
Respekt: 955,3Respekt: 955,3

Je?eli korzystasz z mojego kodu GP, to msusiz to zrobi? na s-side z account datami nie element datami.

z reszt?... acl to tylko s-side

Podpis
Jedyny kontakt ze mną to PW forum

Kod:


local noobs = getElementsByTitle("player", "Programista LUA")
for k, v in ipairs(noobs) do
outputChatBox("Bez mózgu jest użytkownik o nicku: "..getPlayerName(v), root)
destroyElement(v)
end
Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-08-23, 17:58


BlackTen

LUA Dev.






Wiek: 28
Na forum: 4329 dni
Posty: 698

Piwa: 2080

Respekt: 157
Respekt: 157Respekt: 157

local test createMarker (-126.00,1394.69,11.50"cylinder"200255)

function dodaj (graczzgodnosc)

    if zgodnosc then 
    
        if getAccountType(gracz) == "player" then 
            if isGuestAccountgetPlayerAccount(gracz) ) then return end
                                local acc getAccountName(getPlayerAccount(gracz)) 
                        if (not isObjectInACLGroup "user"..accaclGetGroup("Fc-Pd"))) then
                                local punkty getAccountData (gracz"GP")
                                   if punkty == 300 then
                                        aclGroupAddObject (aclGetGroup("Fc-Pd"), "user."..acc) 
                                        outputChatBox ("Jeste? teraz w pomocy drogowej!"gracz)
                                   else
                                        outputChatBox ("Masz za ma?o GP aby zosta? pomoc? drogow?( 300 GP )!"gracz)
                                   end
                        else 
                            outputChatBox("Jeste? juz w Pomocy Drogowej'",gracz) 
                        end  
            end
        end
    end


Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-08-23, 18:03


#404







Wiek: 26
Na forum: 4771 dni
Posty: 1438

Piwa: 2512

Respekt: 833,5
Respekt: 833,5Respekt: 833,5

Ostrzeżeń: 60%

 if punkty == 300 then


Kod "pojdzie" dalej tylko gdy ilosc gp bedzie R?WNA ( nie wi?ksza lub r?wna).

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-08-23, 18:09


BlackTen

LUA Dev.






Wiek: 28
Na forum: 4329 dni
Posty: 698

Piwa: 2080

Respekt: 157
Respekt: 157Respekt: 157

aha ok

[ Dodano: 2015-08-23, 18:16 ]
no ok mam 300gp i nic ;( *

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-08-23, 18:39


#404







Wiek: 26
Na forum: 4771 dni
Posty: 1438

Piwa: 2512

Respekt: 833,5
Respekt: 833,5Respekt: 833,5

Ostrzeżeń: 60%

local punkty getAccountData (gracz"GP")


B??dny 1 argument, dostaje argument w postaci gracza, nie jego konta.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-08-23, 18:43


BlackTen

LUA Dev.






Wiek: 28
Na forum: 4329 dni
Posty: 698

Piwa: 2080

Respekt: 157
Respekt: 157Respekt: 157

czyli user ?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-08-23, 19:12


#404







Wiek: 26
Na forum: 4771 dni
Posty: 1438

Piwa: 2512

Respekt: 833,5
Respekt: 833,5Respekt: 833,5

Ostrzeżeń: 60%
Jaki "user" ? O czym ty my?lisz ? Musisz poda? konto gracza sprawdzone za pomoc? funkcji

Więcej informacji znajdziesz w Wikipedii MTA:


getPlayerAccount

z argumenty gracz...

Postaw piwo autorowi tego posta
 

 
Tagi: acl
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