Author Topic: This code to let a player type /buygun to recive a gun dosn't work.  (Read 450 times)

Code: [Select]
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.
« Last Edit: April 30, 2010, 10:45:12 PM by Azjherben »