Author Topic: need help for weapon script  (Read 644 times)

0 Members and 1 Guest are viewing this topic.

Offline alphazero

  • Major(1)
  • Posts: 9
need help for weapon script
« on: August 15, 2008, 06:32:50 am »
hi guys :D

for my new mod i need a script that only enables weapons per team, example:

normal: everyplayer can choose all weapons

the script: team1 can choose AK minimi and mp5,
 Â                team 2 can choose steyr ruger beretta

i need this in format:

team1:weapons: 1 2 3 4 5  sec1 sec2
team2:'' ''             6 7 8 9 10 sec3 sec4

if someone can get me a tutorial site would be awesome aswell since i really want to learn scripting :)

Offline shantec

  • Soldier
  • **
  • Posts: 140
  • Get ANGREH!!
Re: need help for weapon script
« Reply #1 on: August 15, 2008, 07:25:22 am »
That one is guite easy script.

Actually... this is only thing you need, it should tell you all you need to know!    (lol also you need OnJoinTeam)




If you didn't get it heres tutor:
Code: [Select]
procedure WeapReset(ID: byte);
var i: integer;
begin
    for i := 1 to 14 do
    SetWeaponActive(ID,i,true);
end;

procedure OnJoinTeam(ID, team: byte);
var i: integer;
begin
    WeapReset(ID);
    if Team = 2 then begin
        for i := 1 to 5 do
            SetWeaponActive(ID,I,false);
            SetWeaponActive(ID,11,false);
            SetWeaponActive(ID,12,false);
    end else if Team = 1 then begin
        for i := 6 to 10 do
            SetWeaponActive(ID,I,false);
            SetWeaponActive(ID,13,false);
            SetWeaponActive(ID,14,false);
    end;
end;

Edit!
Eww theres an bug:
If you go to bravo and then alpha, you cannot use weapons at all! *Fix*
« Last Edit: August 15, 2008, 07:32:25 am by shantec »
Also Known As REIMA


Lol Happles (happy apples)