Skip to content
This repository has been archived by the owner on May 11, 2020. It is now read-only.

Commit

Permalink
feat: Display own profile when !p or !profile called without args
Browse files Browse the repository at this point in the history
This commit is related with #48. Players can now type !p or !profile
without any value to get their own profile info. Self profile is the
default so any wrong name would result in showing self profile
  • Loading branch information
Seniru committed Dec 21, 2019
1 parent 570fc15 commit 360c75f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions game.lua
Original file line number Diff line number Diff line change
Expand Up @@ -437,10 +437,10 @@ end

function displayProfile(name, target)
local up = upper(name)
local p = players[name] or players[up] or players[up .. "#0000"]
local p = players[name] or players[up] or players[up .. "#0000"] or players[target]
if p then
ui.addTextArea(900, closeButton .. "<p align='center'><font size='15'><b><BV>" .. p:getName() .."</BV></b></font></p><br><b>Level:</b> " .. tostring(p:getLevel()) .. "<BL><font size='12'> [" .. tostring(p:getXP()) .. "XP / " .. tostring(calculateXP(p:getLevel() + 1)) .. "XP]</font></BL><br><b>Money:</b> $" .. formatNumber(p:getMoney()) .. "<br><br><b>Working as a</b> " .. p:getJob() , target, 300, 100, 200, 130, nil, nil, 1, true)
end
ui.addTextArea(900, closeButton .. "<p align='center'><font size='15'><b><BV>" .. p:getName() .."</BV></b></font></p><br><b>Level:</b> " .. tostring(p:getLevel()) .. "<BL><font size='12'> [" .. tostring(p:getXP()) .. "XP / " .. tostring(calculateXP(p:getLevel() + 1)) .. "XP]</font></BL><br><b>Money:</b> $" .. formatNumber(p:getMoney()) .. "<br><br><b>Working as a</b> " .. p:getJob() , target, 300, 100, 200, 130, nil, nil, 1, true)
end
end

function displayHelp(target, mode)
Expand Down

0 comments on commit 360c75f

Please sign in to comment.