New branch. Removed plugins that doesn't belong here.

This commit is contained in:
richard 2009-04-07 16:52:34 +02:00
parent 405e7f0005
commit 20b970881a
3 changed files with 0 additions and 173 deletions

View File

@ -1,62 +0,0 @@
#include <sourcemod>
/*
thx to Infinite Ammo by twistedeuphoria - http://forums.alliedmods.net/showthread.php?t=55381
*/
public Plugin:myinfo = {
name = "Ammo Script for Zombie:Reloaded",
author = "[SG-10]Cpt.Moore",
description = "",
version = "1.0",
url = "http://jupiter.swissquake.ch/zombie/page"
};
new activeOffset = -1;
new clip1Offset = -1;
new clip2Offset = -1;
new secAmmoTypeOffset = -1;
new priAmmoTypeOffset = -1;
// native hooks
public OnPluginStart()
{
HookEvent("weapon_fire", Event_WeaponFire);
activeOffset = FindSendPropOffs("CAI_BaseNPC", "m_hActiveWeapon");
clip1Offset = FindSendPropOffs("CBaseCombatWeapon", "m_iClip1");
clip2Offset = FindSendPropOffs("CBaseCombatWeapon", "m_iClip2");
priAmmoTypeOffset = FindSendPropOffs("CBaseCombatWeapon", "m_iPrimaryAmmoCount");
secAmmoTypeOffset = FindSendPropOffs("CBaseCombatWeapon", "m_iSecondaryAmmoCount");
}
// event hooks
public Event_WeaponFire(Handle:event, const String:name[], bool:dontBroadcast)
{
new userid = GetEventInt(event, "userid");
new client = GetClientOfUserId(userid);
if(!IsFakeClient(client))
{
Client_ResetAmmo(client);
}
}
// helpers
public Client_ResetAmmo(client)
{
new zomg = GetEntDataEnt(client, activeOffset);
if (clip1Offset != -1)
SetEntData(zomg, clip1Offset, 104, 4, true);
if (clip2Offset != -1)
SetEntData(zomg, clip2Offset, 104, 4, true);
if (priAmmoTypeOffset != -1)
SetEntData(zomg, priAmmoTypeOffset, 200, 4, true);
if (secAmmoTypeOffset != -1)
SetEntData(zomg, secAmmoTypeOffset, 200, 4, true);
}

View File

@ -1,59 +0,0 @@
#include <sourcemod>
#include <sdktools>
public Plugin:myinfo = {
name = "Hit Sounds for Zombie:Reloaded",
author = "[SG-10]Cpt.Moore",
description = "",
version = "1.0",
url = "http://zombie.swissquake.ch/"
};
static const String:hit_head[] = {"hit_head.wav"};
static const String:hit_body[] = {"hit_body.wav"};
// native hooks
public OnPluginStart()
{
HookEvent("player_hurt", Event_PlayerHurt);
LoadSound(hit_head);
LoadSound(hit_body);
}
public OnMapStart()
{
LoadSound(hit_head);
LoadSound(hit_body);
}
public Event_PlayerHurt(Handle:event, const String:name[], bool:dontBroadcast)
{
new attackerId = GetEventInt(event, "attacker");
new attacker = GetClientOfUserId(attackerId);
//new damage = GetEventInt(event, "dmg_health");
new hitgroup = GetEventInt(event,"hitgroup");
if( attacker > 0 && !IsFakeClient(attacker) )
{
if ( hitgroup == 1 )
{
EmitSoundToClient(attacker, hit_head);
}
else
{
EmitSoundToClient(attacker, hit_body);
}
}
}
// utility functions
public LoadSound(const String:sound_file[])
{
new String:sound_path[PLATFORM_MAX_PATH];
Format(sound_path, sizeof(sound_path), "sound/%s", sound_file);
PrecacheSound(sound_file, true);
AddFileToDownloadsTable(sound_path);
}

View File

@ -1,52 +0,0 @@
#include <sourcemod>
public Plugin:myinfo = {
name = "Info Script for Zombie:Reloaded",
author = "[SG-10]Cpt.Moore",
description = "",
version = "1.0",
url = "http://zombie.swissquake.ch/"
};
public OnPluginStart()
{
RegConsoleCmd("sm_show_cvar", Command_Show_CVar);
}
new String:g_sCVar[128];
new String:g_sCVarValue[128];
new Handle:g_hCVar;
public Action:Command_Show_CVar(client,args)
{
GetCmdArgString(g_sCVar,sizeof(g_sCVar));
g_hCVar = FindConVar(g_sCVar);
if (g_hCVar != INVALID_HANDLE)
{ //not found
GetConVarString(g_hCVar, g_sCVarValue, sizeof(g_sCVarValue));
if (client == 0)
{
PrintToServer("\"%s\" = \"%s\"", g_sCVar, g_sCVarValue);
}
else
{
PrintToConsole(client, "\"%s\" = \"%s\"", g_sCVar, g_sCVarValue);
}
}
else
{ //found
if (client == 0)
{
PrintToServer("Couldn't find %s", g_sCVar);
}
else
{
PrintToConsole(client,"Couldn't find %s", g_sCVar);
}
}
return Plugin_Handled;
}