Author Topic: Using ForceWeapon  (Read 1003 times)

0 Members and 1 Guest are viewing this topic.

Offline cynicle

  • Major(1)
  • Posts: 37
Using ForceWeapon
« on: June 12, 2007, 08:35:44 am »
Hey I have something written like so...

Code: [Select]
procedure ForceWeapon(ID, Primary, Secondary, Ammo: Byte);
var
testcase: string;

begin
 testcase := IDToName(ID);
  begin
   if testcase = 'test'
   then Primary := 13;
  end;
end;

according to my logic this should force someone with name test to use chainsaw, but i've tried it and it seems to do nothing....

Just wondering how this function actually works. Maybe not as obvious as stated in server help....
Join the Army. Visit strange and exotic places. Meet fascinating people. And kill them.

Aus Soldat League 203.208.70.216:23073

Offline spkka

  • Camper
  • ***
  • Posts: 469
Re: Using ForceWeapon
« Reply #1 on: June 12, 2007, 08:45:29 am »
begin
   testcase := IDToName(ID);
   if testcase = 'test' then
   begin
   Forceweapon(testcase, 13, 0, 15);
   end;
end;

sth like that
 

Offline cynicle

  • Major(1)
  • Posts: 37
Re: Using ForceWeapon
« Reply #2 on: June 13, 2007, 06:44:34 am »
I changed the testcase to ID and that worked great cheers.
Join the Army. Visit strange and exotic places. Meet fascinating people. And kill them.

Aus Soldat League 203.208.70.216:23073

Offline spkka

  • Camper
  • ***
  • Posts: 469
Re: Using ForceWeapon
« Reply #3 on: June 13, 2007, 07:03:39 am »
no problem!