-
Notifications
You must be signed in to change notification settings - Fork 24
Addition and Modification in OnPlayerCommandText.pwn #842
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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()) | ||
|
|
@@ -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) { | ||
| 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) | ||
|
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) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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()) { | ||
|
|
@@ -906,6 +914,42 @@ public OnPlayerCommandText(playerid, cmdtext[]) { | |
| return 1; | ||
| } | ||
|
|
||
| if (strcmp(cmd, "/vips", true) == 0) { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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."); | ||
|
|
||
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't it right?