Weaponcommand

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
$oldier Of Ra
Lieutenant Colonel
Posts: 404
Joined: Sun Oct 16, 2005 7:16 pm
Location: Belgium
Contact:

Weaponcommand

Post 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
Last edited by $oldier Of Ra on Mon Aug 25, 2008 10:15 pm, edited 1 time in total.
Our official website: http://www.mohaairborne.co.cc
(Still accessible through http://mohaaclantb.tk and http://users.skynet.be/mohaaclantb/)

For all your bot needs!!!!

$oldier Of Ra.
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

Mind you there's a difference between an i and an I. :)
Image
$oldier Of Ra
Lieutenant Colonel
Posts: 404
Joined: Sun Oct 16, 2005 7:16 pm
Location: Belgium
Contact:

Post 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
Our official website: http://www.mohaairborne.co.cc
(Still accessible through http://mohaaclantb.tk and http://users.skynet.be/mohaaclantb/)

For all your bot needs!!!!

$oldier Of Ra.
Post Reply