function serverCmdBuyGun(%client)
{
%player = %client.player;
for(%i = 0; %i < %player.getDatablock().maxTools; %i++)
{
%tool = %player.tool[%i];
if(%tool == 0)
{
%player.tool[%i] = TF2PistolImage;
%player.weaponCount++;
messageClient(%client,'MsgItemPickup','',%i,TF2PistolItem);
break;
}
}
}
Any ideas why?
Never mind, apparently you have to use some nametoid function on the datablock names.