36 lines
969 B
SourcePawn
36 lines
969 B
SourcePawn
#include <sourcemod>
|
|
#include <sdktools>
|
|
|
|
public Plugin myinfo = {
|
|
name = "AdminGod",
|
|
author = "Nonszy",
|
|
description = "Admin-only ttols",
|
|
version = "1.0",
|
|
url = "https://gitea.nonszy.space/nomi-nonsz/left4dead2-admingod"
|
|
};
|
|
|
|
public void OnPluginStart() {
|
|
RegConsoleCmd("slot10", Cmd_Slot10);
|
|
}
|
|
|
|
public Action Cmd_Slot10(int client, int args) {
|
|
if (!IsClientInGame(client) || !IsPlayerAlive(client)) return Plugin_Handled;
|
|
|
|
if (!CheckCommandAccess(client, "noclip_admin", ADMFLAG_GENERIC)) {
|
|
PrintToChat(client, "[SM] You do not have permission to use noclip.");
|
|
return Plugin_Handled;
|
|
}
|
|
|
|
int flags = GetEntityMoveType(client);
|
|
|
|
if (flags == MOVETYPE_NOCLIP) {
|
|
SetEntityMoveType(client, MOVETYPE_WALK);
|
|
PrintToChat(client, "[SM] Noclip OFF.");
|
|
} else {
|
|
SetEntityMoveType(client, MOVETYPE_NOCLIP);
|
|
PrintToChat(client, "[SM] Noclip ON.");
|
|
}
|
|
|
|
return Plugin_Handled;
|
|
}
|