From 20b970881ac066db5cdd9563fd8e2d52c6211393 Mon Sep 17 00:00:00 2001 From: richard Date: Tue, 7 Apr 2009 16:52:34 +0200 Subject: [PATCH] New branch. Removed plugins that doesn't belong here. --- src/zr_ammo.sp | 62 --------------------------------------------- src/zr_hitsounds.sp | 59 ------------------------------------------ src/zr_info.sp | 52 ------------------------------------- 3 files changed, 173 deletions(-) delete mode 100644 src/zr_ammo.sp delete mode 100644 src/zr_hitsounds.sp delete mode 100644 src/zr_info.sp diff --git a/src/zr_ammo.sp b/src/zr_ammo.sp deleted file mode 100644 index b42c6d7..0000000 --- a/src/zr_ammo.sp +++ /dev/null @@ -1,62 +0,0 @@ - -#include - -/* -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); -} - diff --git a/src/zr_hitsounds.sp b/src/zr_hitsounds.sp deleted file mode 100644 index 88b4c7b..0000000 --- a/src/zr_hitsounds.sp +++ /dev/null @@ -1,59 +0,0 @@ - -#include -#include - -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); -} - diff --git a/src/zr_info.sp b/src/zr_info.sp deleted file mode 100644 index 144b6f6..0000000 --- a/src/zr_info.sp +++ /dev/null @@ -1,52 +0,0 @@ - -#include - -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; -} -