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

Wysłany: 2016-08-15, 13:57


AlaneqYT

Uczeń LUA






Wiek: 25
Na forum: 3884 dni
Posty: 37

Piwa: 20

Respekt: 25,3

Ostrzeżeń: 20%
Witam, wie kto? mo?e jak zablokowa? przesy?anie pieni?dzy na to samo uid ( gdy np. 2 graczy jest na jednym koncie )

Kod na przesy?anie:

--[[
    ResourceOURGame v2
    DevelopersSplit <split.programista@gmail.com>
    You have no right to use this code without my permission.
    (c2015 <split.programista@gmail.com>. All rights reserved.
]]

function onPrivateMessage(plrcmdtarget, ...)
    if not target or not {...} then
        outputChatBox('* U?yj /pm <nick/ID> <tre??>'plr)
        return
    end

    local text=table.concat({...}, ' ')
    local target=findPlayer(plrtarget)
    if not target then
        outputChatBox('* Nie znaleziono podanego gracza.'plr25500)
        return
    end

    outputChatBox("#FFFFFF>> #BABABA"..getPlayerName(target).."["..getElementData(target,"id").."]: #ffffff"..text..""plr___true)
    outputChatBox("#FFFFFF<< #BABABA"..getPlayerName(plr).."["..getElementData(plr,"id").."]: #ffffff"..text..""target___true) 

      local pm_text=('PM> %s(%d) >> %s(%d): %s'):format(getPlayerName(plr), getElementData(plr,"id"), getPlayerName(target), getElementData(target,"id"), text)
      triggerClientEvent(root"admin:addText"rootpm_text)
end
addCommandHandler('pw'onPrivateMessage)
addCommandHandler('pm'onPrivateMessage)

function zaplacPieniadze(plrcmdcelvalue)
    if not(value or celthen
    outputChatBox("#FF007E* U?yj: /przelej <nick/ID> <kwota>"plr,255,0,0,true)
        return
    end
    
    local target znajdzGracza(plrcel)
    
    if not(targetthen
    outputChatBox("#FF007E* Nie znaleziono gracza o podanym ID/nicku!"plr,255,0,0,true)
        return
    end
    
    if tonumber(value) < 0 then return end
    if (not tonumber(value)) then return end

    if getPlayerMoney(plr) < tonumber(valuethen
    outputChatBox("#FF007E* Nie posiadasz wystarczaj?cej ilo?ci pieni?dzy!"plr25500,true)
        return
    end
    
    takePlayerMoney(plrtonumber(value))
    givePlayerMoney(targettonumber(value))
    outputChatBox("#FF007E* Gracz #DDDDDD"..getPlayerName(plr).." #FF007Eprzekazuje Ci #DDDDDD"..tonumber(value).." #FF007EZ?."target,255,0,0,true)
    outputChatBox("* #FF007EPrzekazujesz #DDDDDD"..tonumber(value).." #FF007EZ? graczowi #DDDDDD"..getPlayerName(target)..""plr ,255,0,0,true)
end
addCommandHandler("przelej"zaplacPieniadze)
addCommandHandler("zaplac"zaplacPieniadze)
addCommandHandler("dajkase"zaplacPieniadze)

setTimer(function()
    local vehicles=getElementsByType('vehicle')
    for _vehicle in pairs(vehicles) do
        if getElementHealth(vehicle)<300 then
            setVehicleDamageProof(vehicletrue)
        elseif getElementHealth(vehicle)>301 then
            setVehicleDamageProof(vehiclefalse)
        end
     end
end5000)


Oczywi?cie jest to kod z ogrpg ;)

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-08-15, 14:30


Xaar







Wiek: 25
Na forum: 5451 dni
Posty: 47
Nick w MP: PLWESOLYKOSTEK

Piwa: 82

Respekt: 60

daj kod ktory nadaje uid graczom (elementdate) i sprawdzaj czy uid nie pokrywa sie ze soba najlepiej byloby to zrobic tak


if elementdatanauid == elementdatanauid then
cancelEvent()
end


i podczepiasz pod funkcje zaplacPieniadze

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-08-15, 14:57


AlaneqYT

Uczeń LUA






Wiek: 25
Na forum: 3884 dni
Posty: 37

Piwa: 20

Respekt: 25,3

Ostrzeżeń: 20%
Nie dzia?a, zrobi?em co? takiego:

--[[
    ResourceOURGame v2
    DevelopersSplit <split.programista@gmail.com>
    You have no right to use this code without my permission.
    (c2015 <split.programista@gmail.com>. All rights reserved.
]]

function onPrivateMessage(plrcmdtarget, ...)
    if not target or not {...} then
        outputChatBox('* U?yj /pm <nick/ID> <tre??>'plr)
        return
    end

    local text=table.concat({...}, ' ')
    local target=findPlayer(plrtarget)
    if not target then
        outputChatBox('* Nie znaleziono podanego gracza.'plr25500)
        return
    end

    outputChatBox("#FFFFFF>> #BABABA"..getPlayerName(target).."["..getElementData(target,"id").."]: #ffffff"..text..""plr___true)
    outputChatBox("#FFFFFF<< #BABABA"..getPlayerName(plr).."["..getElementData(plr,"id").."]: #ffffff"..text..""target___true) 

      local pm_text=('PM> %s(%d) >> %s(%d): %s'):format(getPlayerName(plr), getElementData(plr,"id"), getPlayerName(target), getElementData(target,"id"), text)
      triggerClientEvent(root"admin:addText"rootpm_text)
end
addCommandHandler('pw'onPrivateMessage)
addCommandHandler('pm'onPrivateMessage)

function zaplacPieniadze(plrcmdcelvalue)
    if elementdatanauid == player:uid then
cancelEvent()
end

    if not(value or celthen
    outputChatBox("#FF007E* U?yj: /przelej <nick/ID> <kwota>"plr,255,0,0,true)
        return
    end
    
    local target znajdzGracza(plrcel)
    
    if not(targetthen
    outputChatBox("#FF007E* Nie znaleziono gracza o podanym ID/nicku!"plr,255,0,0,true)
        return
    end
    
    if tonumber(value) < 0 then return end
    if (not tonumber(value)) then return end

    if getPlayerMoney(plr) < tonumber(valuethen
    outputChatBox("#FF007E* Nie posiadasz wystarczaj?cej ilo?ci pieni?dzy!"plr25500,true)
        return
    end
    
    takePlayerMoney(plrtonumber(value))
    givePlayerMoney(targettonumber(value))
    outputChatBox("#FF007E* Gracz #DDDDDD"..getPlayerName(plr).." #FF007Eprzekazuje Ci #DDDDDD"..tonumber(value).." #FF007EZ?."target,255,0,0,true)
    outputChatBox("* #FF007EPrzekazujesz #DDDDDD"..tonumber(value).." #FF007EZ? graczowi #DDDDDD"..getPlayerName(target)..""plr ,255,0,0,true)
end
addCommandHandler("przelej"zaplacPieniadze)
addCommandHandler("zaplac"zaplacPieniadze)
addCommandHandler("dajkase"zaplacPieniadze)

setTimer(function()
    local vehicles=getElementsByType('vehicle')
    for _vehicle in pairs(vehicles) do
        if getElementHealth(vehicle)<300 then
            setVehicleDamageProof(vehicletrue)
        elseif getElementHealth(vehicle)>301 then
            setVehicleDamageProof(vehiclefalse)
        end
     end
end5000)


DB:

ERROR: Loading script failed: blablabla/ogrpg-core/cmd.lua:31: function arguments expected near 'then'

Dobrze? :D

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-08-15, 15:30


noose

JESTĘ SKRYPTERĘ






Wiek: 35
Na forum: 3756 dni
Posty: 222

Piwa: 2294

Respekt: 155,8
Respekt: 155,8Respekt: 155,8

if target == plr then return  outputChatBox('Nie mo?esz wysy?a? pieni?dzy samemu sobie'plrend


Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-08-15, 15:37


AlaneqYT

Uczeń LUA






Wiek: 25
Na forum: 3884 dni
Posty: 37

Piwa: 20

Respekt: 25,3

Ostrzeżeń: 20%
Dalej nic.
DB3:
ogrpg-core/cmd.lua:31: attempt to call global 'znajdzGracza' ( a nil value)

--[[
    ResourceOURGame v2
    DevelopersSplit <split.programista@gmail.com>
    You have no right to use this code without my permission.
    (c2015 <split.programista@gmail.com>. All rights reserved.
]]

function onPrivateMessage(plrcmdtarget, ...)
    if not target or not {...} then
        outputChatBox('* U?yj /pm <nick/ID> <tre??>'plr)
        return
    end

    local text=table.concat({...}, ' ')
    local target=findPlayer(plrtarget)
    if not target then
        outputChatBox('* Nie znaleziono podanego gracza.'plr25500)
        return
    end

    outputChatBox("#FFFFFF>> #BABABA"..getPlayerName(target).."["..getElementData(target,"id").."]: #ffffff"..text..""plr___true)
    outputChatBox("#FFFFFF<< #BABABA"..getPlayerName(plr).."["..getElementData(plr,"id").."]: #ffffff"..text..""target___true) 

      local pm_text=('PM> %s(%d) >> %s(%d): %s'):format(getPlayerName(plr), getElementData(plr,"id"), getPlayerName(target), getElementData(target,"id"), text)
      triggerClientEvent(root"admin:addText"rootpm_text)
end
addCommandHandler('pw'onPrivateMessage)
addCommandHandler('pm'onPrivateMessage)

function zaplacPieniadze(plrcmdcelvalue)
   local target znajdzGracza(plrcel)
  if target == plr then return  
  outputChatBox('Nie mo?esz wysy?a? pieni?dzy samemu sobie'plr) 
  end

    if not(value or celthen
    outputChatBox("#FF007E* U?yj: /przelej <nick/ID> <kwota>"plr,255,0,0,true)
        return
    end
    
    
    if not(targetthen
    outputChatBox("#FF007E* Nie znaleziono gracza o podanym ID/nicku!"plr,255,0,0,true)
        return
    end
    
    if tonumber(value) < 0 then return end
    if (not tonumber(value)) then return end

    if getPlayerMoney(plr) < tonumber(valuethen
    outputChatBox("#FF007E* Nie posiadasz wystarczaj?cej ilo?ci pieni?dzy!"plr25500,true)
        return
    end
    
    takePlayerMoney(plrtonumber(value))
    givePlayerMoney(targettonumber(value))
    outputChatBox("#FF007E* Gracz #DDDDDD"..getPlayerName(plr).." #FF007Eprzekazuje Ci #DDDDDD"..tonumber(value).." #FF007EZ?."target,255,0,0,true)
    outputChatBox("* #FF007EPrzekazujesz #DDDDDD"..tonumber(value).." #FF007EZ? graczowi #DDDDDD"..getPlayerName(target)..""plr ,255,0,0,true)
end
addCommandHandler("przelej"zaplacPieniadze)
addCommandHandler("zaplac"zaplacPieniadze)
addCommandHandler("dajkase"zaplacPieniadze)

setTimer(function()
    local vehicles=getElementsByType('vehicle')
    for _vehicle in pairs(vehicles) do
        if getElementHealth(vehicle)<300 then
            setVehicleDamageProof(vehicletrue)
        elseif getElementHealth(vehicle)>301 then
            setVehicleDamageProof(vehiclefalse)
        end
     end
end5000)


nie wiem, czy dobrze czy ?le. co lepiej by by?o zrobi? - zablokowa? wej?cie 2 os?b na 1 koncie ( ?eby nie mogli by? w tym samym czasie na jednym koncie ) czy zablokowa? przesy?anie do tego same uid ? Bo jak s? 2 osoby na jednym koncie to mo?na bugowa? pieni?dze ( oczywi?cie ogrpg ) je?eli kto? m?g?by to mo?e pom?c z panelem logowania: kod:

server:

addEvent("logging:checkAccount"true)
addEventHandler("logging:checkAccount"resourceRoot, function(login,pass)
    local result=exports["ogrpg-db"]:dbGet("SELECT * FROM ogrpg_users WHERE login=?"login)
    if result and #result > 0 then
        if result[1].login == login and result[1].pass == md5(passthen
            local account getAccount(login,pass)
            if account then
                logIn(client,account,pass)
            end
            setPlayerName(clientlogin)
            setElementData(client"player:uid"result[1].id)
            triggerClientEvent(client"logging:result"resourceRoottruenil)
                        
        else
            triggerClientEvent(client"logging:result"resourceRootfalse"Podane dane s? nieprawid?owe.")
        end
    else
        triggerClientEvent(client"logging:result"resourceRootfalse"Podany login nie istnieje w bazie.")
    end
end)
addEvent("onClientSendRegisterDataToServer"true)
addEventHandler("onClientSendRegisterDataToServer"getRootElement(), dodaj)
addEvent("logging:newAccount"true)
addEventHandler("logging:newAccount"resourceRoot, function(login,pass)
       local result=exports["ogrpg-db"]:dbGet("SELECT * FROM ogrpg_users WHERE login=?"login)
    if result and #result > 0 then
        triggerClientEvent(client"logging:result"resourceRootfalse"Podany login ju? istnieje w bazie.")
    else
        local query=exports["ogrpg-db"]:dbSet("INSERT INTO ogrpg_users (login,pass) VALUES (?,?)"loginmd5(pass))
        if getPlayerFromName(Playerthen 
        triggerClientEvent(client"logging:result"resourceRootfalse"Ktos juz jest na tym koncie.")
        else
        triggerClientEvent(client"logging:result"resourceRootfalse"Pomy?lnie zalogowa?e?/a? si?")
        end
        if query then
            triggerClientEvent(client"logging:result"resourceRootfalse"Pomy?lnie zalogowa?e?/a? si?")
            addAccount(loginpass)
            logIn(client,login,pass)
        end
    end
end)


client:

--[[
    ResourceOURGame v2
    DevelopersSplit <split.programista@gmail.com>
    You have no right to use this code without my permission.
    (c2015 <split.programista@gmail.com>. All rights reserved.
]]

local sx,sy=guiGetScreenSize()
local data={ showed=nilbutton={}, info=nilmisc=nil, }

function isMouseIn(psx,psy,pssx,pssy,abx,aby)
    if not isCursorShowing() then return end
    cx,cy=getCursorPosition()
    cx,cy=cx*sx,cy*sy
    if cx >= psx and cx <= psx+pssx and cy >= psy and cy <= psy+pssy then
        return true,cx,cy
    else
        return false
    end
end

function renderLoginBox()
    dxDrawRectangle(sx*0/1024sy*201/768sx*1024/1024sy*308/768tocolor(000188
), false)
    if data.info then dxDrawText(data.infosx*252/1024sy*232/768sx*800/1024sy*255/768tocolor(23700255), 1.00"default""center""center"falseend
    dxDrawLine(sx*0/1024sy*199/768sx*1022/1024sy*200/768tocolor(31111193255), 5false)
    dxDrawLine(sx*0/1024sy*509/768sx*1022/1024sy*510/768tocolor(31111193255), 5false)
    dxDrawText("Second-World.pl"sx*0/1024sy*157/768sx*1024/1024sy*237/768white2.00"pricedown""center""center"false)
    dxDrawText("U?ytkownik:"sx*256/1024sy*272/768sx*484/1024sy*305/768white1.00"default-bold""center""center"false)
    dxDrawText("Has?o"sx*571/1024sy*269/768sx*799/1024sy*302/768white1.00"default-bold""center""center"false)
    if not isMouseIn(sx*256/1024sy*408/768sx*226/1024sy*45/768then dxDrawRectangle(sx*256/1024sy*408/768sx*226/1024sy*45/768tocolor(2698197255), false)
    else dxDrawRectangle(sx*256/1024sy*408/768sx*226/1024sy*45/768tocolor(000202), falseend
    if not isMouseIn(sx*573/1024sy*407/768sx*226/1024sy*45/768then dxDrawRectangle(sx*573/1024sy*407/768sx*226/1024sy*45/768tocolor(2698197255), false)
    else dxDrawRectangle(sx*573/1024sy*407/768sx*226/1024sy*45/768tocolor(000202), falseend
    dxDrawText("Zaloguj si?"sx*255/1024sy*408/768sx*482/1024sy*453/768white1.00"default""center""center"false)
    dxDrawText("Zarejestruj si?"sx*572/1024sy*407/768sx*799/1024sy*452/768white1.00"default""center""center"false)
end

addEventHandler("onClientClick"root, function(btn,state)
    if btn=="left" and state=="down" then
        if isMouseIn(sx*256/1024sy*408/768sx*226/1024sy*45/768) and data.showed then
            local login=guiGetText(data.button[1])
            local pass=guiGetText(data.button[2])
            if string.len(login) < or string.len(pass) < 2 then
                data.info="Wype?nij wszystkie pola!"
                return
            end
            triggerServerEvent("logging:checkAccount"resourceRootloginpass)
        end
        if isMouseIn(sx*573/1024sy*407/768sx*226/1024sy*45/768) and data.showed then
            local login=guiGetText(data.button[1])
            local pass=guiGetText(data.button[2])
            if string.len(login) < or string.len(pass) < 2 then
                data.info="Wype?nij wszystkie pola!"
                return
            end
            if string.len(login) > 22 or string.len(pass) > 30 then
                data.info="Login/Has?o musi mie? mniej ni? 22/30 znak?w."
                return
            end
            triggerServerEvent("logging:newAccount"resourceRootloginpass)
        end
    end
end)

addEvent("logging:result"true)
addEventHandler("logging:result"resourceRoot, function(value,info)
    if not info then info="" end
    if value then
        data.showed=false
        showZones(data.misc)
        
        -- Usuwamy elementy
        destroyElement(data.button[1])
        destroyElement(data.button[2])
        removeEventHandler("onClientRender"rootrenderLoginBox)
    else
        data.info=tostring(info)
        setTimer(function() data.info=nil end30001)
    end
end)

addEventHandler("onClientResourceStart"resourceRoot, function()
    showChat(false)
    showCursor(true)
    fadeCamera(true)
    data.showed=true
    setElementAlpha(localPlayer,0)
    data.misc=playSound("misc/intro.mp3",true)
    setSoundVolume(data.misc1.0)
    showPlayerHudComponent("all",false)
    guiSetInputMode("no_binds_when_editing")
    setElementData(localPlayer,"status","Loguje si?")
    setElementData(localPlayer,"player:logged",false)
    addEventHandler("onClientRender"rootrenderLoginBox)
    data.button[1]=guiCreateEdit(0.250.410.220.05""true)
    data.button[2]=guiCreateEdit(0.560.410.220.05""true)   
end)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-08-15, 15:52


noose

JESTĘ SKRYPTERĘ






Wiek: 35
Na forum: 3756 dni
Posty: 222

Piwa: 2294

Respekt: 155,8
Respekt: 155,8Respekt: 155,8

Szczerze to tak, zapewne lepiej by?oby zablokowa? wej?cie 2 graczy na to samo konto, ale to ju?, za wysokie progi dla mnie ;) Ja sam jeszcze si? ucz?, wi?c p?ki co postaram si? pom?c w miar? moich mo?liwo?ci.

Jak masz
function zaplacPieniadze(plrcmdcelvalue)
   local target znajdzGracza(plrcel)
  if target == plr then return  
  outputChatBox('Nie mo?esz wysy?a? pieni?dzy samemu sobie'plr) 
  end


To zamie? to na
function zaplacPieniadze(plrcmdtargetvalue)
  if target == plr then return  
  outputChatBox('Nie mo?esz wysy?a? pieni?dzy samemu sobie'plr) 
  end


Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-08-15, 15:57


AlaneqYT

Uczeń LUA






Wiek: 25
Na forum: 3884 dni
Posty: 37

Piwa: 20

Respekt: 25,3

Ostrzeżeń: 20%
Dalej nie dzia?a,
DB3:
ogrpg-core/cmd.lua:57: attempt to concatenate a boolean value
Kod:
--[[
    ResourceOURGame v2
    DevelopersSplit <split.programista@gmail.com>
    You have no right to use this code without my permission.
    (c2015 <split.programista@gmail.com>. All rights reserved.
]]

function onPrivateMessage(plrcmdtarget, ...)
    if not target or not {...} then
        outputChatBox('* U?yj /pm <nick/ID> <tre??>'plr)
        return
    end

    local text=table.concat({...}, ' ')
    local target=findPlayer(plrtarget)
    if not target then
        outputChatBox('* Nie znaleziono podanego gracza.'plr25500)
        return
    end

    outputChatBox("#FFFFFF>> #BABABA"..getPlayerName(target).."["..getElementData(target,"id").."]: #ffffff"..text..""plr___true)
    outputChatBox("#FFFFFF<< #BABABA"..getPlayerName(plr).."["..getElementData(plr,"id").."]: #ffffff"..text..""target___true) 

      local pm_text=('PM> %s(%d) >> %s(%d): %s'):format(getPlayerName(plr), getElementData(plr,"id"), getPlayerName(target), getElementData(target,"id"), text)
      triggerClientEvent(root"admin:addText"rootpm_text)
end
addCommandHandler('pw'onPrivateMessage)
addCommandHandler('pm'onPrivateMessage)

function zaplacPieniadze(plrcmdtargetvalue)
  if target == plr then return  
  outputChatBox('Nie mo?esz wysy?a? pieni?dzy samemu sobie'plr) 
  end

    if not(value or celthen
    outputChatBox("#FF007E* U?yj: /przelej <nick/ID> <kwota>"plr,255,0,0,true)
        return
    end
    
    
    if not(targetthen
    outputChatBox("#FF007E* Nie znaleziono gracza o podanym ID/nicku!"plr,255,0,0,true)
        return
    end
    
    if tonumber(value) < 0 then return end
    if (not tonumber(value)) then return end

    if getPlayerMoney(plr) < tonumber(valuethen
    outputChatBox("#FF007E* Nie posiadasz wystarczaj?cej ilo?ci pieni?dzy!"plr25500,true)
        return
    end
    
    takePlayerMoney(plrtonumber(value))
    givePlayerMoney(targettonumber(value))
    outputChatBox("#FF007E* Gracz #DDDDDD"..getPlayerName(plr).." #FF007Eprzekazuje Ci #DDDDDD"..tonumber(value).." #FF007EZ?."target,255,0,0,true)
    outputChatBox("* #FF007EPrzekazujesz #DDDDDD"..tonumber(value).." #FF007EZ? graczowi #DDDDDD"..getPlayerName(target)..""plr ,255,0,0,true)
end
addCommandHandler("przelej"zaplacPieniadze)
addCommandHandler("zaplac"zaplacPieniadze)
addCommandHandler("dajkase"zaplacPieniadze)

setTimer(function()
    local vehicles=getElementsByType('vehicle')
    for _vehicle in pairs(vehicles) do
        if getElementHealth(vehicle)<300 then
            setVehicleDamageProof(vehicletrue)
        elseif getElementHealth(vehicle)>301 then
            setVehicleDamageProof(vehiclefalse)
        end
     end
end5000)

Oczywi?cie to b?dzie dzia?a?o, je?eli dw?ch graczy b?dzie na jednym koncie i chcieli by bugowa? to nie b?d? mogli sobie przesy?a? tak?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-08-15, 16:52


noose

JESTĘ SKRYPTERĘ






Wiek: 35
Na forum: 3756 dni
Posty: 222

Piwa: 2294

Respekt: 155,8
Respekt: 155,8Respekt: 155,8

Ok, zr?bmy inaczej, wr??my do pierwszej mojej wersji

function zaplacPieniadze(plrcmdcelvalue)
  if getPlayerName(cel) == getPlayerName(plrthen return  
  outputChatBox('Nie mo?esz wysy?a? pieni?dzy samemu sobie'plr) 
  end

    if not(value or celthen
    outputChatBox("#FF007E* U?yj: /przelej <nick/ID> <kwota>"plr,255,0,0,true)
        return
    end
    
    
    if not(celthen
    outputChatBox("#FF007E* Nie znaleziono gracza o podanym ID/nicku!"plr,255,0,0,true)
        return
    end
    
    if tonumber(value) < 0 then return end
    if (not tonumber(value)) then return end

    if getPlayerMoney(plr) < tonumber(valuethen
    outputChatBox("#FF007E* Nie posiadasz wystarczaj?cej ilo?ci pieni?dzy!"plr25500,true)
        return
    end
    
    takePlayerMoney(plrtonumber(value))
    givePlayerMoney(celtonumber(value))
    outputChatBox("#FF007E* Gracz #DDDDDD"..getPlayerName(plr).." #FF007Eprzekazuje Ci #DDDDDD"..tonumber(value).." #FF007EZ?."cel,255,0,0,true)
    outputChatBox("* #FF007EPrzekazujesz #DDDDDD"..tonumber(value).." #FF007EZ? graczowi #DDDDDD"..getPlayerName(cel)..""plr ,255,0,0,true)
end
addCommandHandler("przelej"zaplacPieniadze)
addCommandHandler("zaplac"zaplacPieniadze)
addCommandHandler("dajkase"zaplacPieniadze)


Poszukaj czy w innych plikach tego zasobu jest zadeklarowana/opisana zmienna znajdzGracza.

BTW. kod kt?ry poda? Ci kolega przede mn? (elementdatanauid) by?by najlepszym wyj?ciem, a nie dzia?a? Ci, bo trzebaby by?o do niego zrobi? dodatkowy kod, kt?ry przy wej?ciu nadaje graczowi ID

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-08-15, 16:58


AlaneqYT

Uczeń LUA






Wiek: 25
Na forum: 3884 dni
Posty: 37

Piwa: 20

Respekt: 25,3

Ostrzeżeń: 20%
Dalej to samo ;/

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-08-15, 18:11


=DC=







Wiek: 35
Na forum: 3944 dni
Posty: 223
Nick w MP: =DC=

Piwa: 72

Respekt: 150
Respekt: 150Respekt: 150


function zaplacPieniadze(plrcmdkomuvalue
    local cel getPlayerFromName(komu)
    if plr == cel then 
        outputChatBox('Nie mo?esz wysy?a? pieni?dzy samemu sobie'plr) 
        return  
    end

    if (not value) or (not celthen
        outputChatBox("#FF007E* U?yj: /przelej <nick/ID> <kwota>"plr,255,0,0,true)
        return
    end
    
    if (not celthen
        outputChatBox("#FF007E* Nie znaleziono gracza o podanym ID/nicku!"plr,255,0,0,true)
        return
    end
    
    if tonumber(value) < 0 then return end
    if (not tonumber(value)) then return end

    if getPlayerMoney(plr) < tonumber(valuethen
        outputChatBox("#FF007E* Nie posiadasz wystarczaj?cej ilo?ci pieni?dzy!"plr25500,true)
        return
    end
    
    takePlayerMoney(plrtonumber(value))
    givePlayerMoney(celtonumber(value))
    outputChatBox("#FF007E* Gracz #DDDDDD"..getPlayerName(plr).." #FF007Eprzekazuje Ci #DDDDDD"..tonumber(value).." #FF007EZ?."cel,255,0,0,true)
    outputChatBox("* #FF007EPrzekazujesz #DDDDDD"..tonumber(value).." #FF007EZ? graczowi #DDDDDD"..getPlayerName(cel)..""plr ,255,0,0,true)
end
addCommandHandler("przelej"zaplacPieniadze)
addCommandHandler("zaplac"zaplacPieniadze)
addCommandHandler("dajkase"zaplacPieniadze)

Zamie? na to i sprawd? :P

Podpis

Witaj
, jeśli Ci pomogłem postaw mi :piwo: lub R* Dzięki!

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-08-15, 19:34


AlaneqYT

Uczeń LUA






Wiek: 25
Na forum: 3884 dni
Posty: 37

Piwa: 20

Respekt: 25,3

Ostrzeżeń: 20%
Dalej nic nie dzia?a ;///

--[[
    ResourceOURGame v2
    DevelopersSplit <split.programista@gmail.com>
    You have no right to use this code without my permission.
    (c2015 <split.programista@gmail.com>. All rights reserved.
]]

function onPrivateMessage(plrcmdtarget, ...)
    if not target or not {...} then
        outputChatBox('* U?yj /pm <nick/ID> <tre??>'plr)
        return
    end

    local text=table.concat({...}, ' ')
    local target=findPlayer(plrtarget)
    if not target then
        outputChatBox('* Nie znaleziono podanego gracza.'plr25500)
        return
    end

    outputChatBox("#FFFFFF>> #BABABA"..getPlayerName(target).."["..getElementData(target,"id").."]: #ffffff"..text..""plr___true)
    outputChatBox("#FFFFFF<< #BABABA"..getPlayerName(plr).."["..getElementData(plr,"id").."]: #ffffff"..text..""target___true) 

      local pm_text=('PM> %s(%d) >> %s(%d): %s'):format(getPlayerName(plr), getElementData(plr,"id"), getPlayerName(target), getElementData(target,"id"), text)
      triggerClientEvent(root"admin:addText"rootpm_text)
end
addCommandHandler('pw'onPrivateMessage)
addCommandHandler('pm'onPrivateMessage)



function zaplacPieniadze(plrcmdkomuvalue
    local cel getPlayerFromName(komu)
    if plr == cel then 
        outputChatBox('Nie mo?esz wysy?a? pieni?dzy samemu sobie'plr) 
        return  
    end

    if (not value) or (not celthen
        outputChatBox("#FF007E* U?yj: /przelej <nick/ID> <kwota>"plr,255,0,0,true)
        return
    end
    
    if (not celthen
        outputChatBox("#FF007E* Nie znaleziono gracza o podanym ID/nicku!"plr,255,0,0,true)
        return
    end
    
    if tonumber(value) < 0 then return end
    if (not tonumber(value)) then return end

    if getPlayerMoney(plr) < tonumber(valuethen
        outputChatBox("#FF007E* Nie posiadasz wystarczaj?cej ilo?ci pieni?dzy!"plr25500,true)
        return
    end
    
    takePlayerMoney(plrtonumber(value))
    givePlayerMoney(celtonumber(value))
    outputChatBox("#FF007E* Gracz #DDDDDD"..getPlayerName(plr).." #FF007Eprzekazuje Ci #DDDDDD"..tonumber(value).." #FF007EZ?."cel,255,0,0,true)
    outputChatBox("* #FF007EPrzekazujesz #DDDDDD"..tonumber(value).." #FF007EZ? graczowi #DDDDDD"..getPlayerName(cel)..""plr ,255,0,0,true)
end
addCommandHandler("przelej"zaplacPieniadze)
addCommandHandler("zaplac"zaplacPieniadze)
addCommandHandler("dajkase"zaplacPieniadze)




setTimer(function()
    local vehicles=getElementsByType('vehicle')
    for _vehicle in pairs(vehicles) do
        if getElementHealth(vehicle)<300 then
            setVehicleDamageProof(vehicletrue)
        elseif getElementHealth(vehicle)>301 then
            setVehicleDamageProof(vehiclefalse)
        end
     end
end5000)


DB:

ogrpg-core/cmd.lua:33: ')' expected near 'local'

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-08-15, 19:36


=DC=







Wiek: 35
Na forum: 3944 dni
Posty: 223
Nick w MP: =DC=

Piwa: 72

Respekt: 150
Respekt: 150Respekt: 150


--[[
    ResourceOURGame v2
    DevelopersSplit <split.programista@gmail.com>
    You have no right to use this code without my permission.
    (c2015 <split.programista@gmail.com>. All rights reserved.
]]

function onPrivateMessage(plrcmdtarget, ...)
    if not target or not {...} then
        outputChatBox('* U?yj /pm <nick/ID> <tre??>'plr)
        return
    end

    local text=table.concat({...}, ' ')
    local target=findPlayer(plrtarget)
    if not target then
        outputChatBox('* Nie znaleziono podanego gracza.'plr25500)
        return
    end

    outputChatBox("#FFFFFF>> #BABABA"..getPlayerName(target).."["..getElementData(target,"id").."]: #ffffff"..text..""plr___true)
    outputChatBox("#FFFFFF<< #BABABA"..getPlayerName(plr).."["..getElementData(plr,"id").."]: #ffffff"..text..""target___true) 

      local pm_text=('PM> %s(%d) >> %s(%d): %s'):format(getPlayerName(plr), getElementData(plr,"id"), getPlayerName(target), getElementData(target,"id"), text)
      triggerClientEvent(root"admin:addText"rootpm_text)
end
addCommandHandler('pw'onPrivateMessage)
addCommandHandler('pm'onPrivateMessage)



function zaplacPieniadze(plrcmdkomuvalue)
    local cel getPlayerFromName(komu)
    if plr == cel then 
        outputChatBox('Nie mo?esz wysy?a? pieni?dzy samemu sobie'plr) 
        return  
    end

    if (not value) or (not celthen
        outputChatBox("#FF007E* U?yj: /przelej <nick/ID> <kwota>"plr,255,0,0,true)
        return
    end
    
    if (not celthen
        outputChatBox("#FF007E* Nie znaleziono gracza o podanym ID/nicku!"plr,255,0,0,true)
        return
    end
    
    if tonumber(value) < 0 then return end
    if (not tonumber(value)) then return end

    if getPlayerMoney(plr) < tonumber(valuethen
        outputChatBox("#FF007E* Nie posiadasz wystarczaj?cej ilo?ci pieni?dzy!"plr25500,true)
        return
    end
    
    takePlayerMoney(plrtonumber(value))
    givePlayerMoney(celtonumber(value))
    outputChatBox("#FF007E* Gracz #DDDDDD"..getPlayerName(plr).." #FF007Eprzekazuje Ci #DDDDDD"..tonumber(value).." #FF007EZ?."cel,255,0,0,true)
    outputChatBox("* #FF007EPrzekazujesz #DDDDDD"..tonumber(value).." #FF007EZ? graczowi #DDDDDD"..getPlayerName(cel)..""plr ,255,0,0,true)
end
addCommandHandler("przelej"zaplacPieniadze)
addCommandHandler("zaplac"zaplacPieniadze)
addCommandHandler("dajkase"zaplacPieniadze)




setTimer(function()
    local vehicles=getElementsByType('vehicle')
    for _vehicle in pairs(vehicles) do
        if getElementHealth(vehicle)<300 then
            setVehicleDamageProof(vehicletrue)
        elseif getElementHealth(vehicle)>301 then
            setVehicleDamageProof(vehiclefalse)
        end
     end
end5000)

Sprawd? teraz :P

Podpis

Witaj
, jeśli Ci pomogłem postaw mi :piwo: lub R* Dzięki!

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-08-15, 19:39


AlaneqYT

Uczeń LUA






Wiek: 25
Na forum: 3884 dni
Posty: 37

Piwa: 20

Respekt: 25,3

Ostrzeżeń: 20%
Teraz skrypt dzia?a, ale nie mo?na przelewa? teraz do nikogo.
Wy?wietla si? tylko: U?yj: /zaplac <nick> <kwota>

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-08-15, 19:42


=DC=







Wiek: 35
Na forum: 3944 dni
Posty: 223
Nick w MP: =DC=

Piwa: 72

Respekt: 150
Respekt: 150Respekt: 150

Je?li Ci tak pokazuje to znaczy ?e gracz do kt?rego chcesz wys?a? wiadomo?? nie jest na serwerze czyli go nie ma albo druga opcja je?li gracz ma w nicku nawiasy albo inne znaki to ich nie wpisa?e?. Musisz poda? pe?en nick np [LOL]=DC= :P

Podpis

Witaj
, jeśli Ci pomogłem postaw mi :piwo: lub R* Dzięki!

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-08-15, 19:45


AlaneqYT

Uczeń LUA






Wiek: 25
Na forum: 3884 dni
Posty: 37

Piwa: 20

Respekt: 25,3

Ostrzeżeń: 20%
Dobra i tak to nie b?dzie dzia?a? inaczej by to bugowali.
Wie kto? mo?e jak zablokowa? zalogowanie 2 os?b na jedno konto?

Ostatnio zmieniony przez AlaneqYT 2016-08-15, 19:59, w całości zmieniany 1 raz  
Postaw piwo autorowi tego posta
 

 
Tagi: blokada :: przesyłania :: pieniędzy :: samo :: uid
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