I saw u were looking for smthing like this in another thread.
I didnt create this code, its just something that i use on my combat surf server..
You can change the weapon_name in the code to a different sniper names to get the same effect. (weapon_ssg08 etc)
This is a One Shot Kill for the awp. You can change the dmg in the code also "damage *= 2.0;".
Code:
//Pragma
#pragma semicolon 1
#pragma newdecls required
//Sourcemod Includes
#include <sourcemod>
#include <sdktools>
#include <sdkhooks>
public void OnPluginStart()
{
for (int i = 1; i <= MaxClients; i++)
{
if (IsClientInGame(i))
{
OnClientPutInServer(i);
}
}
}
public void OnClientPutInServer(int client)
{
SDKHook(client, SDKHook_OnTakeDamage, OnTakeDamage);
}
public Action OnTakeDamage(int victim, int &attacker, int &inflictor, float &damage, int &damagetype)
{
if (attacker == 0 || attacker > MaxClients)
{
return Plugin_Continue;
}
int active = GetEntPropEnt(attacker, Prop_Send, "m_hActiveWeapon");
if (!IsValidEntity(active))
{
return Plugin_Continue;
}
char sClassname1[32];
GetEntityClassname(active, sClassname1, sizeof(sClassname1));
if (StrContains(sClassname1, "weapon_awp") != -1)
{
damage *= 2.0;
return Plugin_Changed;
}
return Plugin_Continue;
}
For changing the server to awp only, you can do that in the gamemodes_*.cfg that u are using or by using custom map configs. (
Map Configs ).
Map configs are good for a lot of things. At one stage I setup a server for fun to test this.
You can run different Timer plugins per map or per map type by using load and unload in the configs, you can do this with 100's of plugins per map or use the above awp plugin on only certain maps and not others. You can make a Minigames/Deathrun/Kz/Bhop/Surf/Combat surf server all in one if u wanted.. Its rather fun to play around with.
This is what you need to change in the gamemodes_casual.cfg / gamemode_competitive / gamemode_deathmatch etc. This can be somewhat buggy with maps that auto spawn it's own start weapons. (maybe someone else has a plugin for this)
Code:
mp_ct_default_melee weapon_knife
mp_ct_default_secondary weapon_usp_silencer
mp_ct_default_primary ""
mp_t_default_melee weapon_knife
mp_t_default_secondary weapon_glock
mp_t_default_primary ""
Yours would look like this:
Code:
mp_ct_default_melee weapon_knife
mp_ct_default_secondary ""
mp_ct_default_primary weapon_awp
mp_t_default_melee weapon_knife
mp_t_default_secondary ""
mp_t_default_primary weapon_awp
__________________