Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <sourcemod>
- #include <sdktools>
- #include <cstrike>
- #include <csgo_colors>
- #include <morecolors>
- #include <sdkhooks>
- #include <smlib>
- #pragma semicolon 1
- #pragma newdecls required
- #define PLUGIN_NAME "Auto-Pistol"
- #define PLUGIN_DESCRIPTION "Auto-Pistol for Spawn"
- #define PLUGIN_VERSION "1.0"
- #define PLUGIN_AUTHOR "wwww333"
- #define PLUGIN_URL "https://alliedmodders.com"
- public Plugin myinfo =
- {
- name = PLUGIN_NAME,
- author = PLUGIN_AUTHOR,
- description = PLUGIN_DESCRIPTION,
- version = PLUGIN_VERSION,
- url = PLUGIN_URL
- };
- ConVar g_cEnabled;
- public void OnPluginStart()
- {
- RegAdminCmd("sm_ap", Command_AutoPistol, ADMFLAG_ROOT, "This Activates Auto-Pistol Plugin");
- g_cEnabled = CreateConVar("sm_autopistol", "0", "Enables/Disables Pistol Plugin");
- HookEvent("player_spawn", Event_PlayerSpawn);
- }
- public Action Command_AutoPistol(int client, int args)
- {
- if(!g_cEnabled.BoolValue)
- {
- g_cEnabled.SetBool(true);
- PrintToChatAll("Auto-Pistol enabled");
- }
- else
- {
- g_cEnabled.SetBool(false);
- PrintToChatAll("Auto-Pistol disabled");
- }
- return Plugin_Handled;
- }
- public Action Event_PlayerSpawn(Event event, const char[] name, bool dontBroadcast)
- {
- int client = GetClientOfUserId(event.GetInt("userid"));
- if(g_cEnabled.BoolValue)
- {
- GiveUsp(client);
- }
- }
- public void GiveUsp(int client)
- {
- GivePlayerItem(client, "weapon_usp");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement