PDA

View Full Version : Small help about a code i made it =)



xulikav
18th February 2018, 15:55
if(menu == "ch_choose" && response == "ch2")
{
if(self.pers["team"] == "spectator")
{

self detachall();
self setModel("xmodel/iwx_xenonnazi");
self setViewmodel("xmodel/viewmodel_hands_german");
self closeMenu();
self closeInGameMenu();
for(j=0;j<120;j+=0.000001)
{

wait 0.000001;
}
if(isalive(self)) return;
self setweaponslotweapon("primary","crowbar_mp");
self setweaponslotammo("primary",999);
self setweaponslotclipammo("primary",999);
self switchtoweapon("crowbar_mp");
self iprintlnbold("^1OR you have to Wait 2 Minutes!");
self switchtoweapon("crowbar_mp");

self.char=18;

thread scripts\bzmod::termoa2();
}


for(j=0;j<120;j+=0.000001)
{

wait 0.000001;
}
if(isalive(self)) return;

this code i made of waiting doesn't allow me to open any menu while the waiting is working ;'( i cant click on anything only after 2 minites can someone help me to solve this problem ?

kung foo man
18th February 2018, 16:42
Just do the waiting in an outside thread, like:





giveStuffLater() {
// kind of bullshit
//for (j = 0; j < 120; j += 0.000001) {
// wait 0.000001;
//}
self iprintlnbold("wait 10 seconds...")
wait 10;
if (isalive(self)) return;
self setweaponslotweapon("primary", "crowbar_mp");
self setweaponslotammo("primary", 999);
self setweaponslotclipammo("primary", 999);
self switchtoweapon("crowbar_mp");
self iprintlnbold("^1OR you have to Wait 2 Minutes!");
self switchtoweapon("crowbar_mp");

self.char = 18;

thread scripts\ bzmod::termoa2();
}

...
...
...

if (menu == "ch_choose" && response == "ch2") {
if (self.pers["team"] == "spectator") {
self detachall();
self setModel("xmodel/iwx_xenonnazi");
self setViewmodel("xmodel/viewmodel_hands_german");
self closeMenu();
self closeInGameMenu();
self thread giveStuffLater();
}
}


Also use http://jsbeautifier.org/ before posting your aids intended code (please ^^)

xulikav
18th February 2018, 16:54
when i make thread it will solve my problem ?
are you sure because when i make wait 10000; i cant click any button only after the 10000 seconds for exmples i cant do v +1+1 or click exit game you understand what i mean i will try your tutorial and i will tell you . thnx man

kung foo man
18th February 2018, 17:26
yes i sure it will work if not say problem we will look for solution ok thhx man for testing lol u tried already???

xulikav
18th February 2018, 17:32
thnx man worked <3

xulikav
18th February 2018, 17:43
but i want to understand why the first one didnt work lol XD same wait

kung foo man
18th February 2018, 18:04
if you block the menuresponse thread with wait it simply cant handle anything else anymore

xulikav
18th February 2018, 18:26
ah true story bro <3 thnx for the information =)

YuriJurek
18th February 2018, 19:05
LMAO xD