Hi guys,
Below is an extract of the Grenade Smoke Colour plugin (
https://forums.alliedmods.net/showthread.php?p=1613820) Thanks to HSFighter - awesome plugin
What I want to know is how would i need to adapt this so that i DONT need to use a CVAR?
Im assuming that I would remove the CVAR and add a new DispatchKeyValue... but I don't know much about CVARs - so how can I change this please?
Cheers
Code:
public OnPluginStart()
{
g_hCVColor = CreateConVar("sm_grenadesmokecolor_color", "0 255 0", FCVAR_PLUGIN);
}
new iEntity = CreateEntityByName("light_dynamic");
if (iEntity != -1)
{
new iRef = EntIndexToEntRef(iEntity);
decl String:sBuffer[64];
GetConVarString(g_hCVColor, sBuffer, sizeof(sBuffer));
DispatchKeyValue(iEntity, "_light", sBuffer);
Format(sBuffer, sizeof(sBuffer), "smokelight_%d", iEntity);
DispatchKeyValue(iEntity,"targetname", sBuffer);
Format(sBuffer, sizeof(sBuffer), "%f %f %f", a[0], a[1], a[2]);
DispatchKeyValue(iEntity, "origin", sBuffer);
DispatchKeyValue(iEntity, "iEntity", "-90 0 0");
DispatchKeyValue(iEntity, "pitch","-90");
DispatchKeyValue(iEntity, "distance","256");
DispatchKeyValue(iEntity, "spotlight_radius","96");
DispatchKeyValue(iEntity, "brightness","3");
DispatchKeyValue(iEntity, "style","6");
DispatchKeyValue(iEntity, "spawnflags","1");
DispatchSpawn(iEntity);
AcceptEntityInput(iEntity, "DisableShadow");
AcceptEntityInput(iEntity, "TurnOn");
CreateTimer(20.0, Delete, iRef, TIMER_FLAG_NO_MAPCHANGE);