Patt420
Wiek: 26 Na forum: 2124 dni Posty: 10
Nick w MP: Patt420
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 ( plr , cmd , target , value )
if not target or not tonumber ( value ) then
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" ) == true ) then
outputChatBox ( '* Gracz nie jest zalogowany!.' , plr , 255 , 0 , 0 )
return end
if getPlayerMoney ( plr ) < value then
outputChatBox ( "* Nie masz wystarczajacych ?rodk?w." , plr )
return
end
if value == 0 or value < 0 then
outputChatBox ( "* Poda?e?(a?) nie prawid?ow? warto??." , plr )
return
end
takePlayerMoney ( plr , value )
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: " .. value , plr , 245 , 219 , 0 , true )
outputChatBox ( "* Dosta?e?(a?) pieni?dze od: [" .. getElementData ( plr , "id" ).. "]" .. getPlayerName ( plr ): gsub ( "#%x%x%x%x%x%x" , "" ).. " ilo?? otrzymanej got?wki: " .. value , target , 225 , 199 , 0 , true )
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" , resourceRoot , transfer_text , 4 , "PRZELEWY" )
triggerEvent ( "admin:addText" , resourceRoot , transfer_text : gsub ( "#%x%x%x%x%x%x" , "" ))
triggerEvent ( "admin:logs" , root , transfer_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