Author Topic: Can i do like ...  (Read 11901 times)

0 Members and 1 Guest are viewing this topic.

Offline mich1103

  • Flagrunner
  • ****
  • Posts: 558
  • Did you say chocolate ? O.o
    • ZoMbIe-DeStRoYeR pk server
Can i do like ...
« on: March 21, 2010, 03:30:03 pm »
I've seen this topic : http://forums.soldat.pl/index.php?topic=32697.0
About looting ...
Can i do like :

Code: [Select]
procedure DropLoot(ID,Killer: byte);
var rand,drop: byte;
    loot: string;
begin
//WriteConsole(Killer,'You've just looted a item.',$ff5555ff);
    loot := '';
    drop := 0;
    rand := Random(0,100);
    case IGB[ID].bname of
      'Zombie': begin
        if rand >= 75 then begin
          if rand >= 85 then begin
            if rand >= 90 then begin
              drop := 16;
           
            end else drop := 17;
            end else drop := 18;
            end else drop := 19;
            end else drop := 20;
            end else drop := 21;
            end else drop := 22;
            end else drop := 23;
        end;
      end;
     
    case drop of
      1: loot := 'Desert Eagle';
      2: loot := 'HK MP5';
      3: loot := 'AK 74';
      4: loot := 'Steyr AUG';
      5: loot := 'Spas 12';
      6: loot := 'Ruger77';
      7: loot := 'M79';
      8: loot := 'Barrett M82A1';
      9: loot := 'Minimi';
      10: loot := 'Minigun';
      11: loot := 'USSOCOM';
      12: loot := 'Combat Knife';
      13: loot := 'Chainsaw';
      14: loot := 'LAW';
      15: loot := 'Stationary Gun';
      16: loot := 'Medical Kit';
      17: loot := 'Grenade Kit';
      18: loot := 'Flamer Kit';
      19: loot := 'Vest Kit';
      20: loot := 'Predator Kit';
      21: loot := 'Berserk Kit';
      22: loot := 'Cluster Kit';
    end;

    if drop > 0 then begin
        SpawnObject(GetPlayerStat(ID,'x'),GetPlayerStat(ID,'y'),drop);
      WriteConsole(Killer,'Looted -:- ' + loot ,$ff5555ff);
    end;
  end;

Offline Gizd

  • Flagrunner
  • ****
  • Posts: 586
  • (Re)tired
    • Eat-this! community site
Re: Can i do like ...
« Reply #1 on: March 22, 2010, 09:30:30 am »
Say what changed because most of people won't even start to compare these scripts and it's you who should care about the answer.

Offline mich1103

  • Flagrunner
  • ****
  • Posts: 558
  • Did you say chocolate ? O.o
    • ZoMbIe-DeStRoYeR pk server
Re: Can i do like ...
« Reply #2 on: March 22, 2010, 03:18:16 pm »
The script i've put is not good i just want to make a script that when the bot named ''Zombie'' die there is 25% to drop one of this item :
      'Medical Kit'
      'Grenade Kit';
      'Flamer Kit';
      'Vest Kit';
      'Predator Kit';
      'Berserk Kit';
      'Cluster Kit';
and i want thats say like :
You've just looted a''THE LOOT HERE''!

Offline Hacktank

  • Camper
  • ***
  • Posts: 462
  • Soldat Scripter
    • HTZRPG
Re: Can i do like ...
« Reply #3 on: March 22, 2010, 04:00:19 pm »
Heres what i use:

Code: [Select]
function Choose(Input: array of variant): variant;
var i,len: integer;
begin
len := getarraylength(input);
i := random(0,len);
if i < 0 then i := 0;
if i > len-1 then i := len-1;
result := input[i];
end;

procedure DropLoot(ID,Killer: byte);
var drop: byte; loot: string;
begin
drop := 255;
if getplayerstat(ID,'human')=false then begin
case getplayerstat(ID,'name') of
'Zombie': drop := choose([1,16,17]);
'Elite Zombie': drop := choose([18,19,22,5]);
                // just copypaste and edit whats in the choose to get different drops
