dalto
08-22-2007, 10:04
I cannot get TE_SetupBloodSprite() to work. I know I must be doing something stupid here. I wrote a simple program to demonstrate me not making it work.
Any help anyone could offer would be most appreciated.
#include <sourcemod>
#include <sdktools>
#pragma semicolon 1
#define PLUGIN_VERSION "1.0"
// Plugin definitions
public Plugin:myinfo =
{
name = "Blood Test",
author = "AMP",
description = "It is just test code",
version = PLUGIN_VERSION,
url = "http://forums.alliedmods.net"
};
// Global Variables
new g_bloodModel;
new g_sprayModel;
public OnPluginStart()
{
HookEvent("player_spawn", EventPlayerSpawn, EventHookMode_Post);
}
public EventPlayerSpawn(Handle:event, const String:name[], bool:dontBroadcast)
{
new client = GetClientOfUserId(GetEventInt(event, "userid"));
CreateTimer(2.0, TimerCreateDrops, client, TIMER_REPEAT);
}
public Action:TimerCreateDrops(Handle:timer, any:client)
{
new Float:vec[3];
new Float:upVec[3];
new Float:rightVec[3];
static const color[] = {255,15,15,255};
if(IsClientInGame(client) && IsPlayerAlive(client) && GetClientHealth(client) < 100)
{
GetClientAbsOrigin(client, vec);
vec[0] -= 30;
vec[1] -= 30;
GetVectorVectors(vec, rightVec, upVec);
TE_SetupBloodSprite(vec, rightVec, color, 25, g_sprayModel, g_bloodModel);
}
}
public OnMapStart()
{
g_bloodModel = PrecacheModel("sprites/blood.vmt", true);
g_sprayModel = PrecacheModel("sprites/bloodspray.vmt", true);
}
NOTE: I realize the timers will stack, this is just for the purpose of demonstrating the problem I am having.
Any help anyone could offer would be most appreciated.
#include <sourcemod>
#include <sdktools>
#pragma semicolon 1
#define PLUGIN_VERSION "1.0"
// Plugin definitions
public Plugin:myinfo =
{
name = "Blood Test",
author = "AMP",
description = "It is just test code",
version = PLUGIN_VERSION,
url = "http://forums.alliedmods.net"
};
// Global Variables
new g_bloodModel;
new g_sprayModel;
public OnPluginStart()
{
HookEvent("player_spawn", EventPlayerSpawn, EventHookMode_Post);
}
public EventPlayerSpawn(Handle:event, const String:name[], bool:dontBroadcast)
{
new client = GetClientOfUserId(GetEventInt(event, "userid"));
CreateTimer(2.0, TimerCreateDrops, client, TIMER_REPEAT);
}
public Action:TimerCreateDrops(Handle:timer, any:client)
{
new Float:vec[3];
new Float:upVec[3];
new Float:rightVec[3];
static const color[] = {255,15,15,255};
if(IsClientInGame(client) && IsPlayerAlive(client) && GetClientHealth(client) < 100)
{
GetClientAbsOrigin(client, vec);
vec[0] -= 30;
vec[1] -= 30;
GetVectorVectors(vec, rightVec, upVec);
TE_SetupBloodSprite(vec, rightVec, color, 25, g_sprayModel, g_bloodModel);
}
}
public OnMapStart()
{
g_bloodModel = PrecacheModel("sprites/blood.vmt", true);
g_sprayModel = PrecacheModel("sprites/bloodspray.vmt", true);
}
NOTE: I realize the timers will stack, this is just for the purpose of demonstrating the problem I am having.