- 86
- 8
- Версия MoonLoader
- Другое
Скрипт загружает прописываю /depozit ноль реакции и как мне получить значения с сервера чтобы они автоматически обновлялись после пейдея?
Lua:
local sampfuncs = require "sampfuncs"
local initialDeposit = 1000
local interestRate = 0.05
local paydays = 10
local fullDepot = 10000
local function calculateInterest()
return initialDeposit * interestRate * paydays
end
local function depositInformation()
local interest = calculateInterest()
local finalAmount = initialDeposit + interest
return string.format("Initial deposit: $%d\nInterest rate: %.2f%%\nPaydays: %d\nInterest earned: $%.2f\nFinal amount: $%.2f", initialDeposit, interestRate * 100, paydays, interest, finalAmount)
end
sampRegisterChatCommand("OnPlayerCommandText", function(playerid, cmd)
if cmd == "/depozit" then
sampSendChat(playerid, depositInformation(), 255, 255, 255)
return true
end
end)