I suppose I'm missing something obvious, but the entity doesn't spawn. Any help would be
All I'm trying to do below is spawn an entity and teleport it to the client who called it. The location is correct so I'm assuming my error has to do with the entity itself spawning. Or my return?
PHP Code:
#include <sourcemod>
#include <sdktools>
int g_iEntityIndex;
public void OnPluginStart()
{
RegConsoleCmd("sm_cfire", Command_CreateFire, "sm_cfire - Creates fire @ player orig");
}
public Action Command_CreateFire(int iClient, int Args)
{
float f_vCoords[3];
GetClientAbsOrigin(iClient, f_vCoords);
PrintToChatAll("Origin Stored: %f, %f, %f", f_vCoords[0], f_vCoords[1], f_vCoords[2]);
g_iEntityIndex = CreateEntityByName("env_fire");
DispatchKeyValue(g_iEntityIndex, "firesize", "72");
DispatchKeyValue(g_iEntityIndex, "duration", "15");
DispatchKeyValue(g_iEntityIndex, "damagescale", "0.0"); //Might not work as intended
DispatchKeyValue(g_iEntityIndex, "LightRadiusScale", "1.5");
DispatchSpawn(g_iEntityIndex);
TeleportEntity(g_iEntityIndex, f_vCoords, NULL_VECTOR, NULL_VECTOR);
PrintToChatAll("%i Has Spawned @ %f, %f, %f", g_iEntityIndex, f_vCoords[0], f_vCoords[1], f_vCoords[2]);
return Plugin_Handled;
}