PDA

View Full Version : TE_SetupBloodSprite()


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.

Peoples Army
08-22-2007, 10:12
hard to tell . i would add a client print message right after your conditions and right when u try to make the blood on the player . just to see if your function is fireing at all , if it prints than it must be soemthing else .

dalto
08-22-2007, 10:15
hard to tell . i would add a client print message right after your conditions and right when u try to make the blood on the player . just to see if your function is fireing at all , if it prints than it must be soemthing else .

I have, I have checked the values of every parameter. I have checked to ensure that the everything is populated correctly. I even validated the setup of the tempent stock against valve's own code.

Peoples Army
08-22-2007, 10:23
omg , i cant belevie i missed this at first , you ahve to send messages in source .




TE_SendToAll();

dalto
08-22-2007, 11:09
omg , i cant belevie i missed this at first , you ahve to send messages in source .




TE_SendToAll();




*sigh*

I have been working on this for well over a week and I never noticed that I wasn't sending the tempent.

*sigh*

Peoples Army
08-22-2007, 11:34
lol ! dont worry about dalto , it happens to the best of us . you look at the code for more then a few hours and things start to slip past you . :wink: