mixLoLmix2
Programista
Wiek: 35 Na forum: 4113 dni Posty: 454
Nick w MP: TomeQmix
Piwa : 1915
Za Pomoc Stawiam Piwo
Chodzi o to ze gdy wpisze /mandat to Pokazuje sie na chat ze trzeba wpisac /mandat ID Kwota Powod wiec ok
Gdy jestem daleko od gracze to jest na chat ze jest daleko
Ale gdy Chce komus da? mandat to Nic sie nie dzeje tylko jest b??d w db
function mandat33 ( plr , cmd , target , cash , ...)
if getElementData ( plr , "player:duty" ) and getElementData ( plr , "player:duty" ) == "SAPDLV" then
if not ( target ) or not ( cash ) or not (...) then
outputChatBox ( "B??d! U?yj: /mandat <nick/ID> <kwota> <pow?d>" , plr )
else
if getElementData ( plr , "player:rank" ) < 2 then outputChatBox ( "*Nie masz uprawnien" , plr ) return end
cash = tonumber ( cash )
if cash <= 0 then
outputChatBox ( "B??d: Mandat Nie mo?e by? na minusie!" , plr )
return
elseif cash > 32000 then
outputChatBox ( "B??d: Mandat Nie mo?e by? wi?kszy ni? 32,000PLN" , plr )
return
end
local targetElement = exports [ 'ogrpg-core' ]: findPlayer ( plr , target )
if targetElement then
local x , y , z = getElementPosition ( plr )
local tx , ty , tz = getElementPosition ( targetElement )
local distance = getDistanceBetweenPoints3D ( x , y , z , tx , ty , tz )
if ( distance <= 10 ) then
local reason = table . concat ({...}, ' ' )
local money = getPlayerMoney ( targetElement )
local takeFromCash = money - cash
if money >= cash then
outputChatBox ( "Wystawiono mandat dla %s, na kwot? %d PLN. Pow?d: %s" , format ( targetElement : getName (), cash , reason ))
outputChatBox ( "Otrzymano mandat od %s, na kwot? %d PLN. Pow?d: %s" , format ( plr : getName (), cash , reason ))
takePlayerMoney ( targetElement , cash )
givePlayerMoney ( plr , cash / 4 )
plr : outputChat (( 'Dostales kwot? %d PLN za wystawiony mandat dla %s' ): format ( cash / 4 , targetElement : getName ()))
triggerClientEvent ( root , "admin:addText" , root , "MANDAT> " .. getPlayerName ( plr ).. " wystawil mandat " .. getPlayerName ( targetElement ).. " w kwocie " .. cash .. ", powod: " .. reason .. "." )
else
outputChatBox ( "%s nie posiada pieni?dzy, na op?at? mandatu." , format ( targetElement : getName ()))
end
else
outputChatBox ( "Jeste? za daleko gracza, ?eby m?c wystawi? mandat." , plr )
end
end
end
end
end
addCommandHandler ( 'mandat' , mandat33 )
Db Jest na tych linikach
outputChatBox ( "Wystawiono mandat dla %s, na kwot? %d PLN. Pow?d: %s" , format ( targetElement : getName (), cash , reason ))
outputChatBox ( "Otrzymano mandat od %s, na kwot? %d PLN. Pow?d: %s" , format ( plr : getName (), cash , reason ))
Podpis
Zajmuję się pisaniem zaawansowanych skryptów lua na zamówienie za bardzo niską cene.
Oraz pomoc przy serwerze mta/forum i tym podobnych.
Discord: TomeQmix#7106