Author Topic: Leveling & EP script in developmnet for 2.6.0  (Read 6498 times)

0 Members and 1 Guest are viewing this topic.

Offline Avarax

  • Veteran
  • *****
  • Posts: 1529
    • Official Hexer & MMod site
Re: Leveling & EP script in developmnet for 2.6.0
« Reply #40 on: August 01, 2007, 03:11:12 pm »
lock please.
I like to have one Martini
Two at the very most
Three I'm under the table
Four I'm under the host

Offline coolhunt

  • Major(1)
  • Posts: 25
Re: Leveling & EP script in developmnet for 2.6.0
« Reply #41 on: August 01, 2007, 10:11:11 pm »
what is false?

folder:
soldat/scripts

levels.pas :
Code: [Select]
const
//Teams
ALPHA = 1;
BRAVO = 2;
CHARLIE = 3;
DELTA = 4;
SPECTATOR = 5;
HP_PER_LEVEL = 200;
MAX_LVL = 10;
EP_PER_LEVEL = 100;
//Game Modes
DEATHMATCH = 0;
POINTMATCH = 1;
TEAMMATCH = 2;
CTF = 3;
RAMBO = 4;
INF = 5;
HTF = 6;
//Weapons
  DEAGLES = 1;
  HKMP5 = 2;
  AK74 = 3;
  STEYR = 4;
  SPAS = 5;
  RUGER = 6;
  M79 = 7;
  BARRET = 8;
  MINIMI = 9;
  MINIGUN = 10;
  FLAMER = 11;
  BOW = 12;
  FLAMEBOW = 13;
  SOCOM = 0;
  KNIFE = 14;
  CHAINSAW = 15;
  LAW = 16;

SERVER =255 ;

type tplayer = record
                 name: string;
                 ep,level,maxhp: integer;
               end;

var soldier: array[1..32]  of tplayer;

function GetEP(Killer,Victim:string): integer;
var KID,VID,multiplier,lvldif,EP: integer;
begin
  KID:=NametoID(Killer);
  VID:=NametoID(Victim);
  lvldif:=soldier[VID].level-soldier[KID].level;
  multiplier:=100 + 10 * lvldif;
  If multiplier<40 then
    multiplier:=40;
  EP:=1000 + (soldier[VID].level * EP_PER_LEVEL * multiplier DIV 100);
  Result:=EP;
end;

function MaxEP(ID: integer): integer;
begin
  Result:=2200 + (soldier[ID].level * 2000) + (soldier[ID].level * soldier[ID].level * 200);
end;

{procedure Heal(ID,percent,absolute: intteger);
begin
  DoDamage(ID,(-1) * soldier.[ID].maxhp * percentage DIV 100 - absolute);
end;}
 
 

procedure GainLvl(ID: integer);
begin
  soldier[ID].level:=soldier[ID].level+1;
  Command('say ' + IDtoName(ID) + ' reached Level ' + inttostr(soldier[ID].level));
  soldier[ID].maxhp:=4000 + HP_PER_LEVEL * soldier[ID].level;
  //Heal(ID,100,0);
end;

procedure ActivateServer();
begin
end;

procedure AppOnIdle(Ticks: integer);
begin
end;

procedure OnCommand(ID: integer;Text: string);
begin
end;

function OnRequestGame(IP: string;State: integer):integer;
begin
Result := State;
end;

procedure OnJoinGame(IP, Nickname: string;Team: byte);
begin
end;

procedure OnJoinTeam(IP, Nickname: string;Team: byte);
var i,JID,temp: integer;
begin
  temp:=0;
  JID:=IPtoID(IP);
  soldier[JID].level:=1;
  If NumPlayers > 1 then   
    begin
      for i:=1 to 32 do
        If soldier[i].level > temp then
          temp:=soldier[i].level;
      soldier[JID].level:=temp;
    end;
  soldier[JID].ep:=1;
  soldier[JID].maxhp:=4000;
  soldier[JID].name:=nickname;
end;

procedure OnLeaveGame(IP, Nickname: string;Team: byte);
begin
end;

