Author Topic: Looking for a couple of scripts  (Read 1707 times)

0 Members and 2 Guests are viewing this topic.

Offline demoniac93

  • Veteran
  • *****
  • Posts: 1554
Looking for a couple of scripts
« on: June 09, 2009, 09:15:45 am »
Ok so a friend of mine set up a server (Based on an old off lobby server)
and I couldn't find all the scripts we had for the older one.

We had a version of the NoobLottery that would give you the chance to win nades(clusters too)\pred\mutes (3-5-10-29 minutes) with the ban if the person leaves before his time is up.
What you'd do is type !ticket and draw for a prize.

We also had a weapon shop scripts.
On /items it would show you the following list of items: (With ID)
1.Grenades
2.Medic pack
3.Cluster grenades
4.Vest
5.Predator
6.Flamer

However, this script worked in succession with a money script.
For the first kill since your latest respawn you'd get 8 points, and they would increase by 8 when followed by other kills.
So that if respawn-->kill= 8 $
2nd kill= 16 $
3rd= 32 $
And so on until you die and it's reset to 8.

Once you'd have enough money, you would buy items like this:
/buy [item ID]
And you've got the item, if you don't have enough money the server informs you.
So you have 40$, and want to buy the medic pack, which is 30$.
/Buy 2
You have 10 left and your health is full.

And I'll be needing a /help command to show simple stuff like *For kill\death ratio type !KD*
*For weapon shop info type /items* etc...

If anyone has them or has any links to the codes or anything, please help.
Thanks in advance for any help.
« Last Edit: June 09, 2009, 10:05:18 am by demoniac93 »
b&

Offline EnEsCe

  • Retired Soldat Developer
  • Flamebow Warrior
  • ******
  • Posts: 3101
  • http://enesce.com/
    • [eC] Official Website
Re: Looking for a couple of scripts
« Reply #1 on: June 09, 2009, 09:21:46 am »
Why would you even think that this is the correct forum instead of Scripting Help/Discussion? Scripting Releases.... epic fail.

Moved.

Offline demoniac93

  • Veteran
  • *****
  • Posts: 1554
Re: Looking for a couple of scripts
« Reply #2 on: June 09, 2009, 10:04:08 am »
Cause I only wanted some links ;/
b&

Offline VinceBros

  • Soldat Beta Team
  • Camper
  • ******
  • Posts: 275
Re: Looking for a couple of scripts
« Reply #3 on: June 09, 2009, 02:44:01 pm »
I can script you something like this. I might realease it when ready. =)
Edit : Can you tell me your objects we can buy and their prices ?
« Last Edit: June 09, 2009, 03:27:59 pm by VinceBros »

Offline demoniac93

  • Veteran
  • *****
  • Posts: 1554
Re: Looking for a couple of scripts
« Reply #4 on: June 09, 2009, 04:16:06 pm »
I can script you something like this. I might realease it when ready. =)
Edit : Can you tell me your objects we can buy and their prices ?

The objects are the exact same as in the list, I need them to be separate scripts, as having the mall in one won't do it.
The prices are:
Grenades:30$
Medic Pack: 40$
Cluster Grenades: 40$
Vest: 60$
Predator: 120$
Flame God: 140$
b&

Offline JFK

  • Camper
  • ***
  • Posts: 255
    • My TraxInSpace Account
Re: Looking for a couple of scripts
« Reply #5 on: June 09, 2009, 05:21:52 pm »
Oo

This is the second time I hear about someone hacking my nooblottery script.

Very nice  ;D
Come join: EliteCTF
Listen to: My Music

Offline demoniac93

  • Veteran
  • *****
  • Posts: 1554
Re: Looking for a couple of scripts
« Reply #6 on: June 10, 2009, 03:42:42 am »
Oo

This is the second time I hear about someone hacking my nooblottery script.

Very nice  ;D

Not hacking, simply trying something new based on it :)
I must say even as "noob" lottery it owned xD
Genius, really. Goof work.
And the previous time you heard it was from me as well xD
b&

Offline ~Niko~

  • Rainbow Warrior
  • *****
  • Posts: 2410
Re: Looking for a couple of scripts
« Reply #7 on: June 11, 2009, 05:44:20 pm »
We had a version of the NoobLottery that would give you the chance to win nades(clusters too)\pred\mutes (3-5-10-29 minutes) with the ban if the person leaves before his time is up.
What you'd do is type !ticket and draw for a prize.
Can you explain that better? I think i might do it.

Offline demoniac93

  • Veteran
  • *****
  • Posts: 1554
Re: Looking for a couple of scripts
« Reply #8 on: June 12, 2009, 08:00:59 am »
We had a version of the NoobLottery that would give you the chance to win nades(clusters too)\pred\mutes (3-5-10-29 minutes) with the ban if the person leaves before his time is up.
What you'd do is type !ticket and draw for a prize.
Can you explain that better? I think i might do it.

Nvm it, we've canceled the work on that, and the server is pretty much ready, except we might need the code for a script to give any person a mine on 20 kills or cap.
b&

Offline VinceBros

  • Soldat Beta Team
  • Camper
  • ******
  • Posts: 275
