Code Snippets SourcePawn

Short texts SourcePawn 🧑‍💻 Code snippets SourcePawn ✍️ Reading lists SourcePawn 👀

cow_spawner.sp

/** * if you’re bored you can simply close your eyes and rotate a cow in your mind. * it’s free and the cops can’t stop you */ #pragma semicolon 1 #include #pragma newdecls required #include #define MODEL_PATH_COW “models/props_2fort/cow001_reference.mdl” // find as close a match to the collision box to the cow as we can […]

Conversion of large numbers to strings

#include #pragma semicolon 1 #pragma newdecls required public void OnPluginStart() { char buffer[64]; int divisor = 12345; int base = 0x10; int i; while (divisor) { PrintToServer(“%d / %d”, divisor, base); int rem; SmallDivision(divisor, base, divisor, rem); buffer[i++] = (rem > 9)? (rem-10) + ‘a’ : rem + ‘0’; buffer[i] = ‘\0’; } StrReverse(buffer); PrintToServer(“%s”, […]

aim_copy.sp

/** * Sourcemod 1.7 Plugin Template */ #pragma semicolon 1 #include #include #pragma newdecls required public void OnPluginStart() { RegAdminCmd(“sm_aim_mimic”, MimicAim, ADMFLAG_ROOT); // RegAdminCmd(“sm_aim_share”, ShareAim, ADMFLAG_ROOT); // TODO make targets look at same point RegAdminCmd(“sm_tele1”, TeleportExact, ADMFLAG_ROOT); RegAdminCmd(“sm_telefp”, TeleportExact, ADMFLAG_ROOT); LoadTranslations(“common.phrases”); } public Action MimicAim(int client, int argc) { char targetString[64]; GetCmdArg(1, targetString, sizeof(targetString)); int […]

tf_jungle_inferno_weapons.sp

/** * [TF2] Jungle Inferno Equipment */ #pragma semicolon 1 #include #include #include #include #pragma newdecls required #define PLUGIN_VERSION “1.0.2” public Plugin myinfo = { name = “[TF2] Jungle Inferno Equipment”, author = “nosoop”, description = “Allows players to equip new weapons for Pyro and Heavy. ” … “Because Valve is giving normal community servers […]

test external knife

#include #include int g_Ref; Handle g_hGetAttachment; public void OnPluginStart() { StartPrepSDKCall(SDKCall_Entity); // windows sig PrepSDKCall_SetSignature(SDKLibrary_Server, “\x55\x8B\xEC\x83\xE4\xF8\x83\xEC\x30\x8B\x01”, 11); //PrepSDKCall_SetFromConf(hGameConf, SDKConf_Signature, “CBaseAnimating::GetAttachment”); PrepSDKCall_AddParameter(SDKType_String, SDKPass_Pointer); PrepSDKCall_AddParameter(SDKType_Vector, SDKPass_ByRef, _, VENCODE_FLAG_COPYBACK); PrepSDKCall_AddParameter(SDKType_QAngle, SDKPass_ByRef, _, VENCODE_FLAG_COPYBACK); g_hGetAttachment = EndPrepSDKCall(); RegConsoleCmd(“sm_t”, Command_T); } public void OnPluginEnd() { int e = EntRefToEntIndex(g_Ref); if (e > MaxClients) RemoveEntity(e); g_Ref = INVALID_ENT_REFERENCE; } public Action […]