August 17, 2018, 10:23:31 PM

Author Topic: script disables power switch.  (Read 2286 times)

damonmbk

  • Recently Bitten
  • **
  • Posts: 48
  • Karma: 0
    • View Profile
script disables power switch.
« on: July 31, 2015, 10:18:18 PM »
I have this script which inst finished as of yet but for some reason it disables my power switch and removes my soul chest models. if i shoot the triggers and get the perks it then enables the power switch and returns the soul chest models. What is causing it?

Code: [Select]
#include common_scripts\utility;
#include maps\_utility;
#include maps\_zombiemode_utility;

main()
{
bear_do("secret_bear","secret_trigger");
bear_do("secret_bear2","secret_trigger2");
bear_do("secret_bear3","secret_trigger3");
bear_do("secret_bear4","secret_trigger4");
bear_do("secret_bear5","secret_trigger5");
bear_do("secret_bear6","secret_trigger6");
army_door();
}

bear_do(bear_t,trig_t)
{
bear = getEnt(bear_t,"targetname");
trig = getEnt(trig_t,"targetname");

trig waittill("trigger");
trig delete();
trig SetCursorHint( "HINT_NOICON" );
trig setHintString("DOOR_UNLOCKED");

iPrintLnBold("You have found a serect teddybear");
bear delete();
}
army_door()
{

if(self.teddybear_num == 6)
{
thread maps\give_players_perks::main();
}
}

Thanks Damon.
« Last Edit: July 31, 2015, 11:27:52 PM by damonmbk »
Youtuber!

WinCat

  • Founder
  • ***
  • Posts: 1094
  • Karma: 86
    • View Profile
    • My Site
Re: script disables power switch.
« Reply #1 on: August 01, 2015, 10:28:29 AM »
How and where are you calling the script from.

damonmbk

  • Recently Bitten
  • **
  • Posts: 48
  • Karma: 0
    • View Profile
Re: script disables power switch.
« Reply #2 on: August 01, 2015, 11:35:15 AM »
Im calling it in my mapname.gsc via maps\hidden_ee::main();

This is the script made by ege115 that im calling in my script above but I think that is the issue.

Code: [Select]
#include common_scripts\utility;
#include maps\_utility;
#include maps\_zombiemode_utility;

main()
{
thread give_player_perks();
}

give_player_perks()
{
players = get_players();
for( i = 0; i < players.size; i++ )
{
players[i] thread give_all_perks();
players[i] thread remove_revive_solo();
}
}

give_all_perks()
{
flag_wait("all_players_connected");

wait .3;

perks = [];
perks[0] = "specialty_armorvest"; //Juggernog
perks[1] = "specialty_rof"; //Double tap
perks[2] = "specialty_fastreload";//speed cola
perks[3] = "specialty_detectexplosive";//PHD flopper
perks[4] = "specialty_bulletaccuracy";//deadshot
perks[5] = "specialty_extraammo";//mule kick
perks[6] = "specialty_longersprint";// staminup
//perks[7] = "speciality_whatever_perk";// IF YOU HAVE MORE PERKS YOU WANT TO ADD, THEN CHANGE "speciality_whatever_perk" TO THE STRING NAME OF THE PERK YOU WILL ADD. THEN CONTINUE LIKE THAT WHEN ADDING MORE PERKS. AND CHANGE THE NUMBER AT EVERY PERK YOU ADD LIKE. "perks[number]"

while(1)
{
for(p=0;p<perks.size;p++)
{
if(!self HasPerk(perks[p]))
{
self thread jugg_fix();

self setperk(perks[p]);

self thread maps\_zombiemode_perks::perk_hud_create( perks[p] );
self thread maps\_zombiemode_perks::perk_think( perks[p] );
}
if(level.intermission == true)
break;
wait .3;
}
if(level.intermission == true)
break;
}
}

jugg_fix()
{
while(1)
{
if(self HasPerk("specialty_armorvest") && !self maps\_laststand::player_is_in_laststand() && self.being_revived == false)
{
self.maxhealth = level.zombie_vars["zombie_perk_juggernaut_health"];
self.health = level.zombie_vars["zombie_perk_juggernaut_health"];
break;
}
wait .1;
}
}

remove_revive_solo()
{
if(!self HasPerk("specialty_quickrevive"))
{
self SetPerk("specialty_quickrevive");
self maps\_zombiemode_perks::perk_hud_create( "specialty_quickrevive" );
self thread maps\_zombiemode_perks::perk_think( "specialty_quickrevive" );
}

while(1)
{
//iprintln("waittill is active");
self waittill_any( "fake_death", "death", "player_downed" );

if(self.size == 1 && self HasPerk("specialty_quickrevive"))
{
self UnSetPerk("specialty_quickrevive");
self thread maps\_zombiemode_perks::perk_hud_destroy( "specialty_quickrevive" );
// iprintln("removed revive on solo");
}
else if(self.size != 1 && !self HasPerk("specialty_quickrevive"))
{
self SetPerk("specialty_quickrevive");
self maps\_zombiemode_perks::perk_hud_create( "specialty_quickrevive" );
self thread maps\_zombiemode_perks::perk_think( "specialty_quickrevive" );
// iprintln("Give back revive in coop");
}
}
}

Thanks Damon.
Youtuber!

WinCat

  • Founder
  • ***
  • Posts: 1094
  • Karma: 86
    • View Profile
    • My Site
Re: script disables power switch.
« Reply #3 on: August 01, 2015, 12:16:37 PM »
Call it with thread prefix.

Code: [Select]
thread maps\hidden_ee::main();