Page 1 of 1

Weaponcommand

Posted: Mon Aug 25, 2008 3:31 pm
by $oldier Of Ra
Hi everyone. I seem to have trouble making the weaponcommand to work.

I don't want to edit tiks, but there's a way to change somethings through script (ie with weaponcommand)
Like these (I have found in search)

Code: Select all

// these 2 lines give him unlimited ammo - you can remove them if you want
weaponcommand dual dmammorequired 0
weaponcommand dual usenoammo 1
// fire rate - can be removed
weaponcommand dual dmfiredelay 1
// here, change this value:
weaponcommand dual dmmovementspeed 1.0
// this makes it so that you can't drop the weapon - we don't want the other team to lay their hands on this! ;)
weaponcommand dual notdroppable
// bullet damage and accuracy - can be removed
weaponcommand dual dmbulletdamage 60
weaponcommand dual dmbulletspread 25 25 150 150
Actually I'd like to use all of these commands and make them work but for now I want to take all weapons from all players after X number of seconds. And give them a pistol with no ammo to bash.

NOTE: I haven't included my time code and the TAKE and GIVE commands don't work either.

Here's my code:

Code: Select all

for (local.I=1;local.I <= $player.size;local.I++) 
		{
		if ($player[local.I].dmteam=="spectator") 
			{
			end
			}
		if ($player[local.I].dmteam=="allies")
			{
			$player[local.I] takeall
			waitframe
			$player[local.I] item weapons/colt45.tik
			//$player[local.I] take ammo 999
            $player[local.I] weaponcommand dual startammo 0
			$player[local.I] useweaponclass pistol 
			}
end

Posted: Mon Aug 25, 2008 5:57 pm
by jv_map
Mind you there's a difference between an i and an I. :)

Posted: Mon Aug 25, 2008 10:15 pm
by $oldier Of Ra
Oh my bad, I didn't knew mohaa recognizes capital letters as different, I thought that was a Linux thing. But the console didn't give any error message. Has my problem have something to do with proper waits?

I edited my first post and tried it, but no go.

EDIT: Figured out another way:

$player[local.I] ammo pistol -100
wait .5
$player[local.I] weaponcommand mainhand clipsize 0

works now :D