Peoples Army
08-10-2007, 03:34
i cant seem to catch the grenade damage . am i using the event right ??
/*
Napalm Grenades
Ignites Players Injured By Greandes
*/
#include <sourcemod>
#include <sdktools_functions>
#define VERSION "0.1"
new Handle:Switch;
new String:Weapon[30];
public Plugin:myinfo =
{
name = "Napalm grenades",
author = "Peoples Army",
description = "Ignites Players On Fire From Nades",
version = VERSION,
url = "www.sourcemod.net (http://www.sourcemod.net)"
};
// create convars and hook event
public OnPluginStart()
{
Switch = CreateConVar("napalm_nades_on","1","Turns the plugin on and off 1/0",FCVAR_NOTIFY);
HookEvent("player_hurt",DamageEvent);
}
//hook the player_hurt event and look for nade damge
public DamageEvent(Handle:event,const String:name[],bool:dontBroadcast)
{
GetEventString(event,"weapon",Weapon,29);
new DmgDone = GetEventInt(event,"dmg_health");
new clientid = GetEventInt(event,"userid");
new client = GetClientOfUserId(clientid);
// if plugin is on and nade was found then ignite client
if(StrEqual(Weapon,"weapon_hegrenade")== true)
{
PrintToChat(client,"Youve Been Hit By A Nade");
switch(DmgDone)
{
case 0.30:IgniteEntity(client,3.0);
case 31.50:IgniteEntity(client,6.0);
case 51.70:IgniteEntity(client,9.0);
case 71.100:IgniteEntity(client,12.0);
}
}
}
/*
Napalm Grenades
Ignites Players Injured By Greandes
*/
#include <sourcemod>
#include <sdktools_functions>
#define VERSION "0.1"
new Handle:Switch;
new String:Weapon[30];
public Plugin:myinfo =
{
name = "Napalm grenades",
author = "Peoples Army",
description = "Ignites Players On Fire From Nades",
version = VERSION,
url = "www.sourcemod.net (http://www.sourcemod.net)"
};
// create convars and hook event
public OnPluginStart()
{
Switch = CreateConVar("napalm_nades_on","1","Turns the plugin on and off 1/0",FCVAR_NOTIFY);
HookEvent("player_hurt",DamageEvent);
}
//hook the player_hurt event and look for nade damge
public DamageEvent(Handle:event,const String:name[],bool:dontBroadcast)
{
GetEventString(event,"weapon",Weapon,29);
new DmgDone = GetEventInt(event,"dmg_health");
new clientid = GetEventInt(event,"userid");
new client = GetClientOfUserId(clientid);
// if plugin is on and nade was found then ignite client
if(StrEqual(Weapon,"weapon_hegrenade")== true)
{
PrintToChat(client,"Youve Been Hit By A Nade");
switch(DmgDone)
{
case 0.30:IgniteEntity(client,3.0);
case 31.50:IgniteEntity(client,6.0);
case 51.70:IgniteEntity(client,9.0);
case 71.100:IgniteEntity(client,12.0);
}
}
}