Author Topic: Force Weapon Script  (Read 1180 times)

0 Members and 1 Guest are viewing this topic.

Offline Dpulse

  • Major
  • *
  • Posts: 54
    • Not sure what Chop N' Shop is? Visit one of the places above or view this topic!
Force Weapon Script
« on: May 22, 2010, 07:38:30 pm »
Can someone show me how to make one? I just need it so a single bot ID is the one that the weapon is being forced upon.

For example Sniper  Primary-Sniper Secondary-Fists

PS: I have tried to make a forceweapon script myself at least 20 times all failing to compile/work.
Come play with us at chop n' shop soldat!

Chop N' Shop IRC: #CNS.soldat
Chop N' Shop Site: www.CNSS.yolasite.com
Chop N' Shop Server IP: 66.207.3.77 Port: 27079
Not sure what Chop N' Shop is? Visit this topic: http://forums.soldat.pl/index.php?topic=35381.0

Offline Hacktank

  • Camper
  • ***
  • Posts: 462
  • Soldat Scripter
    • HTZRPG
Re: Force Weapon Script
« Reply #1 on: May 22, 2010, 11:25:30 pm »
Code: [Select]
procedure OnWeaponChange(ID, PrimaryNum, SecondaryNum: Byte);
begin;
if ID = theidyouwant then if (primarynum <> primaryyouwant) AND (secondarynum <> secondaryyouwant) then forceweapon(ID,primaryyouwant,secondaryyouwant,0);
end;

Edit: Fixed.
« Last Edit: May 23, 2010, 02:27:19 am by Hacktank »


DarkCrusade

  • Guest
Re: Force Weapon Script
« Reply #2 on: May 23, 2010, 02:19:10 am »
HackTank, that wouldn't really be good because if the bot should weild a barret and a chainsaw and he drops the barret he wouldn't get a new weapon because the secondary is the right one.


Offline Hacktank

  • Camper
  • ***
  • Posts: 462
  • Soldat Scripter
    • HTZRPG
Re: Force Weapon Script
« Reply #3 on: May 23, 2010, 02:26:40 am »
Emm, ment to put and, lol, updated.


Offline Dpulse

  • Major
  • *
  • Posts: 54
    • Not sure what Chop N' Shop is? Visit one of the places above or view this topic!
Re: Force Weapon Script
« Reply #4 on: May 24, 2010, 03:27:01 pm »
will this work on game start up? Or map change?
Come play with us at chop n' shop soldat!

Chop N' Shop IRC: #CNS.soldat
Chop N' Shop Site: www.CNSS.yolasite.com
Chop N' Shop Server IP: 66.207.3.77 Port: 27079
Not sure what Chop N' Shop is? Visit this topic: http://forums.soldat.pl/index.php?topic=35381.0

DarkCrusade

  • Guest
Re: Force Weapon Script
« Reply #5 on: May 24, 2010, 04:06:47 pm »
Procedure OnWeaponChange will be called everytime a player picks up, drops or switches weapons.

Offline Dpulse

  • Major
  • *
  • Posts: 54
    • Not sure what Chop N' Shop is? Visit one of the places above or view this topic!
Re: Force Weapon Script
« Reply #6 on: May 24, 2010, 06:57:12 pm »
i know i'm doing something wrong because it wont compile.
Quote
procedure OnWeaponChange(ID, PrimaryNum, SecondaryNum: Byte);
begin;
if ID = Blain then if (7 <> M79) AND (7 <> M79) then forceweapon(ID,M79,M79,0);
end;
« Last Edit: May 24, 2010, 07:00:38 pm by Dpulse »
Come play with us at chop n' shop soldat!

Chop N' Shop IRC: #CNS.soldat
Chop N' Shop Site: www.CNSS.yolasite.com
Chop N' Shop Server IP: 66.207.3.77 Port: 27079
Not sure what Chop N' Shop is? Visit this topic: http://forums.soldat.pl/index.php?topic=35381.0

Offline Hacktank

  • Camper
  • ***
  • Posts: 462
  • Soldat Scripter
    • HTZRPG
Re: Force Weapon Script
« Reply #7 on: May 24, 2010, 09:45:01 pm »
O.o
Code: [Select]
procedure OnWeaponChange(ID, PrimaryNum, SecondaryNum: Byte);
begin;
if getplayerstat(ID,'name') = 'Blain' then if primarynum <> 7 then forceweapon(ID,7,7,0);
end;