end;
if drop = 255 then drop := choose([1,2,3,4,5,6,7,8,9,10,11,12,13,14,16,17,18,19,20,21,22]);
end else drop := choose([1,2,3,4,5,6,7,8,9,10,11,12,13,14,16,17,18,19,20,21,22]);;
case drop of
1: loot := 'Desert Eagle';
2: loot := 'HK MP5';
3: loot := 'AK 74';
4: loot := 'Steyr AUG';
5: loot := 'Spas 12';
6: loot := 'Ruger77';
7: loot := 'M79';
8: loot := 'Barrett M82A1';
9: loot := 'Minimi';
10: loot := 'Minigun';
11: loot := 'USSOCOM';
12: loot := 'Combat Knife';
13: loot := 'Chainsaw';
14: loot := 'LAW';
15: loot := 'Stationary Gun';
16: loot := 'Medical Kit';
17: loot := 'Grenade Kit';
18: loot := 'Flamer Kit';
19: loot := 'Vest Kit';
20: loot := 'Predator Kit';
21: loot := 'Berserk Kit';
22: loot := 'Cluster Kit';
end;
if (drop >= 1) AND (drop <= 22) then begin
spawnobject(getplayerstat(ID,'x'),getplayerstat(ID,'y')-11,drop);
writeconsole(Killer,'Looted -:- ' + loot ,$ff5555ff);
end;
end;


Offline mich1103

  • Flagrunner
  • ****
  • Posts: 558
  • Did you say chocolate ? O.o
    • ZoMbIe-DeStRoYeR pk server
Re: Can i do like ...
« Reply #4 on: March 22, 2010, 04:29:57 pm »
i've used that and the script has passed but there is no drop !
Code: [Select]
function Choose(Input: array of variant): variant;
var i,len: integer;
begin
len := getarraylength(input);
i := random(0,len);
if i < 0 then i := 0;
if i > len-1 then i := len-1;
result := input[i];
end;

procedure DropLoot(ID,Killer: byte);
var drop: byte; loot: string;
begin
drop := 255;
if getplayerstat(ID,'human')=false then begin
case getplayerstat(ID,'name') of
'Zombie': drop := choose([22,21,20,19,18,16,17])
                // just copypaste and edit whats in the choose to get different drops
end;
if drop = 255 then drop := choose([1,2,3,4,5,6,7,8,9,10,11,12,13,14,16,17,18,19,20,21,22]);
end else drop := choose([1,2,3,4,5,6,7,8,9,10,11,12,13,14,16,17,18,19,20,21,22]);;
case drop of
1: loot := 'Desert Eagle';
2: loot := 'HK MP5';
3: loot := 'AK 74';
4: loot := 'Steyr AUG';
5: loot := 'Spas 12';
6: loot := 'Ruger77';
7: loot := 'M79';
8: loot := 'Barrett M82A1';
9: loot := 'Minimi';
10: loot := 'Minigun';
11: loot := 'USSOCOM';
12: loot := 'Combat Knife';
13: loot := 'Chainsaw';
14: loot := 'LAW';
15: loot := 'Stationary Gun';
16: loot := 'Medical Kit';
17: loot := 'Grenade Kit';
18: loot := 'Flamer Kit';
19: loot := 'Vest Kit';
20: loot := 'Predator Kit';
21: loot := 'Berserk Kit';
22: loot := 'Cluster Kit';
end;
if (drop >= 1) AND (drop <= 22) then begin
spawnobject(getplayerstat(ID,'x'),getplayerstat(ID,'y')-11,drop);
writeconsole(Killer,'Looted -:- ' + loot ,$ff5555ff);
end;
end;

Offline Hacktank

  • Camper
  • ***
  • Posts: 462
  • Soldat Scripter
    • HTZRPG
Re: Can i do like ...
« Reply #5 on: March 22, 2010, 10:37:33 pm »
How are you using it? Like:

Code: [Select]
onplayerkill(killer,victim: byte);
begin
droploot(victim,killer);
end;
?


Offline mich1103

  • Flagrunner
  • ****
  • Posts: 558
  • Did you say chocolate ? O.o
    • ZoMbIe-DeStRoYeR pk server
Re: Can i do like ...
« Reply #6 on: March 23, 2010, 06:54:48 am »
I don't use that !

Offline Gizd

  • Flagrunner
  • ****
  • Posts: 586
  • (Re)tired
    • Eat-this! community site