Re: Looking for a couple of scripts
« Reply #9 on: June 12, 2009, 08:10:24 am »
I scripted the first part which is The Shop, The kills multiplier, and a spam message that says : Eg. : For more informations type /help.
Also /char to see current money
And /shop to see ... the buy list

Here's the script. I didnt script the lottery 'cause i don't understand it too.
Code: [Select]
// This is a cash system made by Vince
// You can buy items by the shop. You win money by killing others.
// Killing others goes like this :: First Kill : 8$ -> Second kill : 16$ -> Third Kill : 32$ [...]
Const
Spammer = true; // Spam a help message every 30 seconds
 
var
Multiplier: Array[1..32] of boolean;
Money: Array [1..32] of integer;
NadesPrice, MedicPrice, ClustersPrice, VestPrice, PredPrice, FlammerPrice: integer;
Killz: Array [1..32] of integer;
Temp: Array [1..32] of integer;

procedure ActivateServer();
begin
    NadesPrice := 30;
    MedicPrice := 40;
    ClustersPrice := 40;
    VestPrice := 60;
    PredPrice := 120;
    FlammerPrice := 140;
end;
 
procedure OnJoinGame(ID, Team: byte);
begin
WriteConsole(ID, ' You actually have $' + IntToStr(Money[ID]), RGB(251,102,1));
WriteConsole(ID, ' For more informations type /help ', RGB(251,102,1));
end;

procedure OnPlayerKill(Killer, Victim: byte;Weapon: string);
begin
Killz[Killer] := Killz[Killer] + 1;
   if Killz[Killer] = 1 then begin //If first kill since respawn
      Multiplier[Killer] := True;
      Temp[Killer] := Temp[Killer] + 8; //Only +8 money
   end;
            if (Killz[Killer] > 1) and (Multiplier[Killer] = True) then begin //If he has killed more than a guy
            Temp[Killer] := Temp[Killer] * 2; //Multiply your TEMP money by 2
            end;
   if Killer = Victim then begin //If he's killed
      Multiplier[Killer] := False;     
      Money[Killer] := Money[Killer]; //Add the TEMP money to your TOTAL money
      Killz[Killer] := Killz[Killer] + 0; //Set killcount to 0
      Killz[Killer] := 0;
      Temp[Killer] := 0;
   end; //Add the TEMP money
   Money[Killer] := Money[Killer] + Temp[Killer];
 WriteConsole(Killer, ' You Gained $' + IntToStr(Temp[Killer]), RGB(251,102,1))
end;

procedure OnPlayerRespawn(ID: Byte);
 begin
 WriteConsole(ID, ' You now have $' + IntToStr(Money[ID]), RGB(251,102,1))   
      Multiplier[ID] := False;     
      Money[ID] := Money[ID]; //Add the TEMP money to your TOTAL money
      Killz[ID] := Killz[ID] + 0; //Set killcount to 0
      Killz[ID] := 0;
      Temp[ID] := 0;
 end;
 
function OnPlayerCommand(ID: Byte; Text: string): boolean;
begin
 if regExpMatch('^/(char|money)$', Text) then begin
 WriteConsole(ID, ' You actually have $' + IntToStr(Money[ID]), RGB(251,102,1));
 end;
if regExpMatch('^/(buy grenade|buy nade)$', Text) then begin
 if Money[ID] >= NadesPrice then begin
  Money[ID] := Money[ID] - NadesPrice ;
  GiveBonus(ID,4);                                                   // DONE
  WriteConsole(ID, ' You just bought grenades, now have $' + IntToStr(Money[ID]), RGB(251,102,1));
 end else WriteConsole(ID, ' You do not have enough money ', RGB(251,102,1));
end;
 
if regExpMatch('^/(buy medic|buy med|buy health)$', Text) then begin //same with these
  If Money[ID] >= MedicPrice then begin
  Money[ID] := Money[ID] - MedicPrice
  SpawnObject(GetPlayerStat(ID,'x'),GetPlayerStat(ID,'y'),16); // DONE
   WriteConsole(ID, ' You just bought Medic, now have $' + IntToStr(Money[ID]), RGB(251,102,1));
  end else WriteConsole(ID, ' You do not have enough money ', RGB(251,102,1));
end;
 
if regExpMatch('^/(buy clu|buy clusters)$', Text) then begin
 If Money[ID] >= ClustersPrice then begin
 Money[ID] := Money[ID] - ClustersPrice ;
 SpawnObject(GetPlayerStat(ID,'x'),GetPlayerStat(ID,'y'),22);  // DONE
 WriteConsole(ID, ' You just bought Clusters, now have $' + IntToStr(Money[ID]), RGB(251,102,1));
 end else WriteConsole(ID, ' You do not have enough money ', RGB(251,102,1));
end;
 
if regExpMatch('^/(buy vest|buy bulletproof)$', Text) then begin
 If Money[ID] >= VestPrice then begin
 Money[ID] := Money[ID] - VestPrice ;
 SpawnObject(GetPlayerStat(ID,'x'),GetPlayerStat(ID,'y'),19); // DONE
 WriteConsole(ID, ' You just bought Clusters, now have $' + IntToStr(Money[ID]), RGB(251,102,1));
 end else WriteConsole(ID, ' You do not have enough money ', RGB(251,102,1));
