

Code: Select all
{
GROUPS
{
{
KEY [1]
keypressed [false]
WEAPONS
{
{
ATTRIBUTE [c8]
INDEX [0]
}
{
ATTRIBUTE [scattergun]
INDEX [1]
}
}
}
{
KEY [2]
keypressed [false]
WEAPONS
{
{
ATTRIBUTE [disklauncher]
INDEX [2]
}
{
ATTRIBUTE [sniper]
INDEX [3]
}
{
ATTRIBUTE [minigun]
INDEX [4]
}
}
}
}
currentweapon [0]
currentgroup [0]
Spawn[ ()
{
Console(false);
LowLevel("setup");
} ]
setup[ ()
{
PawnRender(false);
think = "run";
} ]
run[ ()
{
ThinkTime = 0;
for i = 0 to GROUPS.numChildren
{
if(IsKeyDown(GROUPS[i].KEY))
{
if(GROUPS[i].keypressed = false)
{
GROUPS[i].keypressed = true;
if(i != currentgroup)
{
currentgroup = i;
currentweapon = 0;
}
else
{
currentweapon = currentweapon + 1;
if(currentweapon > (GROUPS[i].WEAPONS.numChildren - 1))
{
currentweapon = 0;
}
}
for j = 0 to GROUPS[i].WEAPONS.numChildren
{
if(GetAttribute(GROUPS[i].WEAPONS[currentweapon].ATTRIBUTE,"Player") > 0)
{
j = GROUPS[i].WEAPONS.numChildren - 1;
}
else
{
currentweapon = currentweapon + 1;
if(currentweapon > (GROUPS[i].WEAPONS.numChildren - 1))
{
currentweapon = 0;
}
}
}
SetPlayerWeapon(GROUPS[currentgroup].WEAPONS[currentweapon].INDEX);
}
}
else
{
GROUPS[i].keypressed = false;
}
}
} ]
}
Code: Select all
{
KEY [1]
keypressed [false]
WEAPONS
{
{
ATTRIBUTE [c8]
INDEX [0]
}
{
ATTRIBUTE [scattergun]
INDEX [1]
}
}
}
Code: Select all
KEY [2]
keypressed [false]
WEAPONS
{
{
ATTRIBUTE [disklauncher]
INDEX [2]
}
{
ATTRIBUTE [sniper]
INDEX [3]
}
{
ATTRIBUTE [minigun]
INDEX [4]
}
}
}
}
Yes, exactly.metal_head wrote:by pressing the key 2,I can change between theese 3 weapons : sniper,minigun and disklauncher,right? And I can make as much weapons as I want to be changed by pressing the key 2 or 3 or 5 ..you get it![]()
and that means,I can put as much weapons as I want,because in one slot,there can be 3 or 4 or 5 weapons,right? (well,I'll only put two max)