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: 5028 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(player, cmd)
     --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!", player, 255, 0, 0) end
        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!", player, 255, 0, 0)
                    return false
                end
            end
        end
        
        if inside < napadLimit then
            outputChatBox("Tutaj jest za ma&#197;&#8218;o graczy do rozpocz?&#8482;cia napadu!", player, 255, 0, 0)
            return false
        end
        
        toggleControl(player, "crouch", true)
        -- dolaczamy do napadu
        if #napadTable[interior] >= 1 then
            if interior ~= 0 then
                outputChatBox("Do&#197;&#8218;?&#8230;czy&#197;&#8218;e&#197;&#8250; do napadu!", player, 0, 255, 255)
                setElementData(player, "napad:id", #napadTable[interior]+1)
                table.insert(napadTable[interior], {player})
                setElementData(player, "napad", true)
                triggerClientEvent(player, "onNapadTextShow", player, true)
                return true
            end
        end
        
        -- pierwszy napad
        if interior ~= 0 then
            outputChatBox("***", root, 0, 255, 0)
            outputChatBox(getPlayerName(player).." rozpocz?&#8230;&#197;&#8218; napad!", root, 0, 255, 0)
            outputChatBox("***", root, 0, 255, 0)
            local napadTimer2 = setTimer(napadUpdate, 1000, 0, interior)
            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", player, true)
            return true
                        --else
                        --outputChatBox ("(( Komunikat: Jestes w trakcje napadu!", player, 255, 0, 0, true)
                       --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: 4488 dni
Posty: 343
Nick w MP: CrosRoad95

Piwa: 3887

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: 5028 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: 5416 dni
Posty: 1948
Nick w MP: LuKiO

Piwa: 6103

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