RSSy MYGO.pl Opublikowano Sierpień 4, 2020 o 18:30 RSSy Udostępnij Opublikowano Sierpień 4, 2020 o 18:30 Description This plugins customize the default dropping mechanics. Instead of dropping the gun from your hand and on the ground; it instantly deletes it. It also makes all guns cost 0$, so the client can buy as many guns as they want during warmup. Video preview https://youtu.be/jfRraJDELxY Installation Download the CustomWeaponDrop.smx file Put it in your plugins folder (/addons/sourcemod/plugins/) Either change map or run "sm_rcon sm plugins refresh" in your console (to load the plugin) The plugin is now loaded and working Modifications (optional) Spoiler As written in the description, this only applies on the warmup. - If you want to this drop mechanic to apply to all rounds, then remove the if-statement that checks if the round is a warmup inside the CS_OnCSWeaponDrop function: PHP Code: if(GameRules_GetProp("m_bWarmupPeriod")) { } - It's the same if you want guns to cost 0$, just remove the if-statement that checks if the round is a warmup, but this time, in the CS_OnGetWeaponPrice. Code Spoiler PHP Code: #include <sourcemod> #include <cstrike> #include <sdktools> #include <sdkhooks> #pragma tabsize 0 #pragma semicolon 1 #pragma newdecls required int g_iLastDroppedItem[MAXPLAYERS + 1]; public Plugin myinfo = { name = "CustomWeaponDrop", author = "Trum (Impact's drop mechanic idea)", description = "Preventing people from spam-dropping guns on the ground.", version = "1.0", url = "", } public void OnPluginStart() { AddCommandListener(OnDrop, "drop"); HookEvent("player_spawn", OnSpawn); } public Action OnSpawn(Event event, const char[] name, bool dontBroadcast) { int client = GetClientOfUserId(event.GetInt("userid")); if(client) g_iLastDroppedItem[client] = 0; } public Action OnDrop(int client, const char[] command, int argc) { g_iLastDroppedItem[client] = GetEntPropEnt(client, Prop_Send, "m_hActiveWeapon"); } public Action CS_OnCSWeaponDrop(int client, int weapon) { if(GameRules_GetProp("m_bWarmupPeriod")) { if(IsValidEdict(weapon)) AcceptEntityInput(weapon, "Kill"); if(weapon == g_iLastDroppedItem[client]) RemoveEntity(weapon); } } public Action CS_OnGetWeaponPrice(int client, const char[] weapon, int &price) { if (GameRules_GetProp("m_bWarmupPeriod") == 1) { price = 0; return Plugin_Changed; } return Plugin_Continue; } Changelog Code: 1.0 - 2020.08.04 First release Credits Impact - for the drop mechanic Attached Files Get Plugin or Get Source (CustomWeaponDrop.sp - 1.3 KB) Wyświetl pełny artykuł Odnośnik do komentarza Udostępnij na innych stronach Więcej opcji udostępniania...
Rekomendowane odpowiedzi