Re: Can i do like ...
« Reply #7 on: March 23, 2010, 08:29:22 am »
/facepalm

It's a procedure dropping random item at player's location, you need to use it in a build-in event.

Offline mich1103

  • Flagrunner
  • ****
  • Posts: 558
  • Did you say chocolate ? O.o
    • ZoMbIe-DeStRoYeR pk server
Re: Can i do like ...
« Reply #8 on: March 23, 2010, 02:55:42 pm »
I don't understand
do you mean that there is a /faceplam commmand ?
and this command should drop a random item ?

Offline Mercury92

  • Camper
  • ***
  • Posts: 284
Re: Can i do like ...
« Reply #9 on: March 23, 2010, 04:57:33 pm »
[saw]  on 1.5.1

Offline mich1103

  • Flagrunner
  • ****
  • Posts: 558
  • Did you say chocolate ? O.o
    • ZoMbIe-DeStRoYeR pk server
Re: Can i do like ...
« Reply #10 on: March 23, 2010, 05:00:35 pm »
OMG !

Offline Gizd

  • Flagrunner
  • ****
  • Posts: 586
  • (Re)tired
    • Eat-this! community site
Re: Can i do like ...
« Reply #11 on: March 23, 2010, 11:36:57 pm »
As you should notice the /facepalm is separated from the information below.

edit: /triplefacepalm btw

Offline mich1103

  • Flagrunner
  • ****
  • Posts: 558
  • Did you say chocolate ? O.o
    • ZoMbIe-DeStRoYeR pk server
Re: Can i do like ...
« Reply #12 on: March 24, 2010, 05:36:45 am »
WTF !!!
i don't understand the facepalm !

Offline Stuffy

  • Soldier
  • **
  • Posts: 182
  • Very stuffy.
    • Climb-Zone Forum
Re: Can i do like ...
« Reply #13 on: March 24, 2010, 06:30:04 am »
Mich, what you've done in the script is only the procedure, but you need to call it somewhere. Just paste the code Hacktank wrote into your script.
The truth is out there? Does anyone know the URL?
The URL is here

Offline mich1103

  • Flagrunner
  • ****
  • Posts: 558
  • Did you say chocolate ? O.o
    • ZoMbIe-DeStRoYeR pk server
Re: Can i do like ...
« Reply #14 on: March 24, 2010, 07:00:33 am »
i don't have script !
i want to make one !
but the HT script is what i need to use ?

Offline Stuffy

  • Soldier
  • **
  • Posts: 182
  • Very stuffy.
    • Climb-Zone Forum
Re: Can i do like ...
« Reply #15 on: March 24, 2010, 07:20:59 am »
Well just paste the code from your first post into a .pas file and add this:

Code: [Select]
procedure OnPlayerKill(Killer, Victim: byte;Weapon: byte);
begin
DropLoot(Victim, Killer);
end;
« Last Edit: March 24, 2010, 07:25:42 am by Stuffy »
The truth is out there? Does anyone know the URL?
The URL is here

Offline mich1103

  • Flagrunner
  • ****
  • Posts: 558
  • Did you say chocolate ? O.o
    • ZoMbIe-DeStRoYeR pk server
Re: Can i do like ...
« Reply #16 on: March 24, 2010, 03:09:37 pm »
Like that ?
Code: [Select]
procedure OnPlayerKill(Killer, Victim: byte;Weapon: byte);
begin
DropLoot(Victim, Killer);
end;

function Choose(Input: array of variant): variant;
var i,len: integer;
begin
len := getarraylength(input);
i := random(0,len);
if i < 0 then i := 0;
if i > len-1 then i := len-1;
result := input[i];
end;

procedure DropLoot(ID,Killer: byte);
var drop: byte; loot: string;
begin
drop := 255;
if getplayerstat(ID,'human')=false then begin
case getplayerstat(ID,'name') of
'Zombie': drop := choose([22,21,20,19,18,16,17])
                // just copypaste and edit whats in the choose to get different drops
