The beacons work totally fine, but the env_beam crashes when they are activated.
Code:
public plugin_precache() {
precache_model ( BEACONMODEL );
tape = precache_model("sprites/rope.spr");
}
public activateBeacons(id) {
switch(beaconcount[id]) {
case 2: {
tape1[id] = create_entity("env_beam");
entity_set_string(tape1[id],EV_SZ_classname,"beacon");
DispatchKeyValue (tape1[id], "LightningStart", beacon1[id]);
DispatchKeyValue (tape1[id], "LightningEnd", beacon2[id]);
DispatchKeyValue (tape1[id], "texture", tape);
DispatchKeyValue (tape1[id], "rendercolor" , "0 0 255");
//DispatchKeyValue (tape1[id], renderamt , "0 0 255");
DispatchKeyValue (tape1[id], "life" , "0");
DispatchSpawn ( tape1[id] );
}
case 3: {
tape2[id] = create_entity("env_beam");
entity_set_string(tape2[id],EV_SZ_classname,"beacon");
DispatchKeyValue (tape2[id], "LightningStart", beacon2[id]);
DispatchKeyValue (tape2[id], "LightningEnd", beacon3[id]);
DispatchKeyValue (tape2[id], "texture", tape);
DispatchKeyValue (tape2[id], "rendercolor" , "0 0 255");
//DispatchKeyValue (tape2[id], renderamt , "0 0 255");
DispatchKeyValue (tape2[id], "life" , "0");
DispatchSpawn ( tape2[id] );
}
//Two here because the last beacon and first beacon can link
case 4: {
tape3[id] = create_entity("env_beam");
entity_set_string(tape3[id],EV_SZ_classname,"beacon");
DispatchKeyValue (tape3[id], "LightningStart", beacon3[id]);
DispatchKeyValue (tape3[id], "LightningEnd", beacon4[id]);
DispatchKeyValue (tape3[id], "texture", tape);
DispatchKeyValue (tape3[id], "rendercolor" , "0 0 255");
//DispatchKeyValue (tape3[id], renderamt , "0 0 255");
DispatchKeyValue (tape3[id], "life" , "0");
DispatchSpawn ( tape3[id] );
tape4[id] = create_entity("env_beam");
entity_set_string(tape4[id],EV_SZ_classname,"beacon");
DispatchKeyValue (tape4[id], "LightningStart", beacon4[id]);
DispatchKeyValue (tape4[id], "LightningEnd", beacon1[id]);
DispatchKeyValue (tape4[id], "texture", tape);
DispatchKeyValue (tape4[id], "rendercolor" , "0 0 255");
//DispatchKeyValue (tape4[id], renderamt , "0 0 255");
DispatchKeyValue (tape4[id], "life" , "0");
DispatchSpawn ( tape4[id] );
}
}
return PLUGIN_HANDLED;
}