Skip to content
Open
Show file tree
Hide file tree
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
15 changes: 6 additions & 9 deletions pawn/Entities/Players/PlayerSettings.pwn
Original file line number Diff line number Diff line change
Expand Up @@ -96,16 +96,13 @@ class PlayerSettings <playerId (MAX_PLAYERS)> {

// TODO: Add individual settings which should be enabled by default here.
this->toggleSetting(AccountUpdatedForSettingsSettingKey, true);
}

/**
* Restores any settings which were altered at giving tempadmin. Each setting will default to
* what they should be for a normal player. It will automatically be invoked when a player
* disconnects from Las Venturas Playground.
*/
@list(OnPlayerDisconnect)
public restoreOnDisconnect() {
if (LegacyIsUserTempAdmin(playerId))
new const bool: isNoRegularButRegistered = Player(playerId)->isRegular() == false &&
Player(playerId)->isRegistered() == true;
if(Player(playerId)->isVip() == false && isNoRegularButRegistered == false)
this->setTeleportationDisabled(false);

if(Player(playerId)->isAdministrator() == false)
this->toggleSetting(MapTeleportationEnabledSettingKey, false);
}

Expand Down
18 changes: 11 additions & 7 deletions pawn/Features/Gameplay/Teleportation/TeleportationCommands.pwn
Original file line number Diff line number Diff line change
Expand Up @@ -136,13 +136,14 @@ class TeleportationCommands {
*/
@switch(PlayerCommand, "teleport")
public onPlayerTeleportCommand(playerId, subjectId, params[]) {
if (playerId == subjectId && Player(playerId)->isVip() == false && Player(playerId)->isAdministrator() == false) {
SendClientMessage(playerId, Color::Error, "This is a VIP only command. For more information, check out \"/donate\"!");
return 1;
}

if (playerId != subjectId && Player(subjectId)->isVip() == false) {
SendClientMessage(playerId, Color::Error, "Error: This player has no VIP status.");
new const bool: isNoRegularButRegistered = Player(playerId)->isRegular() == false &&
Player(playerId)->isRegistered() == true;

if (Player(playerId)->isVip() == false && isNoRegularButRegistered == false) {
if(playerId == subjectId)
SendClientMessage(playerId, Color::Error, "This is a VIP only command. For more information, check out \"/donate\"!");
else
SendClientMessage(playerId, Color::Error, "Error: This player has no VIP status.");
return 1;
}

Expand Down Expand Up @@ -174,6 +175,9 @@ class TeleportationCommands {
"{33AA33}enabled"));
SendClientMessage(playerId, Color::Success, message);

if(playerId == subjectId && Player(playerId)->isVip() == false && isNoRegularButRegistered == true )
SendClientMessage(playerId, Color::Information, "This is a VIP only command but enabled for new players. check out \"/donate\"!");

return 1;
}

Expand Down
4 changes: 0 additions & 4 deletions pawn/Interface/functions.pwn
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,6 @@ LegacySetValidKillerVariables(forPlayerId, killerId, reasonId) {
validReasonId[forPlayerId] = reasonId;
}

bool: LegacyIsUserTempAdmin(playerId) {
return tempLevel[playerId] > 0;
}

RemovePlayerFromAnyGame(playerId) {
if (Player(playerId)->isConnected() == false)
return 0;
Expand Down