procedure OnFlagGrab(ID: integer;TeamFlag: byte;GrabbedInBase: boolean);
begin
end;

procedure OnFlagReturn(ID: integer;TeamFlag: byte);
begin
end;

procedure OnFlagScore(ID: integer;TeamFlag: byte);
begin
end;

procedure OnPlayerKill(Killer,Victim,Weapon: string);
var EP,KID,VID: integer;
begin
  KID:=NametoID(Killer);
  VID:=NametoID(Victim);
  If KID=VID then
    begin
      If soldier[KID].ep > 1000 + soldier[KID].level * EP_PER_LEVEL then
        soldier[KID].ep:=soldier[KID].ep - (1000 + soldier[KID].level * EP_PER_LEVEL)
      else
        soldier[KID].ep:=0;
    end
  else
    begin
      EP:=GetEP(Killer,Victim);
      soldier[KID].ep:=soldier[KID].ep + EP;
      If soldier[KID].ep >= MaxEP(KID) then
        begin
          If soldier[KID].level >= MAX_LVL then
          else
            GainLvl(KID);
        end;
    end;             
end;

procedure OnPlayerRespawn(ID: integer);
begin
end;

procedure OnPlayerSpeak(Name,Text: string);
begin
end;

procedure OnAdminConnect(IP: string);
begin
end;

procedure OnAdminDisconnect(IP: string);
begin
end;

procedure OnAdminMessage(IP, Msg: string);
begin
end;


procedure OnException(ErrorMessage: string);
begin
//  WriteFile('ErrorLog.txt', ErrorMessage);
end;

function OnPlayerCommand(ID: Byte; Text: string): boolean;
begin
  //NOTE: This function will be called when [_ANY_] player types a / command.
  Result := false; //Return true if you want disable the command typed.
end;

procedure OnWeaponChange(ID, PrimaryNum, SecondaryNum: byte);
begin
end;

function OnPlayerDamage(Victim, Shooter: byte; Damage: integer): integer;
begin
  // Victim = Player Damaged // Shooter = Player doing the damage
  result := Damage;
end;

and yes i have done it into the includes.txt

need help
« Last Edit: August 02, 2007, 05:12:45 am by coolhunt »
www.dieteam.de.vu

soldat : 192.168.5.27 : 23073

Offline miketh2005

  • Soldat Beta Team
  • Flagrunner
  • ******
  • Posts: 668
  • What's the URL for www.microsoft.com?
Re: Leveling & EP script in developmnet for 2.6.0
« Reply #42 on: August 02, 2007, 11:11:25 am »
Do you have to change anything in this script, like i run a mod server and there is alot of kills, how would you lower the amount of EP you get for each kill?
Quote from: 'Ando.' pid='12999178' dateline='1309046898'
My new password is secure as shit :)
Mate, I am not sure Shit is even secured nowadays.

Offline coolhunt

  • Major(1)
  • Posts: 25
Re: Leveling & EP script in developmnet for 2.6.0
« Reply #43 on: August 02, 2007, 01:55:08 pm »
something is wrong i didnt level up

Date Posted: August 02, 2007, 02:49:54 PM
or can anyone send it me
(email or icq or msn
msn : master-cool@hotmail.de
icq: 261721288
email : master-cool@hotmail.de
forum : dieteam.de.vu
www.dieteam.de.vu

soldat : 192.168.5.27 : 23073

Offline miketh2005

  • Soldat Beta Team
  • Flagrunner
  • ******
  • Posts: 668
  • What's the URL for www.microsoft.com?
Re: Leveling & EP script in developmnet for 2.6.0
« Reply #44 on: August 13, 2007, 03:11:14 pm »
anyone?
Quote from: 'Ando.' pid='12999178' dateline='1309046898'
My new password is secure as shit :)
Mate, I am not sure Shit is even secured nowadays.

Offline King_Of_Pain

  • Major
  • *
  • Posts: 73
  • Buy tickets to a Police concert. Now.
Re: Leveling & EP script in developmnet for 2.6.0
« Reply #45 on: August 15, 2007, 05:39:27 pm »
This thread is very outdated, lock please.