Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 49 additions & 5 deletions pawn/Resources/Callbacks/OnPlayer/OnPlayerCommandText.pwn
Original file line number Diff line number Diff line change
Expand Up @@ -863,6 +863,7 @@ public OnPlayerCommandText(playerid, cmdtext[]) {
if (!Player(player)->isAdministrator()) continue;
if (IsPlayerAdmin(player)) continue;


if (Player(player)->isAdministrator() && !Player(player)->isManagement())
format(playerLevel, sizeof(playerLevel), "Administrator");
else if (Player(player)->isManagement())
Expand All @@ -872,12 +873,19 @@ public OnPlayerCommandText(playerid, cmdtext[]) {
format(message, sizeof(message), " %s (Id:%d) - {FF8E02}%s", Player(player)->nicknameString(),
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?

if (Player(playerid)->isAdministrator())
// If the user was temp'd, show admins who temp'd the player.
if (Player(playerid)->isAdministrator())
{
if (tempLevel[player] == 1 || tempLevel[player] == 2)
Comment thread
Specifer marked this conversation as resolved.
format(message, sizeof(message), " %s {CCCCCC}(temp'd by %s){FFFFFF} (Id:%d) - {FF8E02}%s",
Player(player)->nicknameString(), UserTemped[player], player, playerLevel);
}
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?

format(message, sizeof(message), " %s (Id:%d) - {FF8E02}Temporary Administrator",
Player(player)->nicknameString(), player);
}


// If a player is undercover, show this to other admins.
if (UndercoverAdministrator(player)->isUndercoverAdministrator()) {
Expand Down Expand Up @@ -906,6 +914,42 @@ public OnPlayerCommandText(playerid, cmdtext[]) {
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.

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

new message[128], vipCount = 0, playerLevel[30];
for (new playerId = 0; playerId <= PlayerManager->highestPlayerId(); playerId++) {
if (!Player(playerId)->isConnected()) continue;
if (!Player(playerId)->isVip()) continue;
if (IsPlayerAdmin(playerId)) continue;


if (Player(playerId)->isVip())
format(playerLevel, sizeof(playerLevel), "VIP");
if (Player(playerId)->isDeveloper())
format(playerLevel, sizeof(playerLevel), "Developer");
if (Player(playerId)->isAdministrator() && !Player(player)->isManagement())
format(playerLevel, sizeof(playerLevel), "VIP / Administrator");
if (Player(playerId)->isManagement())
format(playerLevel, sizeof(playerLevel), "Manager");

// Format the message for any general player.
format(message, sizeof(message), " %s (Id:%d) - {FFFF00}%s", Player(player)->nicknameString(),
playerId, playerLevel);



SendClientMessage(playerid, Color::Information, message);
vipCount++;
}

if (vipCount == 0)
SendClientMessage(playerid, Color::Information, "No VIPs are currently online in LVP.");

return 1;
}


if (strcmp(cmd, "/cardive", true) == 0) {
if ((Time->currentTime() - iDiveTime[playerid]) < 3 * 60 && !Player(playerid)->isAdministrator()) {
SendClientMessage(playerid, Color::Error, "Error: You can use this command once every 3 minutes.");
Expand Down