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

Wysłany: 2019-08-09, 16:26


Ratownik1981







Wiek: 28
Na forum: 2491 dni
Posty: 1
Nick w MP: RatownikPL



Respekt: 50


--[[

*** authorxScatta 
*** copyright ©
*** part of psw.gamemode

]]--

-- && server-side && --


local armyranksFullName = {
    "Private",
    "Private First Class",
    "Specialist",
    "Corporal",
    "Sergeant",
    "Staff Sergeant",
    "Sergeant First Class",
    "Master Sergeant",
    "First Sergeant",
    "Sergeant Major",
    "Command Sergeant Major",
    "Sergeant Major of the Army",
    "Second Lieutenant",
    "First Lieutenant",
    "Captain",
    "Major",
    "Lieutenant Colonel",
    "Colonel",
    "Brigadier General",
    "Major General",
    "Lieutenant General",
    "General",
    "General of the Army",
    "United States General"
}

function removeHexColor(text)
    text string.gsub(text,"#%x%x%x%x%x%x""")
    return text
end

function getPlayerAdditionalRank(plr,rank)
    if getElementData(plr,"data:specialtext"then
        for keyvalue in ipairs(getElementData(plr,"data:specialtext")) do
            if ( value == rank ) or ( removeHexColor(value) == rank then
                return true
            end
        end
    end
    end

function getPlayerFromPartialName(name)
    local name name and name:gsub("#%x%x%x%x%x%x"""):lower() or nil
    if name then
        for _player in ipairs(getElementsByType("player")) do
            local name_ getPlayerName(player):gsub("#%x%x%x%x%x%x"""):lower()
            if name_:find(name1truethen
                return player
            end
        end
    end
end

function promotePlayer(plr,cmd,name)
    if getPlayerAdditionalRank(plr,"Elite"then
        local target getPlayerFromPartialName(name)
        if target then
        if getElementData(target,"temp:playing") and getElementData(target,"data:armyrank"then
            local rank getElementData(target,"data:armyrank")
            if ( rank ) < 23 then
            setElementData(target,"data:armyrank",rank 1)
            outputChatBox("*Awansowa?es ?o?nierza: "..getPlayerName(target).." na rang?: "..armyranksFullName[rank+1],plr,255,255,255,true)
            outputChatBox("*Awansowa?es na rang?: "..armyranksFullName[rank+1],target,255,255,255,true)
        end
    end
end
end
end

addCommandHandler("pp",promotePlayer)
            
function demotePlayer(plr,cmd,name)
    if getPlayerAdditionalRank(plr,"Elite"then
        local target getPlayerFromPartialName(name)
        if target then
        if getElementData(target,"temp:playing") and getElementData(target,"data:armyrank"then
            local rank getElementData(target,"data:armyrank")
            if ( rank ) > 0 then
            setElementData(target,"data:armyrank",rank 1)
            outputChatBox("*Zdegradowa?es ?o?nierza: "..getPlayerName(target).." na rang?: "..armyranksFullName[rank-1],plr,255,255,255,true)
            outputChatBox("*Zosta?es zdegradowany na rang?: "..armyranksFullName[rank-1],target,255,255,255,true)
        end
    end
end
end
end

addCommandHandler("dp",demotePlayer)


____________________________


ktoda wz?r?


Ostatnio zmieniony przez Ratownik1981 2019-08-09, 18:59, w całości zmieniany 4 razy  
Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-08-10, 15:16


MeeShuffle

Programista/Grafik






Wiek: 32
Na forum: 4395 dni
Posty: 2758
Nick w MP: Shuffle

Piwa: 8575

Respekt: 535,3
Respekt: 535,3

1.Do jakiej elity?
2.Da?e? kod jedynie na promowanie i degradowanie ?o?nierza

Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-08-10, 15:43


PolskiHaski







Wiek: 24
Na forum: 3506 dni
Posty: 26
Nick w MP: Nonaetme

Piwa: 15

Respekt: 40

PSW, taka militarka. Elita z tego co pamietam to by? admin po prostu tylko zmienona nazwa (W ACL.)

Postaw piwo autorowi tego posta
 

 
Tagi: nie :: mogę :: się :: dodać :: elity
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