I used this page for reference...
http://wiki.amxmodx.org/index.php/Advanced_Scripting_%28AMX_Mod_X%29
To make a long story short, I'm trying to make a bazooka hero that will fire more than one missile on a given keydown. Here is what I was attempting...
Code:
//Original Code
switch(icmd){
case 1: make_rocket(id,icmd,get_cvar_num("armageddon_speed"),0)
case 2: make_rocket(id,icmd,get_cvar_num("armageddon_speed"),0)
case 3: make_rocket(id,icmd,get_cvar_num("armageddon_speed"),0)
case 5: make_rocket(id,icmd,get_cvar_num("armageddon_hsspeed"),0)
case 6: make_rocket(id,icmd,get_cvar_num("armageddon_rsspeed"),0)
case 7: make_rocket(id,icmd,get_cvar_num("armageddon_sdspeed"),0)
default: make_rocket(id,icmd,get_cvar_num("armageddon_speed"),0)
Code:
//New Code
case 1: set_task(0.3, "make_rocket(id,icmd,1000,0)",id,"",0,"a",10)
I tried doing this, and it worked, only it didn't create any baz entities...it would let you know with the client_print that it was trying to fire, only nothing was getting created.
And, it's like it only excutes once. You only get 1 message, not 10. It should be running 10 times correct? Any thoughts or help will be appreciated.
Thanks in advance,
-helium
-Edit-
I also tried this, and the baz's would create properly, only too close together. They would just collide with one another and explode immediately, killing you =D. If I had a way to control the time and make them fire off fractions of seconds apart, it would be alright I guess - this is what lead me to think I need to use a set_task.
Code:
//More Code
case 1:
{
make_rocket(id,icmd,get_cvar_num("armageddon_speed"),0)
make_rocket(id,icmd,get_cvar_num("armageddon_speed"),0)
make_rocket(id,icmd,get_cvar_num("armageddon_speed"),0)
}