i have a problem with my vending/cola machines. i modded the script from this website so the vending machines would work without needing to turn the power switch on first. this is what it looks like:
Quote:
master_electric_switch()
{
trig = getent("use_master_switch","targetname");
master_switch = getent("master_switch","targetname");
master_switch notsolid();
master_switch rotatepitch(90,1);
trig sethintstring(&"ZOMBIE_ELECTRIC_SWITCH");
//turn off the buyable door triggers downstairs
//door_trigs = getentarray("electric_door","script_noteworthy");
//door_trigs[0] sethintstring(&"ZOMBIE_FLAMES_UNAVAILABLE");
//door_trigs[0] UseTriggerRequireLookAt();
//array_thread(door_trigs,::set_door_unusable);
//array_thread(door_trigs,::play_door_dialog);
//fx_org = spawn("script_model", (-674.922, -300.473, 284.125));
//fx_org setmodel("tag_origin");
//fx_org.angles = (0, 90, 0);
//playfxontag(level._effect["electric_power_gen_idle"], fx_org, "tag_origin");
cheat = false;
if ( cheat != true )
{
trig waittill("trigger",user);
}
//array_thread(door_trigs,::trigger_off);
master_switch rotateroll(-90,.3);
master_switch playsound("switch_flip");
clientnotify("revive_on");
clientnotify("middle_door_open");
clientnotify("fast_reload_on");
clientnotify("doubletap_on");
clientnotify("jugger_on");
level notify("switch_flipped");
//maps\_audio::disable_bump_trigger("switch_door_trig");
//level thread play_the_numbers();
// left_org = getent("audio_swtch_left", "targetname");
// right_org = getent("audio_swtch_right", "targetname");
// left_org_b = getent("audio_swtch_b_left", "targetname");
// right_org_b = getent("audio_swtch_b_right", "targetname");
//
// if( isdefined (left_org))
// {
// left_org playsound("amb_sparks_l");
// }
// if( isdefined (left_org_b))
// {
// left_org playsound("amb_sparks_l_b");
// }
// if( isdefined (right_org))
// {
// right_org playsound("amb_sparks_r");
// }
// if( isdefined (right_org_b))
// {
// right_org playsound("amb_sparks_r_b");
// }
// TUEY - Sets the "ON" state for all electrical systems via client scripts
//SetClientSysState("levelNotify","start_lights");
//level thread play_pa_system();
flag_set("electric_switch_used");
// trig delete();
//enable the electric traps
// traps = getentarray("gas_access","targetname");
// for(i=0;i
// {
// traps sethintstring(&"ZOMBIE_BUTTON_NORTH_FLAMES");
// traps.is_available = true;
// }
master_switch waittill("rotatedone");
//playfx(level._effect["switch_sparks"] ,getstruct("switch_fx","targetname").origin);
// activate perks-a-cola
//level notify( "master_switch_activated" );
// fx_org delete();
// fx_org = spawn("script_model", (-675.021, -300.906, 283.724));
// fx_org setmodel("tag_origin");
// fx_org.angles = (0, 90, 0);
// playfxontag(level._effect["electric_power_gen_on"], fx_org, "tag_origin");
// fx_org playloopsound("elec_current_loop");
//elec room fx on
//playfx(level._effect["elec_room_on"], (-440, -208, 8));
//turn on green lights above the zapper trap doors
//north_zapper_light_green();
//south_zapper_light_green();
wait(6);
// fx_org stoploopsound();
level notify ("sleight_on");
level notify("revive_on");
// level notify ("electric_on_middle_door");
level notify ("doubletap_on");
level notify ("juggernog_on");
//level waittill("electric_on_middle_door");
//doors = getentarray(door_trigs[0].target,"targetname");
//open_bottom_doors(doors);
//exploder(101);
//exploder(201);
//This wait is to time out the SFX properly
//wait(8);
//playsoundatposition ("amb_sparks_l_end", left_org.origin);
//playsoundatposition ("amb_sparks_r_end", right_org.origin);
}
heres the script without the //
Quote:
master_electric_switch()
{
//(i guess this isnt needed but i just let it in i dont think this can solve the problem of the perks)
trig = getent("use_master_switch","targetname");
master_switch=getent("master_switch","targetname");
master_switch notsolid();
master_switch rotatepitch(90,1);
trig sethintstring(&"ZOMBIE_ELECTRIC_SWITCH");
//i guess this isnt inportant but i just let it in ( i dont think this can do something wrong in the game)
cheat = false;
if ( cheat != true )
{
trig waittill("trigger",user);
}
//(some code for the switch that isnt in the map but just let it be in the script else i get an error)
master_switch rotateroll(-90,.3);
master_switch playsound("switch_flip");
//(i think this is the command for for the map to know that the switch is used)
clientnotify("revive_on");
clientnotify("middle_door_open");
clientnotify("fast_reload_on");
clientnotify("doubletap_on");
clientnotify("jugger_on");
level notify("switch_flipped");
//(i guess this is the variable that contains info about elec switch status)
flag_set("electric_switch_used");
//(i guess this will turn the machines on, // the middle door out because i haven't got one)
level notify ("sleight_on");
level notify("revive_on");
// level notify ("electric_on_middle_door");
level notify ("doubletap_on");
level notify ("juggernog_on");
as you can see i // many commands out from the original script. the machines are working but when i die the icons on the left of the screen wont disappear and the machines cant be used a second time. the perks are disabled but the icons still remain on the hud.
any sugestions. thx in advance.