If that's Zeph's store, then Zeph's store is coded really shittily.
PHP Code:
new GAME_CSS = false; new GAME_CSGO = false; new GAME_DOD = false; new GAME_TF2 = false; new GAME_L4D = false; new GAME_L4D2 = false;
Like, the fuck? First off, use new syntax. Jesus. Secondly, why use these ints set to false? Shit don't make sense. Just use EngineVersion and grab the game type that way.
If that's Zeph's store, then Zeph's store is coded really shittily.
PHP Code:
new GAME_CSS = false;
new GAME_CSGO = false;
new GAME_DOD = false;
new GAME_TF2 = false;
new GAME_L4D = false;
new GAME_L4D2 = false;
Like, the fuck? First off, use new syntax. Jesus. Secondly, why use these ints set to false? Shit don't make sense. Just use EngineVersion and grab the game type that way.
Pretty sure it was made quite a long time ago and sold privately, and he ultimately released it quite some time down the road because the source was leaked.
Pretty sure it was made quite a long time ago and sold privately, and he ultimately released it quite some time down the road because the source was leaked.
I'm no longer involved with my old gaming community, and none of this code is currently running on our servers, so I'll post lots of my old code here hoping that it because useful to someone. Have fun
I'll post some too because it might end up being useful, but I don't want to create threads and provide support if needed.
Admins List
!admins - open the admins list.
(admin command) !admins <0/1> - make yourself invisible or visible in the list. Admins can see other invisible admins.
Admins with an immunity level of 100 or above are completely invisible and don't show up to other admins either.
The plugin also has my SteamID hardcoded so it doesn't display me whatsoever, even to other admins. Comment the #define HIDESHAVIT line if you want to disable the functionality.
Code:
#include <sourcemod>
#pragma semicolon 1
#pragma newdecls required
#define PLUGIN_VERSION "1.0"
// comment if you care about micro-optimizations
#define HIDESHAVIT
bool gB_Visible[MAXPLAYERS+1] = {true, ...};
public Plugin myinfo =
{
name = "Admins List",
author = "shavit",
description = "swag",
version = PLUGIN_VERSION,
url = "http://forums.alliedmods.net/member.php?u=163134"
}
public void OnClientAuthorized(int client, const char[] auth)
{
gB_Visible[client] = true;
}
public void OnPluginStart()
{
RegConsoleCmd("sm_admins", Command_Admins, "Show a list of online admins.");
}
public Action Command_Admins(int client, int args)
{
if(client == 0 || !IsClientInGame(client))
{
return Plugin_Handled;
}
bool bAdmin = CheckAdmin(client);
if(bAdmin && args > 0)
{
char sArg[8];
GetCmdArg(1, sArg, 8);
gB_Visible[client] = view_as<bool>(StringToInt(sArg));
ReplyToCommand(client, " \x03[admins]\x01 whoosh~! %s\x01.", gB_Visible[client]? "\x04VISIBLE":"\x02INVISIBLE");
return Plugin_Handled;
}
Menu menu = new Menu(MenuHandler_Admins);
menu.SetTitle("Admins list:");
char[] sDisplay = new char[MAX_NAME_LENGTH*2];
for(int i = 1; i <= MaxClients; i++)
{
if(CheckAdmin(i))
{
#if defined HIDESHAVIT
char sAuth[32];
GetClientAuthId(i, AuthId_Steam3, sAuth, 32);
// shavit
if(StrEqual(sAuth, "[U:1:204506329]"))
{
continue;
}
#endif
GetClientName(i, sDisplay, MAX_NAME_LENGTH*2);
if(!gB_Visible[i])
{
Format(sDisplay, MAX_NAME_LENGTH*2, "[INVISIBLE] %s", sDisplay);
}
if((gB_Visible[i] || bAdmin) && GetAdminImmunityLevel(GetUserAdmin(i)) < 100)
{
menu.AddItem(":)", sDisplay);
}
}
}
if(GetMenuItemCount(menu) == 0)
{
menu.AddItem(":(", "There are no admins online right now.\nBut hey - there might be a stealth one, so don't cause any issues, they may be watching you!");
}
menu.Display(client, 20);
return Plugin_Handled;
}
public int MenuHandler_Admins(Menu menu, MenuAction action, int param1, int param2)
{
if(action == MenuAction_End)
{
delete menu;
}
}
bool CheckAdmin(int client)
{
return CheckCommandAccess(client, "sm_admin", ADMFLAG_GENERIC);
}
CS:S/CS:GO Auto Restart
I don't know why, but someone asked me to write this before.
All it does is restart the round 10 seconds after the very first player connects, when a map changes.
Displays a player join/leave message message, but makes sure that the player isn't banned right now.
This was written because players could reconnect to a server endlessly before getting kicked via the SourceBans plugin and they would spam the server's chat.
Code:
#include <sourcemod>
#pragma semicolon 1
#pragma newdecls required
bool gB_MessagePrinted[MAXPLAYERS+1];
char gS_NameColor[16];
Database gH_DB = null;
public Plugin myinfo =
{
name = "[SB] Connect Message",
author = "shavit",
description = "Prints a dis/connection message for every player individually. Respects SourceBans(++) 1.5.x.",
version = "1.0",
url = "http://forums.alliedmods.net/member.php?u=163134"
}
public void OnPluginStart()
{
strcopy(gS_NameColor, 16, GetEngineVersion() == Engine_CSGO? " \x03":"\x0773F1FA");
HookEvent("player_connect", Player_ConnectMessageHook, EventHookMode_Pre);
HookEvent("player_disconnect", Player_ConnectMessageHook, EventHookMode_Pre);
Database.Connect(OnDatabaseConnected, "sourcebans");
}
public Action Player_ConnectMessageHook(Event event, const char[] sName, bool dB)
{
dB = true;
return Plugin_Changed;
}
public void OnDatabaseConnected(Database db, const char[] error, any data)
{
if(db == null)
{
SetFailState("Failed to connect to SourceBans DB. Error: %s", error);
}
gH_DB = db;
}
public void OnClientPutInServer(int client)
{
if(IsFakeClient(client))
{
return;
}
gB_MessagePrinted[client] = false;
CreateTimer(1.0, PrintMessage, GetClientSerial(client));
}
public Action PrintMessage(Handle Timer, any data)
{
int client = GetClientFromSerial(client);
char[] auth = new char[32];
if(client == 0 || !GetClientAuthId(client, AuthId_Engine, auth, 32))
{
return Plugin_Stop;
}
auth[6] = '0';
char[] auth2 = new char[32];
strcopy(auth2, 32, auth);
auth2[6] = '1';
// auth2 is being used for bans that are placed using the STEAM_0 format
// that's good for communities that run both CS:GO and other source engine game servers
char[] sQuery = new char[256];
FormatEx(sQuery, 256, "SELECT * FROM `sb_bans` WHERE (authid = '%s' OR authid = '%s') AND RemoveType IS NULL", auth, auth2);
gH_DB.Query(SelectCallback, sQuery, GetClientSerial(client), DBPrio_Low);
return Plugin_Stop;
}
public void SelectCallback(Database db, DBResultSet results, const char[] error, any data)
{
int client = GetClientFromSerial(data);
if(results == null || client == 0 || results.RowCount > 0)
{
return;
}
gB_MessagePrinted[client] = true;
char[] auth = new char[32];
GetClientAuthId(client, AuthId_Engine, auth, 32);
if(StrContains(auth, "[") != -1)
{
ReplaceString(auth, 32, "[", "");
ReplaceString(auth, 32, "]", "");
}
PrintToChatAll("%s%N\x01 [\x04%s\x01] has \x05connected\x01.", gS_NameColor, client, auth);
}
public void OnClientDisconnect(int client)
{
if(!IsFakeClient(client) && gB_MessagePrinted[client] && IsClientInGame(client) && GetClientTeam(client) >= 1)
{
char[] sAuth = new char[32];
GetClientAuthId(client, AuthId_Engine, sAuth, 32);
if(StrContains(sAuth, "[") != -1)
{
ReplaceString(sAuth, 32, "[", "");
ReplaceString(sAuth, 32, "]", "");
}
PrintToChatAll("%s%N\x01 [\x04%s\x01] has \x02disconnected\x01.", gS_NameColor, client, sAuth);
}
}
CS:GO prestrafe
Enables prestrafing in CS:GO - extracted from KZTimer so it's very dated. I don't recommend running this if your server allows players to obtain weapons other than a pistol.
Use sv_friction 4 and sv_accelerate 5 with CS:GO Movement Unlocker instead if you're fine with the ground-sliding it adds, instead of this mess.
Code written by ofir753. I've seen people ask for it before but forgot I even have it.
It enables ground-strafing. I don't know if this code even works, but I remember ofir letting me test a working version in his server once; so it can possibly work.
Code:
#include <sourcemod>
#include <sdktools>
public Plugin:myinfo =
{
name = "Enable Gstrafe at Cs GO",
author = "Ofir",
description = "",
version = "1.0",
url = ""
};
#define DUCKHEIGHT 54.0
new bool:gb_isDucking[MAXPLAYERS+1];
new bool:gb_waitForGround[MAXPLAYERS+1];
new Float:gf_Velocity[MAXPLAYERS+1][3];
public OnClientPutInServer(client)
{
gb_isDucking[client] = false;
gb_waitForGround[client] = false;
}
public Action:OnPlayerRunCmd(client, &buttons, &impulse, Float:vel[3], Float:angles[3], &weapon, &subtype, &cmdnum, &tickcount, &seed, mouse[2])
{
SetEntProp(client, Prop_Data, "m_nDuckTimeMsecs", 0);
if(GetEntityFlags(client) & FL_ONGROUND)
{
if(gb_waitForGround[client])
{
SetEntPropFloat(client, Prop_Send, "m_flStamina", 0.0);
gb_waitForGround[client] = false;
}
if(buttons & IN_DUCK)
{
gb_isDucking[client] = true;
GetEntPropVector(client, Prop_Data, "m_vecVelocity", gf_Velocity[client]);
}
}
if (!(buttons & IN_DUCK) && gb_isDucking[client])
{
gb_isDucking[client] = false;
if(!(GetEntityFlags(client) & FL_DUCKING) && CheckCeiling(client))
{
new Float:org[3];
GetClientAbsOrigin(client, org);
org[2] += DUCKHEIGHT;
TeleportEntity(client, org, NULL_VECTOR, gf_Velocity[client]);
SetEntPropFloat(client, Prop_Send, "m_flStamina", 0.0);
gb_waitForGround[client] = true;
}
}
}
bool:CheckCeiling(client)
{
new Float:vecOrigin[3], Float:vecPos[3];
new Float:vecEnd[3];
new bool:isHit = false;
for (new i = 0; i < 4; i++)
{
GetClientAbsOrigin(client, vecOrigin);
vecOrigin[2] += 70;
switch(i)
{
case 0:
{
vecOrigin[0] += 32;
}
case 1:
{
vecOrigin[1] += 32;
}
case 2:
{
vecOrigin[0] -= 32;
}
case 3:
{
vecOrigin[1] -= 32;
}
}
vecEnd = vecOrigin;
vecEnd[2] += 500.0
new Handle:trace = TR_TraceRayFilterEx(vecOrigin, vecEnd, MASK_PLAYERSOLID, RayType_EndPoint, WorldFilter);
if(TR_DidHit(trace))
{
TR_GetEndPosition(vecPos, trace);
if(vecPos[2] - vecOrigin[2] <= DUCKHEIGHT)
{
isHit = true;
}
}
CloseHandle(trace);
}
return !isHit;
}
public bool:WorldFilter(entity, mask)
{
// world has entity id 0: if nonzero, tis thing
if(entity)
return false;
return true;
}
I really don't think I have anything else to post, have fun.