Reply to Re: Question for implementing new Keys
If you don't have an account, just leave the password field blank.
Ooh! Ooh! I know of a *perfect* way to do what you're trying to do.
1) Create a global variable called "¤t_weapon" in main.c
2) In *every* weapon/item script, add "¤t_weapon = ¤t_script;" in the arm function.
3) In *every* weapon/item script, add a new function called 'alt' or 'altuse' or whatever you want. It is imperative that you create it in *every* weapon/item, even those that don't have alternative modes, otherwise it will cause problems.
4) Then in key123.c or whatever, do this code:
void main(void)
{
run_script_by_number(¤t_weapon,"altuse");
kill_this_task();
}
Replacing 'altuse' with whatever function name you chose in step 3.
And that's it. Nice and neat code, no checking to see if which weapon is armed, etc.
1) Create a global variable called "¤t_weapon" in main.c
2) In *every* weapon/item script, add "¤t_weapon = ¤t_script;" in the arm function.
3) In *every* weapon/item script, add a new function called 'alt' or 'altuse' or whatever you want. It is imperative that you create it in *every* weapon/item, even those that don't have alternative modes, otherwise it will cause problems.
4) Then in key123.c or whatever, do this code:
void main(void)
{
run_script_by_number(¤t_weapon,"altuse");
kill_this_task();
}
Replacing 'altuse' with whatever function name you chose in step 3.
And that's it. Nice and neat code, no checking to see if which weapon is armed, etc.