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

Wysłany: 2020-08-18, 17:57


Patt420







Wiek: 26
Na forum: 2124 dni
Posty: 10
Nick w MP: Patt420



Respekt: 50

Witam mam taki problem, ot?? raz na jaki? czas po przelaniu graczowi jaki? kwoty odejmuje mu 3/4 wszystkich pieni?dzy, prosz? o pomoc.

function onTransferMoney(plrcmdtargetvalue)
    if not target or not tonumber(valuethen
        outputChatBox('* U?yj: /przelej <nick/ID> <kwota>'plr)
        return
    end
    value=string.match(value"%d*")
    value=tonumber(value)
    local target=findPlayer(plr,target)
    if not target then
        outputChatBox("* Nie znaleziono podanego gracza."plr)
        return
    end
    if not (getElementData(target"player:logged") == truethen
       outputChatBox('* Gracz nie jest zalogowany!.'plr25500)
    return end
    if getPlayerMoney(plr) < value then
        outputChatBox("* Nie masz wystarczajacych ?rodk?w."plr)
        return
    end
    if value == or value 0 then
        outputChatBox("* Poda?e?(a?) nie prawid?ow? warto??."plr)
        return
    end
    takePlayerMoney(plrvalue)
    givePlayerMoney(target ,value)

    outputChatBox("* Przela?e?(a?) Pieni?dze graczowi: ["..getElementData(target,"id").."]"..getPlayerName(target):gsub("#%x%x%x%x%x%x","").." Ilo?? przelanej got?wki: "..valueplr,  2452190true)
    outputChatBox("* Dosta?e?(a?) pieni?dze od: ["..getElementData(plr,"id").."]"..getPlayerName(plr):gsub("#%x%x%x%x%x%x","").." ilo?? otrzymanej got?wki: "..valuetarget,  2251990true)

    local transfer_text=('[PRZELEWY] [%d]%s(sid:%d) >> [%d]%s(sid:%d): %s'):format(getElementData(plr,"id"), getPlayerName(plr):gsub("#%x%x%x%x%x%x",""), getElementData(plr,"player:sid"), getElementData(target,"id"), getPlayerName(target):gsub("#%x%x%x%x%x%x",""), getElementData(target,"player:sid"), value)
    triggerClientEvent("onDebugMessage"resourceRoottransfer_text,4"PRZELEWY")
    triggerEvent("admin:addText"resourceRoottransfer_text:gsub("#%x%x%x%x%x%x",""))
    triggerEvent("admin:logs"roottransfer_text)
    outputServerLog(transfer_text)
end
addCommandHandler('przelej'onTransferMoney)
addCommandHandler('zaplac'onTransferMoney)
end



Ostatnio zmieniony przez PatryKK. 2020-08-18, 19:38, w całości zmieniany 1 raz  
Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-08-18, 20:35


MeeShuffle

Programista/Grafik






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

Piwa: 8575

Respekt: 535,3
Respekt: 535,3

Poka? jak wywolujesz ta funkcj?

Postaw piwo autorowi tego posta
 

 
Tagi: źle :: działająca :: komenda :: .zaplac
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA Odpowiedz do tematu

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