end;
 
if regExpMatch('^/(buy pred|buy predator)$', Text) then begin
 if Money[ID] >= PredPrice then begin
 Money[ID] := Money[ID] - PredPrice ;
 GiveBonus(ID, 1);                                                  // DONE
 WriteConsole(ID, ' You just bought a Pred Kit, now have $' + IntToStr(Money[ID]), RGB(251,102,1));
 end else WriteConsole(ID, ' You do not have enough money ', RGB(251,102,1));
end;
 
 if regExpMatch('^/(buy flammer)$', Text) then begin
 if Money[ID] >= FlammerPrice then begin
 Money[ID] := Money[ID] - FlammerPrice;
 SpawnObject(GetPlayerStat(ID,'x'),GetPlayerStat(ID,'y'),18); // DONE
 WriteConsole(ID, ' You just bought a Flammer, now have $' + IntToStr(Money[ID]), RGB(251,102,1));
 end else WriteConsole(ID, ' You do not have enough money ', RGB(251,102,1));         
end;

If regExpMatch('^/(shop|prices|buylist|help)$', Text) then begin
 WriteConsole(ID, ' /char - See current char info ', RGB(251,102,1));
 WriteConsole(ID, ' /buy nades - Buy grenades for $' + IntToStr(NadesPrice), RGB(251,117,1));
 WriteConsole(ID, ' /buy medic|health|med - Buy medic for $' + IntToStr(MedicPrice), RGB(251,132,1));
 WriteConsole(ID, ' /buy clu|clusters - Buy clusters nades for $' + IntToStr(ClustersPrice), RGB(251,147,1));
 WriteConsole(ID, ' /buy vest|bulletproof - Buy a bulletproof vest for $' + IntToStr(VestPrice), RGB(251,162,1));
 WriteConsole(ID, ' /buy pred|predator - Buy a pred kit for $' + IntToStr(PredPrice), RGB(251,177,1));
 WriteConsole(ID, ' /buy flammer - buy a flammer for $' + IntToStr(FlammerPrice), RGB(251,192,1));
end;
end;

procedure AppOnIdle(Ticks: cardinal);
Var
i: byte;
begin
 For i := 1 to 32 do
  if (Ticks mod (60* 30) = 0) then begin
    if spammer = true then
    WriteConsole(i, ' Write /help or /shop for more informations ', RGB(251,102,1));
  end;
end;
« Last Edit: June 12, 2009, 08:15:47 am by VinceBros »

Offline demoniac93

  • Veteran
  • *****
  • Posts: 1554
Re: Looking for a couple of scripts
« Reply #10 on: June 12, 2009, 08:20:52 am »
Ok thanks, it's a bit late but maybe now that it's done we might implement it. Thank you very much.
b&

Offline ~Niko~

  • Rainbow Warrior
  • *****
  • Posts: 2410
Re: Looking for a couple of scripts
« Reply #11 on: June 12, 2009, 08:36:38 am »
replace

Code: [Select]
procedure AppOnIdle(Ticks: cardinal);
Var
i: byte;
begin
 For i := 1 to 32 do
  if (Ticks mod (60* 30) = 0) then begin
    if spammer = true then
    WriteConsole(i, ' Write /help or /shop for more informations ', RGB(251,102,1));
  end;
end;

by

Code: [Select]
procedure AppOnIdle(Ticks: cardinal);
begin
   if spammer = true then begin
      if (Ticks mod (60* 90) = 0) then
      WriteConsole(0, ' Write /help or /shop for more informations ', RGB(251,102,1));
     end;
end;

There's no need to show the message to 32 players, make it send to every one, instead. Also sending the message each 30 secons would spam the console a lot.
« Last Edit: June 12, 2009, 08:45:27 am by ~Niko~ »

Offline VinceBros

  • Soldat Beta Team
  • Camper
  • ******
  • Posts: 275
Re: Looking for a couple of scripts
« Reply #12 on: June 12, 2009, 08:41:14 am »
Oh yeah, i don't why i added arrays O.o. I was tired i guess
Edit : Put space when you script. It's like it was hellomynameisvince
It's not fun to read

Offline ~Niko~

  • Rainbow Warrior
  • *****
  • Posts: 2410
Re: Looking for a couple of scripts
« Reply #13 on: June 12, 2009, 08:44:56 am »
I wrote it down in plain text editor, so i couldn't use tab...

fixed

Offline VinceBros

  • Soldat Beta Team
  • Camper
  • ******
  • Posts: 275
Re: Looking for a couple of scripts
« Reply #14 on: June 12, 2009, 08:46:26 am »
Oh ok, but it's alrite. If someone copy/paste it's as good as with spaces :P
Just for some people who wants to edit. But it's not our case now :P

Offline demoniac93

  • Veteran
  • *****
  • Posts: 1554
Re: Looking for a couple of scripts
« Reply #15 on: June 12, 2009, 09:01:11 am »
Ok thanks, sent the admin the new form, gonna try it later.
b&