add sborka
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
local PLUGIN = PLUGIN
|
||||
|
||||
PLUGIN.name = "Starter Money"
|
||||
PLUGIN.author = "Scripty"
|
||||
PLUGIN.description = "Gives 10000 starting money to the first character ever created by a player."
|
||||
|
||||
if (SERVER) then
|
||||
function PLUGIN:OnCharacterCreated(client, character)
|
||||
local steamID = client:SteamID64()
|
||||
local key = "starter_money_" .. steamID
|
||||
|
||||
-- Check if player already received their one-time bonus
|
||||
if (!ix.data.Get(key, false)) then
|
||||
-- Save that they've now received it
|
||||
ix.data.Set(key, true)
|
||||
|
||||
-- Set starting money
|
||||
character:SetMoney(character:GetMoney() + 10000)
|
||||
|
||||
-- If you want it to be *added* to existing starting money if any
|
||||
-- character:SetMoney(character:GetMoney() + 10000)
|
||||
-- But the user said "давало 10000", which usually means "start with 10k"
|
||||
|
||||
client:Notify("Вам начислено 10,000 как новому игроку!")
|
||||
end
|
||||
end
|
||||
|
||||
ix.log.AddType("starterBonus", function(client, amount)
|
||||
return string.format("%s received a starter bonus of %d.", client:Name(), amount)
|
||||
end)
|
||||
end
|
||||
Reference in New Issue
Block a user