end;
if drop = 255 then drop := choose([1,2,3,4,5,6,7,8,9,10,11,12,13,14,16,17,18,19,20,21,22]);
end else drop := choose([1,2,3,4,5,6,7,8,9,10,11,12,13,14,16,17,18,19,20,21,22]);;
case drop of
1: loot := 'Desert Eagle';
2: loot := 'HK MP5';
3: loot := 'AK 74';
4: loot := 'Steyr AUG';
5: loot := 'Spas 12';
6: loot := 'Ruger77';
7: loot := 'M79';
8: loot := 'Barrett M82A1';
9: loot := 'Minimi';
10: loot := 'Minigun';
11: loot := 'USSOCOM';
12: loot := 'Combat Knife';
13: loot := 'Chainsaw';
14: loot := 'LAW';
15: loot := 'Stationary Gun';
16: loot := 'Medical Kit';
17: loot := 'Grenade Kit';
18: loot := 'Flamer Kit';
19: loot := 'Vest Kit';
20: loot := 'Predator Kit';
21: loot := 'Berserk Kit';
22: loot := 'Cluster Kit';
end;
if (drop >= 1) AND (drop <= 22) then begin
spawnobject(getplayerstat(ID,'x'),getplayerstat(ID,'y')-11,drop);
writeconsole(Killer,'Looted -:- ' + loot ,$ff5555ff);
end;
end;

Offline Gizd

  • Flagrunner
  • ****
  • Posts: 586
  • (Re)tired
    • Eat-this! community site
Re: Can i do like ...
« Reply #17 on: March 24, 2010, 11:29:57 pm »
Close, OnPlayerKill() has to be under DropLoot()

Offline mich1103

  • Flagrunner
  • ****
  • Posts: 558
  • Did you say chocolate ? O.o
    • ZoMbIe-DeStRoYeR pk server
Re: Can i do like ...
« Reply #18 on: March 25, 2010, 05:29:31 am »
The script has passed but after 2 min ive started teh server the server crash !!!
Code: [Select]
function Choose(Input: array of variant): variant;
var i,len: integer;
begin
len := getarraylength(input);
i := random(0,len);
if i < 0 then i := 0;
if i > len-1 then i := len-1;
result := input[i];
end;

procedure DropLoot(ID,Killer: byte);
var drop: byte; loot: string;
begin
drop := 255;
if getplayerstat(ID,'human')=false then begin
case getplayerstat(ID,'name') of
'Zombie': drop := choose([22,21,20,19,18,16,17])
                // just copypaste and edit whats in the choose to get different drops
end;
if drop = 255 then drop := choose([1,2,3,4,5,6,7,8,9,10,11,12,13,14,16,17,18,19,20,21,22]);
end else drop := choose([1,2,3,4,5,6,7,8,9,10,11,12,13,14,16,17,18,19,20,21,22]);;
case drop of
1: loot := 'Desert Eagle';
2: loot := 'HK MP5';
3: loot := 'AK 74';
4: loot := 'Steyr AUG';
5: loot := 'Spas 12';
6: loot := 'Ruger77';
7: loot := 'M79';
8: loot := 'Barrett M82A1';
9: loot := 'Minimi';
10: loot := 'Minigun';
11: loot := 'USSOCOM';
12: loot := 'Combat Knife';
13: loot := 'Chainsaw';
14: loot := 'LAW';
15: loot := 'Stationary Gun';
16: loot := 'Medical Kit';
17: loot := 'Grenade Kit';
18: loot := 'Flamer Kit';
19: loot := 'Vest Kit';
20: loot := 'Predator Kit';
21: loot := 'Berserk Kit';
22: loot := 'Cluster Kit';
end;
if (drop >= 1) AND (drop <= 22) then begin
spawnobject(getplayerstat(ID,'x'),getplayerstat(ID,'y')-11,drop);
writeconsole(Killer,'Looted -:- ' + loot ,$ff5555ff);
end;
end;

procedure OnPlayerKill(Killer, Victim: byte;Weapon: byte);
begin
DropLoot(Victim, Killer);
end;


Offline Underworld

  • Camper
  • ***
  • Posts: 338
  • Mapper
Re: Can i do like ...
« Reply #19 on: March 25, 2010, 09:36:37 am »
I don't understand
do you mean that there is a /faceplam commmand ?
and this command should drop a random item ?
OMFG i never have lolled so hard in my life before never!
I don't understand
do you mean that there is a /faceplam commmand ?
and this command should drop a random item ?