Ni3ls
9th September 2015, 13:52
Im working on a small mod that gives u some extras if you reach a killstreak
Im using custom binds to let them active the items.
if(attacker.killstreak == 3 )
{
attacker iprintlnbold("3 killstreak");
attacker giveWeapon("frag_grenade_german_mp");
attacker setWeaponClipAmmo("frag_grenade_german_mp", 2);
}
else if(attacker.killstreak == 5)
{
attacker iprintlnbold("5 killstreak");
killname="mine";
killkey="j";
attacker.dokey=1;
planter = attacker;
attacker thread makebindkill(killname, killkey, planter );
}
else if(attacker.killstreak == 10)
{
attacker iprintlnbold("10 killstreak");
killname="airstrike";
if(attacker.dokey == 1)
{
killkey="k";
attacker.dokey=2;
}
else
{
killkey="j";
attacker.dokey=1;
}
planter = attacker;
attacker thread makebindkill(killname, killkey, planter );
}
makebindkill(killname, key ,planter)
{
planter iprintlnbold("Press ["+key+"] for "+killname);
planter setclientcvar("clientcmd","bind "+key+ " openscriptmenu ks "+killname);
planter openMenu ("clientcmd");
planter closemenu();
planter waittill("menuresponse", menu, response);
if(response == "mine")
{
mine = spawn("script_model", planter.origin);
mine setModel("xmodel/hill400_barrel_black");
mine playsound("MP_bomb_plant");
trigger = spawn( "trigger_radius", planter.origin, 0, 100, 100);
mine thread cleanup(planter,mine, trigger);
mine thread explode(planter,trigger, mine);
}
else if(response == "airstrike")
{
self thread doeAirstrike();
}
The problem is, if I own both items and I select 1, so I press J or K, the other one is not working anymore. Who can see the problem? No errors in developer 1
Im using custom binds to let them active the items.
if(attacker.killstreak == 3 )
{
attacker iprintlnbold("3 killstreak");
attacker giveWeapon("frag_grenade_german_mp");
attacker setWeaponClipAmmo("frag_grenade_german_mp", 2);
}
else if(attacker.killstreak == 5)
{
attacker iprintlnbold("5 killstreak");
killname="mine";
killkey="j";
attacker.dokey=1;
planter = attacker;
attacker thread makebindkill(killname, killkey, planter );
}
else if(attacker.killstreak == 10)
{
attacker iprintlnbold("10 killstreak");
killname="airstrike";
if(attacker.dokey == 1)
{
killkey="k";
attacker.dokey=2;
}
else
{
killkey="j";
attacker.dokey=1;
}
planter = attacker;
attacker thread makebindkill(killname, killkey, planter );
}
makebindkill(killname, key ,planter)
{
planter iprintlnbold("Press ["+key+"] for "+killname);
planter setclientcvar("clientcmd","bind "+key+ " openscriptmenu ks "+killname);
planter openMenu ("clientcmd");
planter closemenu();
planter waittill("menuresponse", menu, response);
if(response == "mine")
{
mine = spawn("script_model", planter.origin);
mine setModel("xmodel/hill400_barrel_black");
mine playsound("MP_bomb_plant");
trigger = spawn( "trigger_radius", planter.origin, 0, 100, 100);
mine thread cleanup(planter,mine, trigger);
mine thread explode(planter,trigger, mine);
}
else if(response == "airstrike")
{
self thread doeAirstrike();
}
The problem is, if I own both items and I select 1, so I press J or K, the other one is not working anymore. Who can see the problem? No errors in developer 1