Skip to content

Addition and Modification in OnPlayerCommandText.pwn#842

Open
Specifer wants to merge 4 commits into
LVPlayground:masterfrom
Specifer:Modify-/admins-&-adding-/vips
Open

Addition and Modification in OnPlayerCommandText.pwn#842
Specifer wants to merge 4 commits into
LVPlayground:masterfrom
Specifer:Modify-/admins-&-adding-/vips

Conversation

@Specifer
Copy link
Copy Markdown
Collaborator

Change in /admins and addition of /vips.

Tested.

Change in /admins
I have added a level Temp. Admin in /admins for players to differentiate full-time admins and part-time, Since temp admins operate at limited power. I felt this knowledge should be transparent to fellow players. Tested it thoroughly. And admins can see who temp'ed the person while players only see temp-admin. Also, added Developers to this list since it was long overdue? What do you think?

Addition of /vips

Just similar to /admins but shows also higher level (i.e) VIP, Developer, Administrator, and Manager.

Change in /admins and addition of /vips.

Tested..
@FreakinsPL
Copy link
Copy Markdown
Contributor

My opinions

  1. Make a separate cmd to see ingame developers (/devs)rather than including them in /admins coz they don't have admin rights.

  2. I don't think so there's a reason of making /vips, why ppl wants to see who is vip and who is not? :)

@OttoRocket-LVP @Specifer

format(playerLevel, sizeof(playerLevel), "Developer");
if (Player(player)->isAdministrator() && !Player(player)->isManagement())
format(playerLevel, sizeof(playerLevel), "Administrator");
format(playerLevel, sizeof(playerLevel), "Administrator");
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NIT: You added a enter here

// If the user was temp'd, show admins who temp'd the player.
if (tempLevel[player] == 1 || tempLevel[player] == 2) {
if (Player(playerid)->isAdministrator())
{
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happened here? There's brackets without an if statement or whatso ever.

You might've made a mistake?

if (tempLevel[player] == 1 || tempLevel[player] == 2) {
if (Player(playerid)->isAdministrator())
{
if (Player(playerid)->isAdministrator() && Player(playerid)->isManagement())
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isAdministrator is redundant here. If you're management you're always an admin

}
else {
if (tempLevel[player] == 2)
format(message, sizeof(message), " %s (Id:%d) - {FF8E02}Temp.Admin",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we really want to display that they're temporary?

If so we'd want to spell it out fully.



if (Player(player)->isDeveloper())
format(playerLevel, sizeof(playerLevel), "Developer");
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we really want to have Developers among this list?

It'll probably be unclear to players that they do not have administrator rights and thus can't help them with houses reports and such

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, but they can report bugs to devs directly?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you want, I can remove it.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A developer has no administrative capability so I think adding them to /admins would be missleading.

@OttoRocket-LVP
Copy link
Copy Markdown
Contributor

Thank you for your modification as always!

Are you sure you fully tested this @Specifer? (With all levels mentioned?) I think there might be some minor issues.

Also please see inline comments.

@Specifer
Copy link
Copy Markdown
Collaborator Author

Specifer commented Jan 24, 2021

Yes Tested fully by myself.
I'll also recheck once it is in staging with Freakins.

@Specifer
Copy link
Copy Markdown
Collaborator Author

Everything good?

if (!Player(player)->isAdministrator()) continue;
if (IsPlayerAdmin(player)) continue;


Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NIT: Some redundantent enters here



if (Player(player)->isDeveloper())
format(playerLevel, sizeof(playerLevel), "Developer");
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A developer has no administrative capability so I think adding them to /admins would be missleading.

Comment thread pawn/Resources/Callbacks/OnPlayer/OnPlayerCommandText.pwn
player, playerLevel);

// If the user was temp'd, show admins who temp'd the player.
if (tempLevel[player] == 1 || tempLevel[player] == 2) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is your reason to swap these ifs arounds?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't it right?

Player(player)->nicknameString(), UserTemped[player], player, playerLevel);
}
else {
if (tempLevel[player] == 2)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This condition is caught in the if statement above. This code should never be reached as I'm reading it?

return 1;
}

if (strcmp(cmd, "/vips", true) == 0) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't it be nice to have this in JavaScript instead?

We'd like to move all code to JavaScript

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Um maybe for the moment? can we keep pwn. I'll make js for both /admins and /vip altogether.

if (Player(player)->isVip())
format(playerLevel, sizeof(playerLevel), "VIP");
if (Player(player)->isDeveloper())
format(playerLevel, sizeof(playerLevel), "VIP / Developer");
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A Developer doesn't always have to be a VIP. I believe showing "Developer" would be enough

SendClientMessage(playerid, COLOR_ORANGE, "List of VIPs online in Las Venturas Playground");

new message[128], vipCount = 0, playerLevel[30];
for (new player = 0; player <= PlayerManager->highestPlayerId(); player++) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe calling the variable "playerId" would be more suitable.

"player" would assume that it's the entity player.

@Specifer
Copy link
Copy Markdown
Collaborator Author

Specifer commented Feb 1, 2021

Dude holsje? Reply if this new commit has resolved the errors.

@FreakinsPL
Copy link
Copy Markdown
Contributor

It would be good if we make this /vips cmd simple as possible.

Even if the players are administrators, managers or a developers. The /vips command should show only -VIP after the player name

example:-

Vip connected:
Freakins -VIP
Specifer -VIP
Holsje -VIP
Xilent -VIP

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants