someone help me please i'm having several errors in scripting, I'm trying to create a rainbow dynamic light, but it has a lot of bugs and I can't fix them, I'm having a crash in the game and the dynamic light doesn't show.
Errors
(66) : error 017: undefined symbol "color"
(66) : error 001: expected token: ";", but found "]"
(66) : error 029: invalid expression, assumed zero
(66) : fatal error 190: too many error messages on one line
int MakeLightDynamic(const float vOrigin[3], const float vAngles[3], int client)
{
int Ent = CreateEntityByName("light_dynamic");
if( Ent == -1)
{
LogError("Failed to create 'light_dynamic'");
return 0;
}
Well, try like this.
But you should go for a timer instead of prethink in the final version.
Also the color may be per client and not global (e.g. iColor[MAXPLAYERS+1][3])
Btw the color from prethink doesn't have the alpha (4th parameter in the light parameter), I fixed it at 255
int MakeLightDynamic(const float vOrigin[3], const float vAngles[3], int client) { int Ent = CreateEntityByName("light_dynamic"); if( Ent == -1) { LogError("Failed to create 'light_dynamic'"); return 0; }
Well, try like this.
But you should go for a timer instead of prethink in the final version.
Also the color may be per client and not global (e.g. iColor[MAXPLAYERS+1][3])
Btw the color from prethink doesn't have the alpha (4th parameter in the light parameter), I fixed it at 255
int MakeLightDynamic(const float vOrigin[3], const float vAngles[3], int client)
{
int Ent = CreateEntityByName("light_dynamic");
if( Ent == -1)
{
LogError("Failed to create 'light_dynamic'");
return 0;
}