mirror of
https://github.com/sys4-fr/server-nalc.git
synced 2024-12-26 02:30:38 +01:00
[mff_pclasses] Remember to remove hunter bonus
- MFF PClasses : Remove hunter armor bonus upon unassigning
This commit is contained in:
parent
1191a57374
commit
3035e9660e
@ -19,6 +19,10 @@ pclasses.api.register_class("hunter", {
|
|||||||
end,
|
end,
|
||||||
on_unassigned = function(pname)
|
on_unassigned = function(pname)
|
||||||
sprint.decrease_maxstamina(pname, 10)
|
sprint.decrease_maxstamina(pname, 10)
|
||||||
|
if tmp[pname] then
|
||||||
|
sprint.decrease_maxstamina(pname, 10)
|
||||||
|
tmp[pname] = nil
|
||||||
|
end
|
||||||
end,
|
end,
|
||||||
on_update = function(pname)
|
on_update = function(pname)
|
||||||
local reinforced = pclasses.api.util.does_wear_full_armor(pname, "reinforcedleather", true)
|
local reinforced = pclasses.api.util.does_wear_full_armor(pname, "reinforcedleather", true)
|
||||||
|
@ -55,8 +55,8 @@ end
|
|||||||
function pclasses.api.set_player_class(pname, cname, inform)
|
function pclasses.api.set_player_class(pname, cname, inform)
|
||||||
if pclasses.api.get_class_by_name(cname) then
|
if pclasses.api.get_class_by_name(cname) then
|
||||||
if pclasses.api.get_player_class(pname) then
|
if pclasses.api.get_player_class(pname) then
|
||||||
pclasses.api.get_class_by_name(pclasses.api.get_player_class(pname)).on_unassigned(pname)
|
|
||||||
pclasses.api.get_class_by_name(pclasses.api.get_player_class(pname)).on_update(pname)
|
pclasses.api.get_class_by_name(pclasses.api.get_player_class(pname)).on_update(pname)
|
||||||
|
pclasses.api.get_class_by_name(pclasses.api.get_player_class(pname)).on_unassigned(pname)
|
||||||
end
|
end
|
||||||
pclasses.data.players[pname] = cname
|
pclasses.data.players[pname] = cname
|
||||||
local newclass = pclasses.api.get_class_by_name(cname)
|
local newclass = pclasses.api.get_class_by_name(cname)
|
||||||
|
Loading…
Reference in New Issue
Block a user