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

Wysłany: 2015-06-07, 13:44


monio







Wiek: 30
Na forum: 4887 dni
Posty: 319
Nick w MP: Monio99

Piwa: 3565

Respekt: 120,5
Respekt: 120,5

Cze??. Chcia?em zapyta? jak zablokowa? to komend? "/napad" dla graczy kt?rzy s? w ze mn? w trakcje tego napadu?


function napadCMD(playercmd)
     --if getElementData (player"napad_ooojej"then
    if getElementType(player) == "player" then
        local interior getElementInterior(player)
        local dim getElementDimension(player)
        if getElementData(player"napad"then outputChatBox("Już napadasz!"player25500end
        if interior ~= 3 then return end
        
        local inside 0
        for k,v in ipairs(getElementsByType("player")) do
            if getElementInterior(v) == 3 then
                inside inside 1
            end
        end
        
        for k,v in ipairs(getElementsByType("player")) do
            if getElementInterior(v) == 3 then
                if getElementData(v"team") ~= getElementData(player"team"then
                    outputChatBox("Aby rozpocz?…?‡ napad upewnij si?™, Å¼e wszyscy s?… z jednej drużyny!"player25500)
                    return false
                end
            end
        end
        
        if inside napadLimit then
            outputChatBox("Tutaj jest za maÅ‚o graczy do rozpocz?™cia napadu!"player25500)
            return false
        end
        
        toggleControl(player"crouch"true)
        -- dolaczamy do napadu
        if #napadTable[interior] >= 1 then
            if interior ~= 0 then
                outputChatBox("DoÅ‚?…czyÅ‚eÅ› do napadu!"player0255255)
                setElementData(player"napad:id"#napadTable[interior]+1)
                table.insert(napadTable[interior], {player})
                setElementData(player"napad"true)
                triggerClientEvent(player"onNapadTextShow"playertrue)
                return true
            end
        end
        
        -- pierwszy napad
        if interior ~= 0 then
            outputChatBox("***"root02550)
            outputChatBox(getPlayerName(player).." rozpocz?…Å‚ napad!"root02550)
            outputChatBox("***"root02550)
            local napadTimer2 setTimer(napadUpdate10000interior)
            napadTime[interior] = napadTimeInt
            napadTimer[interior] = napadTimer2
            spawnPos[interior][4] = {}
            table.insert(napadTable[interior], {player})
            setElementData(player"napad:id"1)
            setElementData(player"napad"true)
            triggerClientEvent(player"onNapadTextShow"playertrue)
            return true
                        --else
                        --outputChatBox ("(( Komunikat: Jestes w trakcje napadu!"player25500true)
                       --end
        end
    end
end
addCommandHandler("napad"napadCMD)    


Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-06-07, 14:36


PolskiSebek12

Programista






Wiek: 28
Na forum: 4347 dni
Posty: 343
Nick w MP: CrosRoad95

Piwa: 3883

Respekt: 288,8
Respekt: 288,8Respekt: 288,8Respekt: 288,8

Ostrzeżeń: 100%
" kt?rzy s? w ze mn? w trakcje tego napadu" polska pe?na trudna j?zyka

dopisz:

if getElementData(player,"napad") then
TW?J KOD
end

i je?eli gracz jest w trakcie napadu to nie b?dzie m?g? u?yc tej komendy

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-06-07, 15:42


monio







Wiek: 30
Na forum: 4887 dni
Posty: 319
Nick w MP: Monio99

Piwa: 3565

Respekt: 120,5
Respekt: 120,5

PolskiSebek12, Ale ja to wiem... Tylko chcia?em to tak zrobi? aby to blokowa?o dla ka?dej osoby, kt?ra znajduje si? ze mn? w tym interiorze.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-06-07, 16:52


luki123luki123

Place Game






Wiek: 28
Na forum: 5275 dni
Posty: 1948
Nick w MP: LuKiO

Piwa: 6101

Respekt: 611
Respekt: 611Respekt: 611

monio, zr?b nowego element data np. NapadTeraz i przypisz ka?demu graczowi co napada t? warto?? i p??niej je?eli b?dzie chcia? napada? 2 raz jak ju? napada to sprawd? czy ma takiego dat? z warto?ci? true

Postaw piwo autorowi tego posta
 

 
Tagi: napady
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






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