Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <tf2_stocks>
- #include <tf2>
- #include <sourcemod>
- #define CRAB_BELL "misc/jingle_bells/jingle_bells_nm_01.wav"
- public Plugin:myinfo =
- {
- name = "Spycrab",
- description = "Server Spycrab Tools",
- author = "The Doctor!",
- version = "1.2",
- url = "http://dcommunity.tk"
- }
- public OnPluginStart()
- {
- RegAdminCmd("sm_mcon", eventon, ADMFLAG_GENERIC, "Masscrab On");
- RegAdminCmd("sm_mcoff", eventoff, ADMFLAG_GENERIC, "Masscrab Off");
- RegAdminCmd("sm_playsound", playsound, ADMFLAG_GENERIC, "Emit Crab Bell");
- PrecacheSound(CRAB_BELL);
- }
- public OnClientPutInServer(client)
- {
- CreateTimer(0.5, HUD, client, TIMER_REPEAT);
- }
- public Action:HUD(Handle:timer, any:client)
- {
- if(IsClientConnected(client) && IsClientInGame(client))
- {
- SetHudTextParams(-1.12, 0.1, 0.5, 255,0,0,255, 0, 6.0, 0.1, 0.2);
- ShowHudText(client, -1, "Masscrab mode on!");
- }
- }
- public Action:playsound(client, args)
- {
- EmitSoundToAll("CRAB_BELL", client);
- PrintToChat(client, "Crab bell has been emitted to all players!");
- }
- public Action:eventoff(client, args)
- {
- new Handle:plugin = GetMyHandle(), String:namePlugin[256];
- GetPluginFilename(plugin, namePlugin, sizeof(namePlugin));
- ServerCommand("sm plugins unload %s", namePlugin);
- PrintToChat(client, "Masscrab mode disabled!");
- return Plugin_Handled;
- }
- public Action:eventon(client, args)
- {
- new Handle:plugin = GetMyHandle(), String:namePlugin[256];
- GetPluginFilename(plugin, namePlugin, sizeof(namePlugin));
- ServerCommand("sm plugins load %s", namePlugin);
- PrintToChat(client, "Masscrab mode enabled!");
- return Plugin_Handled;
- }
- public TF2_OnConditionAdded(client, TFCond:condition)
- {
- if(TF2_GetPlayerClass(client) == TFClass_Spy && condition == TFCond_Taunting)
- {
- CreateTimer(3.1, Tauntcheck, client);
- }
- }
- public Action:Tauntcheck(Handle:timer, any:client)
- {
- if(TF2_GetPlayerClass(client) == TFClass_Spy)
- {
- if(!TF2_IsPlayerInCondition(client, TFCond_Taunting))
- {
- PrintToChat(client, "Spycrab!")
- TF2_RespawnPlayer(client);
- }
- else
- {
- PrintToChat(client, "");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement