Author Topic: Help to place these part in this script .  (Read 1900 times)

0 Members and 1 Guest are viewing this topic.

Offline mich1103

  • Flagrunner
  • ****
  • Posts: 557
  • Did you say chocolate ? O.o
    • ZoMbIe-DeStRoYeR pk server
Help to place these part in this script .
« on: July 06, 2010, 09:18:27 am »
I create another threads about this because no one was helping me on the other !
First : If you're gonna say that i need to learn .Im gonna say that there is no page of help about placing script part in order !
Second : If you're not gonna help . don't say anything

At this threads there is all the part !
http://forums.soldat.pl/index.php?topic=38411.0

There is my shop script !
Code: [Select]
const
Color = $FF00FF00; //Color to be used.
psgpowa = 1;
psgtype = 14;
psgrang = 666;
psgspee = 75;
maxpsg = 10;
PlainTextColour=$FF00FF00;
psgammo = 85;

var
  NewBossName:string;
  pname: string;
  money: array[1..32] of integer;
  statcost:integer;
  giveid:integer;
  psgcost:integer;
  give,ammount,player:string;
  sgx,sgy:array[1..maxpsg] of single;
  sga,sgo,sgt:array[1..maxpsg] of byte;
  sgd:array[1..maxpsg] of boolean;
  invcost,medcost,nadecost,flamecost,vestcost,serkcost,clustcost,powercost,eaglecost: integer;
  mp5cost,ak47cost,augcost,spascost,rugecost,m79cost,barrcost,minimcost,minigcost, allcost: integer;
 

procedure placesentry(x,y:single;ID,team:byte);
var n,f:byte;
begin
if getplayerstat(ID,'Ground')=true then begin
f:=maxpsg;
for n:=1 to maxpsg do begin
if sgd[n]=true then f:=f-1;
end;
if f=0 then DrawText(ID,'Maximum of '+inttostr(maxpsg)+' sentry guns on map reached.',250,RGB(0,255,0),0.10,150,400) else begin
for n:=1 to maxpsg do begin
if sgd[n]=false then break;
end;
sgx[n]:=x; sgy[n]:=y; sgo[n]:=ID; sgt[n]:=team; sga[n]:=psgammo; sgd[n]:=true;
DrawText(ID,'Sentry gun placed!',250,RGB(0,255,0),0.1,75,350);
end;
end else DrawText(ID,'You are in mid-air!',250,RGB(0,255,0),0.10,220,400);
end;
 
 
 procedure SummonRandomBotBoss();
begin
  case Random(1,6) of // note that Random(1, 6) can return 1-5, but not 6!
    1: NewBossName:='CoWbOy ZoMbIe';
    2: NewBossName:='GlAdIaTor ZoMbIe';
    3: NewBossName:='SpArTaAa ZoMbIe';
    4: NewBossName:='ViRuS ZoMbIe';
    5: NewBossName:='WTF ZoMbIe';
  end;
  Command('/addbot2 '+NewBossName);
  WriteConsole(0, NewBossName+' has been summoned! Kill him for reward!', PlainTextColour);
end;



procedure CheckBotBoss(Victim:byte);
begin
// assume that bot name is the same as bot file name
  if (IdToName(Victim)=NewBossName) then begin
    Command('/kick '+NewBossName);
    WriteConsole(0, NewBossName+' has been defited!', PlainTextColour);
  end;
end;


procedure InitScript();
begin
  NewBossName:=''; // never forget to initialize all your variables!!!
end;


procedure ActivateServer();
  begin
    InitScript();
    statcost        := 25;
    psgcost         := 30;
    invcost         := 9;
    medcost         := 6;
    nadecost        := 6;
    flamecost       := 12;
    vestcost        := 7;
    serkcost        := 9;
    clustcost       := 8;
    powercost       := 18;
    eaglecost       := 9;
    mp5cost         := 9;
    ak47cost        := 10;
    augcost         := 10;
    spascost        := 10;
    rugecost        := 9;
    m79cost         := 12;
    barrcost        := 14;
    minimcost       := 11;
    minigcost       := 10;
    allcost         := 25;
  end;


procedure OnJoinGame(ID, Team: byte);

var
   asd : string;

  begin
if FileExists('scripts/shop/'+ GetPlayerStat(ID,'IP') + '.txt') then begin 
asd := ReadFile('scripts/shop/'+ GetPlayerStat(ID,'IP') + '.txt'); 
  money[ID] := StrToInt(Copy(asd,0,length(asd)-2)); 
 writeConsole(ID, 'Your Money is: $' + inttostr(money[ID]),Color);
    writeConsole(ID, 'Do /shop to see the shop, do /money to see your money !', Color);
 end else money[ID] := 0 
end; 






procedure OnPlayerKill(Killer, Victim: byte;Weapon: string);
begin
if Killer <> Victim then
begin
if (IdToName(victim) = 'ZoMbIe')
then begin
money[Killer] := money[Killer]+1;
writeConsole(Killer, 'You just got 1$ for killing a ZoMbIe ! your money is now :' + inttostr(money[Killer]), Color);
end;         
   
if (IdToName(victim) = 'CoWbOy ZoMbIe')
then begin
money[Killer] := money[Killer]+10;
writeConsole(Killer, 'You just got 10$ for killing CoWbOy ZoMbIe ! your money is now :' + inttostr(money[Killer]), Color);
end;         
 
    if (IdToName(victim) = 'WTF ZoMbIe')
then begin
money[Killer] := money[Killer]+30;
writeConsole(Killer, 'You just got 30$ for killing WTF ZoMbIe ! your money is now :' + inttostr(money[Killer]), Color);
end;

    if (IdToName(victim) = 'GlAdIaTor ZoMbIe')
then begin
money[Killer] := money[Killer]+15;
writeConsole(Killer, 'You just got 15$ for killing GlAdIaToR ZoMbIe ! your money is now :' + inttostr(money[Killer]), Color);
end;
   
if (IdToName(victim) = 'ViRuS ZoMbIe')
then begin
money[Killer] := money[Killer]+25;
writeConsole(Killer, 'You just got 25$ for killing ViRuS ZoMbIe! your money is now :' + inttostr(money[Killer]), Color);
end;

    if (IdToName(victim) = 'SpArTaAa ZoMbIe')
then begin
money[Killer] := money[Killer]+20;
writeConsole(Killer, 'You just got 20$ for killing SpArTaAa ZoMbIe ! your money is now :' + inttostr(money[Killer]), Color);
end;
CheckBotBoss(Victim);
end else begin
writeConsole(Killer,'you cant kill yourself for money !', Color);
end;
end;



procedure OnFlagScore(ID, TeamFlag: byte);
      begin
        money[ID] := money[ID]+10;
        writeConsole(ID,'you just got 10$ for scoring ! your money is now :' + inttostr(money[ID]), Color);
end;




function OnPlayerCommand(ID: Byte; Text: string): boolean;
  begin



  give := GetPiece(LowerCase(Text), ' ', 0);
  ammount := GetPiece(LowerCase(Text), ' ', 1);
  player := GetPiece(Text, ' ', 2);
  if give = '/give' then
    begin
      if money[ID] > strtoint(ammount) then
        begin
          giveid := NameToID(player);

          if giveid > 0 then
            begin
              money[ID] := money[ID] - strtoint(ammount);
              money[giveid] := money[giveid] + strtoint(ammount);
              writeconsole(ID, 'You gave $' + ammount + ' to: ' + IDToName(giveid) + ', Your money is now: $' + inttostr(money[ID]) , Color);
              writeconsole(giveid, 'You recived $' + ammount + ' from: ' + IDToName(ID) + ', Your money is now: $' + inttostr(money[giveid]), Color);
            end else
              begin
                writeconsole(ID, 'That person does not exist at all !', Color);
              end;

        end else
        begin
          writeconsole(ID, 'You dont have enough money', Color);
        end;

    end;







    if regExpMatch('^/(money|moneys)$', Text) then
      begin
        writeConsole(ID, 'Your money is: $' + inttostr(money[ID]), Color);
     end;



    if regExpMatch('^/(commands|shop|spawn|help)$', Text) then
      begin
        writeConsole(ID, '#############SHOP#########################', Color);
        writeConsole(ID, '#commands:                               #', Color);
        writeConsole(ID, '#/stat $25 (spawn a turret)              #', Color);
        writeConsole(ID, '#/psg $30 (Spawn a sentry gun)           #', Color);
        writeConsole(ID, '#/inv  $9(Give you the invisibility)     #', Color);
        writeConsole(ID, '#/med $6 (Give you a medic kit)          #', Color);
        writeConsole(ID, '#/nade $6 (Give to you some nade)        #', Color);
        writeConsole(ID, '#/flame $12 (Give you a flamer)          #', Color);
        writeConsole(ID, '#/vest $7 (Give you a Bullet proof)      #', Color);
        writeConsole(ID, '#/serk $9 (Give you the RAGE !!!)        #', Color);
        writeConsole(ID, '#/clust $8 (Give you some cluster)       #', Color);
        writeConsole(ID, '#/power $18 (Spawn all bonus above you)  #', Color);
        writeConsole(ID, '#/eagle $7 (Give you a Desert Eagle)     #', Color);
        writeConsole(ID, '#/mp5 $9 (Give you a Hk mp5)             #', Color);
        writeConsole(ID, '#/ak47 $10 (Give you a Ak 47)            #', Color);
        writeConsole(ID, '#/aug $10 (Give you a Steyr AUG)         #', Color);
        writeConsole(ID, '#/spas $10 (Give you a spas 12)          #', Color);
        writeConsole(ID, '#/ruger $9 (Give you a Ruger)            #', Color);
        writeConsole(ID, '#/m79 $12 (Give you a m79)               #', Color);
        writeConsole(ID, '#/barr $14 (Give you a Barret)           #', Color);
        writeConsole(ID, '#/minim $11 (Give you a FN minimi)       #', Color);
        writeConsole(ID, '#/minig $10 (Give you a Minigun)         #', Color);
        writeConsole(ID, '#/guns 25(Spawn all gun above you)       #', Color);
        writeConsole(ID, '#############END##########################', Color);
      end;





if regExpMatch('^/(stationary|stat|turrent)$', Text) then
  begin
      if money[ID] >= statcost then
        begin
          money[ID] := money[ID] - statcost;
          SpawnObject(GetPlayerStat(ID,'x')+20,GetPlayerStat(ID,'y')-20,15);
          writeconsole(ID, 'You bought a Stat Gun for $25, you have $' + inttostr(money[ID]), Color);

        end else begin writeconsole(ID, 'You do not have enough money', Color);
      end;
  end;
  result := false;






if regExpMatch('^/(psg)$', Text) then begin
      if money[ID] >= psgcost then begin
          money[ID] := money[ID] - psgcost;
         placesentry(getplayerstat(ID,'x'),getplayerstat(ID,'y'),ID,getplayerstat(ID,'team'));
          writeconsole(ID, 'You bought a Sentry Gun for $30, you have $' + inttostr(money[ID]), Color);
        end else begin writeconsole(ID, 'You do not have enough money', Color);
    end;
end;


  if regExpMatch('^/(desert eagles|eagle|deagles|deserteagles)$', Text) then
    begin
      if money[ID] >= eaglecost then
        begin
          money[ID] := money[ID] - eaglecost;
          forceWeapon(ID,1,GetPlayerStat(ID,'Primary'),0);
          writeconsole(ID, 'You bought deagles for $9, you have $' + inttostr(money[ID]), Color);

        end else begin writeconsole(ID, 'You do not have enough money', Color); end;
    end;

  if regExpMatch('^/(hkmp5|mp5|hk)$', Text) then
    begin
      if money[ID] >= mp5cost then
        begin
          money[ID] := money[ID] - mp5cost;
          forceWeapon(ID,2,GetPlayerStat(ID,'Primary'),0);
          writeconsole(ID, 'You bought a HK MP5 for $9, you have $' + inttostr(money[ID]), Color);

        end else begin writeconsole(ID, 'You do not have enough money', Color); end;

    end;

  if regExpMatch('^/(ak47)$', Text) then
    begin
      if money[ID] >= ak47cost then
        begin
          money[ID] := money[ID] - ak47cost;
          forceWeapon(ID,3,GetPlayerStat(ID,'Primary'),0);
          writeconsole(ID, 'You bought a AK47 for $10, you have $' + inttostr(money[ID]), Color);

        end else begin writeconsole(ID, 'You do not have enough money', Color); end;

    end;

  if regExpMatch('^/(steyr|aug)$', Text) then
    begin
      if money[ID] >= augcost then
        begin
          money[ID] := money[ID] - augcost;
          forceWeapon(ID,4,GetPlayerStat(ID,'Primary'),0);
          writeconsole(ID, 'You bought a Steyr Aug for $10, you have $' + inttostr(money[ID]), Color);

        end else begin writeconsole(ID, 'You do not have enough money', Color); end;

    end;

  if regExpMatch('^/(spas 12|spas|spas12)$', Text) then
    begin
      if money[ID] >= spascost then
        begin
          money[ID] := money[ID] - spascost;
          forceWeapon(ID,5,GetPlayerStat(ID,'Primary'),0);
          writeconsole(ID, 'You bought a SPAS12 for $10, you have $' + inttostr(money[ID]), Color);

        end else begin writeconsole(ID, 'You do not have enough money', Color); end;

    end;

  if regExpMatch('^/(ruger|ruge|ruger77)$', Text) then
    begin
      if money[ID] >= rugecost then
        begin
          money[ID] := money[ID] - rugecost;
          forceWeapon(ID,6,GetPlayerStat(ID,'Primary'),0);
          writeconsole(ID, 'You bought a Ruger for $9, you have $' + inttostr(money[ID]), Color);

        end else begin writeconsole(ID, 'You do not have enough money', Color); end;

    end;

  if regExpMatch('^/(m79)$', Text) then
    begin
      if money[ID] >= m79cost then
        begin
          money[ID] := money[ID] - m79cost;
          forceWeapon(ID,7,GetPlayerStat(ID,'Primary'),0);
          writeconsole(ID, 'You bought a M79 for $12, you have $' + inttostr(money[ID]), Color);

        end else begin writeconsole(ID, 'You do not have enough money', Color); end;
    end;

  if regExpMatch('^/(barreta|barr|barrett m82a1|barret|barret m)$', Text) then
    begin
      if money[ID] >= barrcost then
        begin
          money[ID] := money[ID] - barrcost;
          forceWeapon(ID,8,GetPlayerStat(ID,'Primary'),0);
          writeconsole(ID, 'You bought a Barreta for $14, you have $' + inttostr(money[ID]), Color);

        end else begin writeconsole(ID, 'You do not have enough money', Color); end;
    end;

  if regExpMatch('^/(fn minimi|minim|fn)$', Text) then
    begin
      if money[ID] >= minimcost then
        begin
          money[ID] := money[ID] - minimcost;
          forceWeapon(ID,9,GetPlayerStat(ID,'Primary'),0);
          writeconsole(ID, 'You bought a FN Minimi for $11, you have $' + inttostr(money[ID]), Color);

        end else begin writeconsole(ID, 'You do not have enough money', Color); end;
    end;

  if regExpMatch('^/(minigun|minig)$', Text) then
    begin
      if money[ID] >= minigcost then
        begin
          money[ID] := money[ID] - minigcost;
          forceWeapon(ID,10,GetPlayerStat(ID,'Primary'),0);
          writeconsole(ID, 'You bought a Minigun for $10, you have $' + inttostr(money[ID]), Color);

        end else begin writeconsole(ID, 'You do not have enough money', Color); end;
    end;


  if regExpMatch('^/(medic|med|health|med pack)$', Text) then
    begin
      if money[ID] >= medcost then
        begin
          money[ID] := money[ID] - medcost;
          SpawnObject(GetPlayerStat(ID,'x')+20,GetPlayerStat(ID,'y')-20,16);
          writeconsole(ID, 'You bought a Medkit for $6, you have $' + inttostr(money[ID]), Color);

        end else begin writeconsole(ID, 'You do not have enough money', Color); end;
    end;

  if regExpMatch('^/(grenade|nade)$', Text) then
    begin
      if money[ID] >= nadecost then
        begin
          money[ID] := money[ID] - nadecost;
          SpawnObject(GetPlayerStat(ID,'x')+20,GetPlayerStat(ID,'y')-20,17);
          writeconsole(ID, 'You bought some Grenades for $6, you have $' + inttostr(money[ID]), Color);

        end else begin writeconsole(ID, 'You do not have enough money', Color); end;
    end;

  if regExpMatch('^/(cluster|clust|clustergrandes|clusternades|clustnades)$', Text) then
    begin
      if money[ID] >= clustcost then
        begin
          money[ID] := money[ID] - clustcost;
          SpawnObject(GetPlayerStat(ID,'x')+20,GetPlayerStat(ID,'y')-20,22);
          writeconsole(ID, 'You bought some Cluster Greanades for $8, you have $' + inttostr(money[ID]), Color);

        end else begin writeconsole(ID, 'You do not have enough money', Color); end;
    end;

  if regExpMatch('^/(armor|vest|bulletproofvest)$', Text) then
    begin
      if money[ID] >= vestcost then
        begin
          money[ID] := money[ID] - vestcost;
          SpawnObject(GetPlayerStat(ID,'x')+20,GetPlayerStat(ID,'y')-20,19);
          writeconsole(ID, 'You bought a Bullet Proof Vest for $7, you have $' + inttostr(money[ID]), Color);

        end else begin writeconsole(ID, 'You do not have enough money', Color); end;
    end;


  if regExpMatch('^/(boxes|power|box)$', Text) then
    begin
      if money[ID] >= powercost then
        begin
          money[ID] := money[ID] - powercost;
          SpawnObject(GetPlayerStat(ID,'x')+20,GetPlayerStat(ID,'y')-20,16);
          SpawnObject(GetPlayerStat(ID,'x')+30,GetPlayerStat(ID,'y')-20,17);
          SpawnObject(GetPlayerStat(ID,'x')+40,GetPlayerStat(ID,'y')-20,18);
          SpawnObject(GetPlayerStat(ID,'x')+50,GetPlayerStat(ID,'y')-20,19);
          SpawnObject(GetPlayerStat(ID,'x')+60,GetPlayerStat(ID,'y')-20,20);
          SpawnObject(GetPlayerStat(ID,'x')+70,GetPlayerStat(ID,'y')-20,21);
          SpawnObject(GetPlayerStat(ID,'x')+80,GetPlayerStat(ID,'y')-20,22);
          writeconsole(ID, 'You bought all Powerups for $18, you have $' + inttostr(money[ID]), Color);

        end else begin writeconsole(ID, 'You do not have enough money', Color); end;

    end;

  if regExpMatch('^/(preditor|inv|invisible)$', Text) then
    begin
      if money[ID] >= invcost then
        begin
          money[ID] := money[ID] - invcost;
          SpawnObject(GetPlayerStat(ID,'x')+20,GetPlayerStat(ID,'y')-20,20);
          writeconsole(ID, 'You bought a Preditor Box for $9, you have $' + inttostr(money[ID]), Color);

        end else begin writeconsole(ID, 'You do not have enough money', Color); end;
    end;

  if regExpMatch('^/(flame god|flame|flamegodmode|flame god mode)$', Text) then
    begin
      if money[ID] >= flamecost then
        begin
          money[ID] := money[ID] - flamecost;
          SpawnObject(GetPlayerStat(ID,'x')+20,GetPlayerStat(ID,'y')-20,18);
          writeconsole(ID, 'You bought a Flame God Box for $12, you have $' + inttostr(money[ID]), Color);

        end else begin writeconsole(ID, 'You do not have enough money', Color); end;
    end;

  if regExpMatch('^/(berseker|serk)$', Text) then
    begin
      if money[ID] >= serkcost then
        begin
          money[ID] := money[ID] - serkcost;
          SpawnObject(GetPlayerStat(ID,'x')+20,GetPlayerStat(ID,'y')-20,21);
          writeconsole(ID, 'You bought a Berseker Box for $9, you have $' + inttostr(money[ID]), Color);

        end else begin writeconsole(ID, 'You do not have enough money', Color); end;
    end;



if regExpMatch('^/(gunz|guns|weapons|weaps|weps)$', Text) then
    begin
      if money[ID] >= allcost then
        begin
          money[ID] := money[ID] - allcost;
          SpawnObject(GetPlayerStat(ID,'x')+20,GetPlayerStat(ID,'y')-20,1);
          SpawnObject(GetPlayerStat(ID,'x')+30,GetPlayerStat(ID,'y')-20,2);
          SpawnObject(GetPlayerStat(ID,'x')+40,GetPlayerStat(ID,'y')-20,3);
          SpawnObject(GetPlayerStat(ID,'x')+50,GetPlayerStat(ID,'y')-20,4);
          SpawnObject(GetPlayerStat(ID,'x')+60,GetPlayerStat(ID,'y')-20,5);
          SpawnObject(GetPlayerStat(ID,'x')+70,GetPlayerStat(ID,'y')-20,6);
          SpawnObject(GetPlayerStat(ID,'x')+80,GetPlayerStat(ID,'y')-20,7);
          SpawnObject(GetPlayerStat(ID,'x')-20,GetPlayerStat(ID,'y')-20,8);
          SpawnObject(GetPlayerStat(ID,'x')-30,GetPlayerStat(ID,'y')-20,9);
          SpawnObject(GetPlayerStat(ID,'x')-40,GetPlayerStat(ID,'y')-20,10);
          SpawnObject(GetPlayerStat(ID,'x')-50,GetPlayerStat(ID,'y')-20,11);
          SpawnObject(GetPlayerStat(ID,'x')-60,GetPlayerStat(ID,'y')-20,12);
          SpawnObject(GetPlayerStat(ID,'x')-70,GetPlayerStat(ID,'y')-20,13);
          SpawnObject(GetPlayerStat(ID,'x')-80,GetPlayerStat(ID,'y')-20,14);
          writeconsole(ID, 'You bought all Weapon for $25, you have $' + inttostr(money[ID]), Color);

        end else begin writeconsole(ID, 'You do not have enough money', Color);
   end;

end;
end;

procedure OnMapChange(newmap:string);
var n:byte;
begin
    command('/kick CoWbOy ZoMbIe');
    command('/kick GlAdIaTor ZoMbIe');
    command('/kick SpArTaAa ZoMbIe');
    command('/kick ViRuS ZoMbIe');
    command('/kick WTF ZoMbIe');
SummonRandomBotBoss();
for n:=1 to maxpsg do begin sgd[n]:=false; end;
end;

procedure OnLeaveGame(ID,team:byte;kicked:boolean);
var n:byte;
begin
for n:=1 to maxpsg do
begin if sgo[n]=ID then sgd[n]:= false;
end;
WriteFile('scripts/shop/'+ GetPlayerStat(ID,'IP') + '.txt',IntToStr(money[ID])); 
end;

Procedure AllDraw();
var
  i:Byte;
begin
  for i := 1 to 32 do if (GetPlayerStat(i,'Active') = true) AND (GetPlayerStat(i,'Human') = true) then
    DrawText(i,'Money: $' + inttostr(Money[i]),65,Color,0.08,15,320);

end;



Procedure AppOnIdle(Ticks: Integer);
 Var N, K: Byte;
  X, Y, Dista: Single;
   Begin
    For N := 1 To maxpsg Do Begin
AllDraw();     
if sgd[n] = True Then Begin
      CreateBullet(sgx[n],sgy[n],0,0,0,5,sgo[n]);
       For K := 1 To 32 Do Begin
        GetPlayerXy(K,X,Y);
         if GetPlayerStat(K,'Team') <> sgt[n] Then if GetPlayerStat(K,'Alive') = True Then if RayCast(sgx[n],sgy[n],x,y,dista,psgrang) = True Then if dista <= psgrang Then Begin
          x := ((x-sgx[n]) / dista)*psgspee;
         y := ((y-sgy[n]) / dista)*psgspee;
          CreateBullet(sgx[n],sgy[n],x,y,psgpowa,psgtype,sgo[n]); sga[n]:=sga[n]-1;
         if sga[n] = 0 Then Begin
      sgd[n] := false;
      Writeconsole(sgo[n],'One of your sentry guns ran out of ammo.',$0000FF00);     
end;
Break;
    end;
   end;
  end;
 end;
end;




procedure OnPlayerSpeak(ID:Byte;Text:String);
begin
if (Text='!money')
      then begin
        writeConsole(ID, 'Your money is: $' + inttostr(money[ID]), Color);
     end;



if(Text='!shop')
      then begin
        writeConsole(ID, '#############SHOP#########################', Color);
        writeConsole(ID, '#commands:                               #', Color);
        writeConsole(ID, '#/stat $25 (spawn a turret)              #', Color);
        writeConsole(ID, '#/psg $30 (Spawn a sentry gun)           #', Color);
        writeConsole(ID, '#/inv  $9(Give you the invisibility)     #', Color);
        writeConsole(ID, '#/med $6 (Give you a medic kit)          #', Color);
        writeConsole(ID, '#/nade $6 (Give to you some nade)        #', Color);
        writeConsole(ID, '#/flame $12 (Give you a flamer)          #', Color);
        writeConsole(ID, '#/vest $7 (Give you a Bullet proof)      #', Color);
        writeConsole(ID, '#/serk $9 (Give you the RAGE !!!)        #', Color);
        writeConsole(ID, '#/clust $8 (Give you some cluster)       #', Color);
        writeConsole(ID, '#/power $18 (Spawn all bonus above you)  #', Color);
        writeConsole(ID, '#/eagle $7 (Give you a Desert Eagle)     #', Color);
        writeConsole(ID, '#/mp5 $9 (Give you a Hk mp5)             #', Color);
        writeConsole(ID, '#/ak47 $10 (Give you a Ak 47)            #', Color);
        writeConsole(ID, '#/aug $10 (Give you a Steyr AUG)         #', Color);
        writeConsole(ID, '#/spas $10 (Give you a spas 12)          #', Color);
        writeConsole(ID, '#/ruger $9 (Give you a Ruger)            #', Color);
        writeConsole(ID, '#/m79 $12 (Give you a m79)               #', Color);
        writeConsole(ID, '#/barr $14 (Give you a Barret)           #', Color);
        writeConsole(ID, '#/minim $11 (Give you a FN minimi)       #', Color);
        writeConsole(ID, '#/minig $10 (Give you a Minigun)         #', Color);
        writeConsole(ID, '#/guns $25(Spawn all gun above you)       #', Color);
        writeConsole(ID, '#############END##########################', Color);
      end;
  end;

I know that there is already a save money part but you can delete it and replace it by the account part !  :D

My problem is with Get piece thing to login and to create an account !

Offline Swompie

  • Camper
  • ***
  • Posts: 390
Re: Help to place these part in this script .
« Reply #1 on: July 06, 2010, 09:26:39 am »
Quote
I know that there is already a save money part but you can delete it
Just delete this part yourself, then paste all the Account related functions into the script. (somewhere above ActivateServer())
You can do it, or do you want to tell us you can't?  :|

After you've done that I'll help you making the login command part with GetPiece.

Offline mich1103

  • Flagrunner
  • ****
  • Posts: 557
  • Did you say chocolate ? O.o
    • ZoMbIe-DeStRoYeR pk server
Re: Help to place these part in this script .
« Reply #2 on: July 06, 2010, 09:47:18 am »
Do i forgot something ?
Code: [Select]
const
Color = $FF00FF00; //Color to be used.
psgpowa = 1;
psgtype = 14;
psgrang = 666;
psgspee = 75;
maxpsg = 10;
PlainTextColour=$FF00FF00;
psgammo = 85;

var
  NewBossName:string;
  pname: string;
  money: array[1..32] of integer;
  statcost:integer;
  giveid:integer;
  psgcost:integer;
  give,ammount,player:string;
  sgx,sgy:array[1..maxpsg] of single;
  sga,sgo,sgt:array[1..maxpsg] of byte;
  sgd:array[1..maxpsg] of boolean;
  invcost,medcost,nadecost,flamecost,vestcost,serkcost,clustcost,powercost,eaglecost: integer;
  mp5cost,ak47cost,augcost,spascost,rugecost,m79cost,barrcost,minimcost,minigcost, allcost: integer;
 

procedure placesentry(x,y:single;ID,team:byte);
var n,f:byte;
begin
if getplayerstat(ID,'Ground')=true then begin
f:=maxpsg;
for n:=1 to maxpsg do begin
if sgd[n]=true then f:=f-1;
end;
if f=0 then DrawText(ID,'Maximum of '+inttostr(maxpsg)+' sentry guns on map reached.',250,RGB(0,255,0),0.10,150,400) else begin
for n:=1 to maxpsg do begin
if sgd[n]=false then break;
end;
sgx[n]:=x; sgy[n]:=y; sgo[n]:=ID; sgt[n]:=team; sga[n]:=psgammo; sgd[n]:=true;
DrawText(ID,'Sentry gun placed!',250,RGB(0,255,0),0.1,75,350);
end;
end else DrawText(ID,'You are in mid-air!',250,RGB(0,255,0),0.10,220,400);
end;
 
 
 procedure SummonRandomBotBoss();
begin
  case Random(1,6) of // note that Random(1, 6) can return 1-5, but not 6!
    1: NewBossName:='CoWbOy ZoMbIe';
    2: NewBossName:='GlAdIaTor ZoMbIe';
    3: NewBossName:='SpArTaAa ZoMbIe';
    4: NewBossName:='ViRuS ZoMbIe';
    5: NewBossName:='WTF ZoMbIe';
  end;
  Command('/addbot2 '+NewBossName);
  WriteConsole(0, NewBossName+' has been summoned! Kill him for reward!', PlainTextColour);
end;



procedure CheckBotBoss(Victim:byte);
begin
// assume that bot name is the same as bot file name
  if (IdToName(Victim)=NewBossName) then begin
    Command('/kick '+NewBossName);
    WriteConsole(0, NewBossName+' has been defited!', PlainTextColour);
  end;
end;


procedure InitScript();
begin
  NewBossName:=''; // never forget to initialize all your variables!!!
end;


Procedure SaveAccount(ID: Byte);
 Var S, AccountFile: String;
  Begin
   AccountFile := 'scripts/'+ScriptName+'/Accounts/'+Player[ID].Name+'.ini';
    if FileExists(AccountFile) Then begin
     S := Chr(13)+Chr(10);
    WriteFile(AccountFile,'[Account]'+S+Player[ID].Password+S+Money[ID]);
   end else WriteConsole(ID,'Account doesnt exists',$FFFFFF);
 end;

Procedure LoadAccount(ID: Byte; Username, Pass: String);
 Var TempAcc: Array of String; AccountFile: String;
  Begin
   AccountFile := 'scripts/'+ScriptName+'/Accounts/'+UserName+'.ini';
    if FileExists(AccountFile) Then Begin
     TempAcc := XSplit(ReadFile(AccountFile),Chr(13)+Chr(10));
Try
     TempAcc[1] := Player[ID].Password;
    TempAcc[2] := StrToInt(Money[ID]);
Except
   WriteConsole(ID,'Error ocurred!',$FFFFFF);
  end;
 end;


Procedure ResetStats(ID: Byte; LoggedIN: Boolean); //LoggedIN should determine if he stays logged in. True = yes.. 
Begin 
 Player[ID].Money := 0; 
Player[ID].Logged := LoggedIN; 
end;

Procedure CreateAccount(ID: Byte; UserName, Pass: String);
 Var AccountFile, S: String;
  Begin
   AccountFile := 'scripts/'+ScriptName+'/Accounts/'+UserName+'.ini';
    if NOT FileExists(AccountFile) Then Begin
     S := Chr(13)+Chr(10);
     WriteFile(AccountFile,'[Account]'+S+Player[ID].Password+S+IntToStr(Money[ID]));
 end else WriteConsole(ID,'Error! Account already exists!',$FFFFFF);
end;



procedure ActivateServer();
  begin
    InitScript();
    statcost        := 25;
    psgcost         := 30;
    invcost         := 9;
    medcost         := 6;
    nadecost        := 6;
    flamecost       := 12;
    vestcost        := 7;
    serkcost        := 9;
    clustcost       := 8;
    powercost       := 18;
    eaglecost       := 9;
    mp5cost         := 9;
    ak47cost        := 10;
    augcost         := 10;
    spascost        := 10;
    rugecost        := 9;
    m79cost         := 12;
    barrcost        := 14;
    minimcost       := 11;
    minigcost       := 10;
    allcost         := 25;
  end;


procedure OnJoinGame(ID, Team: byte);
  begin
  money[ID] :=
 writeConsole(ID, 'Your Money is: $' + inttostr(money[ID]),Color);
    writeConsole(ID, 'Do /shop to see the shop, do /money to see your money !', Color);
 end else money[ID] := 0 
end; 






procedure OnPlayerKill(Killer, Victim: byte;Weapon: string);
begin
if Killer <> Victim then
begin
if (IdToName(victim) = 'ZoMbIe')
then begin
money[Killer] := money[Killer]+1;
writeConsole(Killer, 'You just got 1$ for killing a ZoMbIe ! your money is now :' + inttostr(money[Killer]), Color);
end;         
   
if (IdToName(victim) = 'CoWbOy ZoMbIe')
then begin
money[Killer] := money[Killer]+10;
writeConsole(Killer, 'You just got 10$ for killing CoWbOy ZoMbIe ! your money is now :' + inttostr(money[Killer]), Color);
end;         
 
    if (IdToName(victim) = 'WTF ZoMbIe')
then begin
money[Killer] := money[Killer]+30;
writeConsole(Killer, 'You just got 30$ for killing WTF ZoMbIe ! your money is now :' + inttostr(money[Killer]), Color);
end;

    if (IdToName(victim) = 'GlAdIaTor ZoMbIe')
then begin
money[Killer] := money[Killer]+15;
writeConsole(Killer, 'You just got 15$ for killing GlAdIaToR ZoMbIe ! your money is now :' + inttostr(money[Killer]), Color);
end;
   
if (IdToName(victim) = 'ViRuS ZoMbIe')
then begin
money[Killer] := money[Killer]+25;
writeConsole(Killer, 'You just got 25$ for killing ViRuS ZoMbIe! your money is now :' + inttostr(money[Killer]), Color);
end;

    if (IdToName(victim) = 'SpArTaAa ZoMbIe')
then begin
money[Killer] := money[Killer]+20;
writeConsole(Killer, 'You just got 20$ for killing SpArTaAa ZoMbIe ! your money is now :' + inttostr(money[Killer]), Color);
end;
CheckBotBoss(Victim);
end else begin
writeConsole(Killer,'you cant kill yourself for money !', Color);
end;
end;



procedure OnFlagScore(ID, TeamFlag: byte);
      begin
        money[ID] := money[ID]+10;
        writeConsole(ID,'you just got 10$ for scoring ! your money is now :' + inttostr(money[ID]), Color);
end;




function OnPlayerCommand(ID: Byte; Text: string): boolean;
  begin



  give := GetPiece(LowerCase(Text), ' ', 0);
  ammount := GetPiece(LowerCase(Text), ' ', 1);
  player := GetPiece(Text, ' ', 2);
  if give = '/give' then
    begin
      if money[ID] > strtoint(ammount) then
        begin
          giveid := NameToID(player);

          if giveid > 0 then
            begin
              money[ID] := money[ID] - strtoint(ammount);
              money[giveid] := money[giveid] + strtoint(ammount);
              writeconsole(ID, 'You gave $' + ammount + ' to: ' + IDToName(giveid) + ', Your money is now: $' + inttostr(money[ID]) , Color);
              writeconsole(giveid, 'You recived $' + ammount + ' from: ' + IDToName(ID) + ', Your money is now: $' + inttostr(money[giveid]), Color);
            end else
              begin
                writeconsole(ID, 'That person does not exist at all !', Color);
              end;

        end else
        begin
          writeconsole(ID, 'You dont have enough money', Color);
        end;

    end;







    if regExpMatch('^/(money|moneys)$', Text) then
      begin
        writeConsole(ID, 'Your money is: $' + inttostr(money[ID]), Color);
     end;



    if regExpMatch('^/(commands|shop|spawn|help)$', Text) then
      begin
        writeConsole(ID, '#############SHOP#########################', Color);
        writeConsole(ID, '#commands:                               #', Color);
        writeConsole(ID, '#/stat $25 (spawn a turret)              #', Color);
        writeConsole(ID, '#/psg $30 (Spawn a sentry gun)           #', Color);
        writeConsole(ID, '#/inv  $9(Give you the invisibility)     #', Color);
        writeConsole(ID, '#/med $6 (Give you a medic kit)          #', Color);
        writeConsole(ID, '#/nade $6 (Give to you some nade)        #', Color);
        writeConsole(ID, '#/flame $12 (Give you a flamer)          #', Color);
        writeConsole(ID, '#/vest $7 (Give you a Bullet proof)      #', Color);
        writeConsole(ID, '#/serk $9 (Give you the RAGE !!!)        #', Color);
        writeConsole(ID, '#/clust $8 (Give you some cluster)       #', Color);
        writeConsole(ID, '#/power $18 (Spawn all bonus above you)  #', Color);
        writeConsole(ID, '#/eagle $7 (Give you a Desert Eagle)     #', Color);
        writeConsole(ID, '#/mp5 $9 (Give you a Hk mp5)             #', Color);
        writeConsole(ID, '#/ak47 $10 (Give you a Ak 47)            #', Color);
        writeConsole(ID, '#/aug $10 (Give you a Steyr AUG)         #', Color);
        writeConsole(ID, '#/spas $10 (Give you a spas 12)          #', Color);
        writeConsole(ID, '#/ruger $9 (Give you a Ruger)            #', Color);
        writeConsole(ID, '#/m79 $12 (Give you a m79)               #', Color);
        writeConsole(ID, '#/barr $14 (Give you a Barret)           #', Color);
        writeConsole(ID, '#/minim $11 (Give you a FN minimi)       #', Color);
        writeConsole(ID, '#/minig $10 (Give you a Minigun)         #', Color);
        writeConsole(ID, '#/guns 25(Spawn all gun above you)       #', Color);
        writeConsole(ID, '#############END##########################', Color);
      end;





if regExpMatch('^/(stationary|stat|turrent)$', Text) then
  begin
      if money[ID] >= statcost then
        begin
          money[ID] := money[ID] - statcost;
          SpawnObject(GetPlayerStat(ID,'x')+20,GetPlayerStat(ID,'y')-20,15);
          writeconsole(ID, 'You bought a Stat Gun for $25, you have $' + inttostr(money[ID]), Color);

        end else begin writeconsole(ID, 'You do not have enough money', Color);
      end;
  end;
  result := false;






if regExpMatch('^/(psg)$', Text) then begin
      if money[ID] >= psgcost then begin
          money[ID] := money[ID] - psgcost;
         placesentry(getplayerstat(ID,'x'),getplayerstat(ID,'y'),ID,getplayerstat(ID,'team'));
          writeconsole(ID, 'You bought a Sentry Gun for $30, you have $' + inttostr(money[ID]), Color);
        end else begin writeconsole(ID, 'You do not have enough money', Color);
    end;
end;


  if regExpMatch('^/(desert eagles|eagle|deagles|deserteagles)$', Text) then
    begin
      if money[ID] >= eaglecost then
        begin
          money[ID] := money[ID] - eaglecost;
          forceWeapon(ID,1,GetPlayerStat(ID,'Primary'),0);
          writeconsole(ID, 'You bought deagles for $9, you have $' + inttostr(money[ID]), Color);

        end else begin writeconsole(ID, 'You do not have enough money', Color); end;
    end;

  if regExpMatch('^/(hkmp5|mp5|hk)$', Text) then
    begin
      if money[ID] >= mp5cost then
        begin
          money[ID] := money[ID] - mp5cost;
          forceWeapon(ID,2,GetPlayerStat(ID,'Primary'),0);
          writeconsole(ID, 'You bought a HK MP5 for $9, you have $' + inttostr(money[ID]), Color);

        end else begin writeconsole(ID, 'You do not have enough money', Color); end;

    end;

  if regExpMatch('^/(ak47)$', Text) then
    begin
      if money[ID] >= ak47cost then
        begin
          money[ID] := money[ID] - ak47cost;
          forceWeapon(ID,3,GetPlayerStat(ID,'Primary'),0);
          writeconsole(ID, 'You bought a AK47 for $10, you have $' + inttostr(money[ID]), Color);

        end else begin writeconsole(ID, 'You do not have enough money', Color); end;

    end;

  if regExpMatch('^/(steyr|aug)$', Text) then
    begin
      if money[ID] >= augcost then
        begin
          money[ID] := money[ID] - augcost;
          forceWeapon(ID,4,GetPlayerStat(ID,'Primary'),0);
          writeconsole(ID, 'You bought a Steyr Aug for $10, you have $' + inttostr(money[ID]), Color);

        end else begin writeconsole(ID, 'You do not have enough money', Color); end;

    end;

  if regExpMatch('^/(spas 12|spas|spas12)$', Text) then
    begin
      if money[ID] >= spascost then
        begin
          money[ID] := money[ID] - spascost;
          forceWeapon(ID,5,GetPlayerStat(ID,'Primary'),0);
          writeconsole(ID, 'You bought a SPAS12 for $10, you have $' + inttostr(money[ID]), Color);

        end else begin writeconsole(ID, 'You do not have enough money', Color); end;

    end;

  if regExpMatch('^/(ruger|ruge|ruger77)$', Text) then
    begin
      if money[ID] >= rugecost then
        begin
          money[ID] := money[ID] - rugecost;
          forceWeapon(ID,6,GetPlayerStat(ID,'Primary'),0);
          writeconsole(ID, 'You bought a Ruger for $9, you have $' + inttostr(money[ID]), Color);

        end else begin writeconsole(ID, 'You do not have enough money', Color); end;

    end;

  if regExpMatch('^/(m79)$', Text) then
    begin
      if money[ID] >= m79cost then
        begin
          money[ID] := money[ID] - m79cost;
          forceWeapon(ID,7,GetPlayerStat(ID,'Primary'),0);
          writeconsole(ID, 'You bought a M79 for $12, you have $' + inttostr(money[ID]), Color);

        end else begin writeconsole(ID, 'You do not have enough money', Color); end;
    end;

  if regExpMatch('^/(barreta|barr|barrett m82a1|barret|barret m)$', Text) then
    begin
      if money[ID] >= barrcost then
        begin
          money[ID] := money[ID] - barrcost;
          forceWeapon(ID,8,GetPlayerStat(ID,'Primary'),0);
          writeconsole(ID, 'You bought a Barreta for $14, you have $' + inttostr(money[ID]), Color);

        end else begin writeconsole(ID, 'You do not have enough money', Color); end;
    end;

  if regExpMatch('^/(fn minimi|minim|fn)$', Text) then
    begin
      if money[ID] >= minimcost then
        begin
          money[ID] := money[ID] - minimcost;
          forceWeapon(ID,9,GetPlayerStat(ID,'Primary'),0);
          writeconsole(ID, 'You bought a FN Minimi for $11, you have $' + inttostr(money[ID]), Color);

        end else begin writeconsole(ID, 'You do not have enough money', Color); end;
    end;

  if regExpMatch('^/(minigun|minig)$', Text) then
    begin
      if money[ID] >= minigcost then
        begin
          money[ID] := money[ID] - minigcost;
          forceWeapon(ID,10,GetPlayerStat(ID,'Primary'),0);
          writeconsole(ID, 'You bought a Minigun for $10, you have $' + inttostr(money[ID]), Color);

        end else begin writeconsole(ID, 'You do not have enough money', Color); end;
    end;


  if regExpMatch('^/(medic|med|health|med pack)$', Text) then
    begin
      if money[ID] >= medcost then
        begin
          money[ID] := money[ID] - medcost;
          SpawnObject(GetPlayerStat(ID,'x')+20,GetPlayerStat(ID,'y')-20,16);
          writeconsole(ID, 'You bought a Medkit for $6, you have $' + inttostr(money[ID]), Color);

        end else begin writeconsole(ID, 'You do not have enough money', Color); end;
    end;

  if regExpMatch('^/(grenade|nade)$', Text) then
    begin
      if money[ID] >= nadecost then
        begin
          money[ID] := money[ID] - nadecost;
          SpawnObject(GetPlayerStat(ID,'x')+20,GetPlayerStat(ID,'y')-20,17);
          writeconsole(ID, 'You bought some Grenades for $6, you have $' + inttostr(money[ID]), Color);

        end else begin writeconsole(ID, 'You do not have enough money', Color); end;
    end;

  if regExpMatch('^/(cluster|clust|clustergrandes|clusternades|clustnades)$', Text) then
    begin
      if money[ID] >= clustcost then
        begin
          money[ID] := money[ID] - clustcost;
          SpawnObject(GetPlayerStat(ID,'x')+20,GetPlayerStat(ID,'y')-20,22);
          writeconsole(ID, 'You bought some Cluster Greanades for $8, you have $' + inttostr(money[ID]), Color);

        end else begin writeconsole(ID, 'You do not have enough money', Color); end;
    end;

  if regExpMatch('^/(armor|vest|bulletproofvest)$', Text) then
    begin
      if money[ID] >= vestcost then
        begin
          money[ID] := money[ID] - vestcost;
          SpawnObject(GetPlayerStat(ID,'x')+20,GetPlayerStat(ID,'y')-20,19);
          writeconsole(ID, 'You bought a Bullet Proof Vest for $7, you have $' + inttostr(money[ID]), Color);

        end else begin writeconsole(ID, 'You do not have enough money', Color); end;
    end;


  if regExpMatch('^/(boxes|power|box)$', Text) then
    begin
      if money[ID] >= powercost then
        begin
          money[ID] := money[ID] - powercost;
          SpawnObject(GetPlayerStat(ID,'x')+20,GetPlayerStat(ID,'y')-20,16);
          SpawnObject(GetPlayerStat(ID,'x')+30,GetPlayerStat(ID,'y')-20,17);
          SpawnObject(GetPlayerStat(ID,'x')+40,GetPlayerStat(ID,'y')-20,18);
          SpawnObject(GetPlayerStat(ID,'x')+50,GetPlayerStat(ID,'y')-20,19);
          SpawnObject(GetPlayerStat(ID,'x')+60,GetPlayerStat(ID,'y')-20,20);
          SpawnObject(GetPlayerStat(ID,'x')+70,GetPlayerStat(ID,'y')-20,21);
          SpawnObject(GetPlayerStat(ID,'x')+80,GetPlayerStat(ID,'y')-20,22);
          writeconsole(ID, 'You bought all Powerups for $18, you have $' + inttostr(money[ID]), Color);

        end else begin writeconsole(ID, 'You do not have enough money', Color); end;

    end;

  if regExpMatch('^/(preditor|inv|invisible)$', Text) then
    begin
      if money[ID] >= invcost then
        begin
          money[ID] := money[ID] - invcost;
          SpawnObject(GetPlayerStat(ID,'x')+20,GetPlayerStat(ID,'y')-20,20);
          writeconsole(ID, 'You bought a Preditor Box for $9, you have $' + inttostr(money[ID]), Color);

        end else begin writeconsole(ID, 'You do not have enough money', Color); end;
    end;

  if regExpMatch('^/(flame god|flame|flamegodmode|flame god mode)$', Text) then
    begin
      if money[ID] >= flamecost then
        begin
          money[ID] := money[ID] - flamecost;
          SpawnObject(GetPlayerStat(ID,'x')+20,GetPlayerStat(ID,'y')-20,18);
          writeconsole(ID, 'You bought a Flame God Box for $12, you have $' + inttostr(money[ID]), Color);

        end else begin writeconsole(ID, 'You do not have enough money', Color); end;
    end;

  if regExpMatch('^/(berseker|serk)$', Text) then
    begin
      if money[ID] >= serkcost then
        begin
          money[ID] := money[ID] - serkcost;
          SpawnObject(GetPlayerStat(ID,'x')+20,GetPlayerStat(ID,'y')-20,21);
          writeconsole(ID, 'You bought a Berseker Box for $9, you have $' + inttostr(money[ID]), Color);

        end else begin writeconsole(ID, 'You do not have enough money', Color); end;
    end;



if regExpMatch('^/(gunz|guns|weapons|weaps|weps)$', Text) then
    begin
      if money[ID] >= allcost then
        begin
          money[ID] := money[ID] - allcost;
          SpawnObject(GetPlayerStat(ID,'x')+20,GetPlayerStat(ID,'y')-20,1);
          SpawnObject(GetPlayerStat(ID,'x')+30,GetPlayerStat(ID,'y')-20,2);
          SpawnObject(GetPlayerStat(ID,'x')+40,GetPlayerStat(ID,'y')-20,3);
          SpawnObject(GetPlayerStat(ID,'x')+50,GetPlayerStat(ID,'y')-20,4);
          SpawnObject(GetPlayerStat(ID,'x')+60,GetPlayerStat(ID,'y')-20,5);
          SpawnObject(GetPlayerStat(ID,'x')+70,GetPlayerStat(ID,'y')-20,6);
          SpawnObject(GetPlayerStat(ID,'x')+80,GetPlayerStat(ID,'y')-20,7);
          SpawnObject(GetPlayerStat(ID,'x')-20,GetPlayerStat(ID,'y')-20,8);
          SpawnObject(GetPlayerStat(ID,'x')-30,GetPlayerStat(ID,'y')-20,9);
          SpawnObject(GetPlayerStat(ID,'x')-40,GetPlayerStat(ID,'y')-20,10);
          SpawnObject(GetPlayerStat(ID,'x')-50,GetPlayerStat(ID,'y')-20,11);
          SpawnObject(GetPlayerStat(ID,'x')-60,GetPlayerStat(ID,'y')-20,12);
          SpawnObject(GetPlayerStat(ID,'x')-70,GetPlayerStat(ID,'y')-20,13);
          SpawnObject(GetPlayerStat(ID,'x')-80,GetPlayerStat(ID,'y')-20,14);
          writeconsole(ID, 'You bought all Weapon for $25, you have $' + inttostr(money[ID]), Color);

        end else begin writeconsole(ID, 'You do not have enough money', Color);
   end;

end;
end;

procedure OnMapChange(newmap:string);
var n:byte;
begin
    command('/kick CoWbOy ZoMbIe');
    command('/kick GlAdIaTor ZoMbIe');
    command('/kick SpArTaAa ZoMbIe');
    command('/kick ViRuS ZoMbIe');
    command('/kick WTF ZoMbIe');
SummonRandomBotBoss();
for n:=1 to maxpsg do begin sgd[n]:=false; end;
end;

procedure OnLeaveGame(ID,team:byte;kicked:boolean);
var n:byte;
begin
for n:=1 to maxpsg do
begin if sgo[n]=ID then sgd[n]:= false;
end;
SaveAccount(ID); 
ResetStats(ID); 
end;

Procedure AllDraw();
var
  i:Byte;
begin
  for i := 1 to 32 do if (GetPlayerStat(i,'Active') = true) AND (GetPlayerStat(i,'Human') = true) then
    DrawText(i,'Money: $' + inttostr(Money[i]),65,Color,0.08,15,320);

end;



Procedure AppOnIdle(Ticks: Integer);
 Var N, K: Byte;
  X, Y, Dista: Single;
   Begin
    For N := 1 To maxpsg Do Begin
AllDraw();     
if sgd[n] = True Then Begin
      CreateBullet(sgx[n],sgy[n],0,0,0,5,sgo[n]);
       For K := 1 To 32 Do Begin
        GetPlayerXy(K,X,Y);
         if GetPlayerStat(K,'Team') <> sgt[n] Then if GetPlayerStat(K,'Alive') = True Then if RayCast(sgx[n],sgy[n],x,y,dista,psgrang) = True Then if dista <= psgrang Then Begin
          x := ((x-sgx[n]) / dista)*psgspee;
         y := ((y-sgy[n]) / dista)*psgspee;
          CreateBullet(sgx[n],sgy[n],x,y,psgpowa,psgtype,sgo[n]); sga[n]:=sga[n]-1;
         if sga[n] = 0 Then Begin
      sgd[n] := false;
      Writeconsole(sgo[n],'One of your sentry guns ran out of ammo.',$0000FF00);     
end;
Break;
    end;
   end;
  end;
 end;
end;




procedure OnPlayerSpeak(ID:Byte;Text:String);
begin
if (Text='!money')
      then begin
        writeConsole(ID, 'Your money is: $' + inttostr(money[ID]), Color);
     end;



if(Text='!shop')
      then begin
        writeConsole(ID, '#############SHOP#########################', Color);
        writeConsole(ID, '#commands:                               #', Color);
        writeConsole(ID, '#/stat $25 (spawn a turret)              #', Color);
        writeConsole(ID, '#/psg $30 (Spawn a sentry gun)           #', Color);
        writeConsole(ID, '#/inv  $9(Give you the invisibility)     #', Color);
        writeConsole(ID, '#/med $6 (Give you a medic kit)          #', Color);
        writeConsole(ID, '#/nade $6 (Give to you some nade)        #', Color);
        writeConsole(ID, '#/flame $12 (Give you a flamer)          #', Color);
        writeConsole(ID, '#/vest $7 (Give you a Bullet proof)      #', Color);
        writeConsole(ID, '#/serk $9 (Give you the RAGE !!!)        #', Color);
        writeConsole(ID, '#/clust $8 (Give you some cluster)       #', Color);
        writeConsole(ID, '#/power $18 (Spawn all bonus above you)  #', Color);
        writeConsole(ID, '#/eagle $7 (Give you a Desert Eagle)     #', Color);
        writeConsole(ID, '#/mp5 $9 (Give you a Hk mp5)             #', Color);
        writeConsole(ID, '#/ak47 $10 (Give you a Ak 47)            #', Color);
        writeConsole(ID, '#/aug $10 (Give you a Steyr AUG)         #', Color);
        writeConsole(ID, '#/spas $10 (Give you a spas 12)          #', Color);
        writeConsole(ID, '#/ruger $9 (Give you a Ruger)            #', Color) ;
        writeConsole(ID, '#/m79 $12 (Give you a m79)               #', Color);
        writeConsole(ID, '#/barr $14 (Give you a Barret)           #', Color);
        writeConsole(ID, '#/minim $11 (Give you a FN minimi)       #', Color);
        writeConsole(ID, '#/minig $10 (Give you a Minigun)         #', Color);
        writeConsole(ID, '#/guns $25(Spawn all gun above you)       #', Color);
        writeConsole(ID, '#############END##########################', Color);
      end;
 

if (Text = '/save')Then
begin
SaveAccount(ID); 
end;
 end;

Offline Norbo

  • Camper
  • ***
  • Posts: 338
Re: Help to place these part in this script .
« Reply #3 on: July 06, 2010, 10:59:16 am »
Erm, no offence, but i dont think nobody here wants to go throught all your s**t to find the problem which you dont even bother to explain in detail. Now tell us what exactly the f**k do you want because i dont really understand you. Tell me what you want to do, and ill do it, just to make you shut up. Not flaming or being a complete douchbag here, but im sick of people that post random threads about their scripts and dont specify the problem, especially if they dont speak fluent English. Things like "Do i forgot something" do not tell us what you need to do.

Offline mich1103

  • Flagrunner
  • ****
  • Posts: 557
  • Did you say chocolate ? O.o
    • ZoMbIe-DeStRoYeR pk server
Re: Help to place these part in this script .
« Reply #4 on: July 08, 2010, 08:00:36 am »
I have my shop script .
I have all the account part at this threads .
http://forums.soldat.pl/index.php?topic=38411.0
I want to make a account system who save money !

Offline Norbo

  • Camper
  • ***
  • Posts: 338
Re: Help to place these part in this script .
« Reply #5 on: July 09, 2010, 08:40:36 am »
So you want to basically make an account system, with an feature that can register players, then save their details in a file, together with their money, and then the ability to /login to their account when they come back? Sound pretty simple to me, what do you need help with? What problems are u getting?

Offline mich1103

  • Flagrunner
  • ****
  • Posts: 557
  • Did you say chocolate ? O.o
    • ZoMbIe-DeStRoYeR pk server
Re: Help to place these part in this script .
« Reply #6 on: July 10, 2010, 08:12:42 am »
I've tried by myself but i don't understand the error :
Code: [Select]
shop -> [Error] (80:65): Unknown identifier 'NAME'There is what i did :
Code: [Select]
const
Color = $FF00FF00; //Color to be used.
psgpowa = 1;
psgtype = 14;
psgrang = 666;
psgspee = 75;
maxpsg = 10;
PlainTextColour=$FF00FF00;
psgammo = 85;

var
  NewBossName:string;
  pname: string;
  money: array[1..32] of integer;
  statcost:integer;
  giveid:integer;
  psgcost:integer;
  give,ammount,player:string;
  sgx,sgy:array[1..maxpsg] of single;
  sga,sgo,sgt:array[1..maxpsg] of byte;
  sgd:array[1..maxpsg] of boolean;
  invcost,medcost,nadecost,flamecost,vestcost,serkcost,clustcost,powercost,eaglecost: integer;
  mp5cost,ak47cost,augcost,spascost,rugecost,m79cost,barrcost,minimcost,minigcost, allcost: integer;
 

procedure placesentry(x,y:single;ID,team:byte);
var n,f:byte;
begin
if getplayerstat(ID,'Ground')=true then begin
f:=maxpsg;
for n:=1 to maxpsg do begin
if sgd[n]=true then f:=f-1;
end;
if f=0 then DrawText(ID,'Maximum of '+inttostr(maxpsg)+' sentry guns on map reached.',250,RGB(0,255,0),0.10,150,400) else begin
for n:=1 to maxpsg do begin
if sgd[n]=false then break;
end;
sgx[n]:=x; sgy[n]:=y; sgo[n]:=ID; sgt[n]:=team; sga[n]:=psgammo; sgd[n]:=true;
DrawText(ID,'Sentry gun placed!',250,RGB(0,255,0),0.1,75,350);
end;
end else DrawText(ID,'You are in mid-air!',250,RGB(0,255,0),0.10,220,400);
end;
 
 
 procedure SummonRandomBotBoss();
begin
  case Random(1,6) of // note that Random(1, 6) can return 1-5, but not 6!
    1: NewBossName:='CoWbOy ZoMbIe';
    2: NewBossName:='GlAdIaTor ZoMbIe';
    3: NewBossName:='SpArTaAa ZoMbIe';
    4: NewBossName:='ViRuS ZoMbIe';
    5: NewBossName:='WTF ZoMbIe';
  end;
  Command('/addbot2 '+NewBossName);
  WriteConsole(0, NewBossName+' has been summoned! Kill him for reward!', PlainTextColour);
end;



procedure CheckBotBoss(Victim:byte);
begin
// assume that bot name is the same as bot file name
  if (IdToName(Victim)=NewBossName) then begin
    Command('/kick '+NewBossName);
    WriteConsole(0, NewBossName+' has been defited!', PlainTextColour);
  end;
end;


procedure InitScript();
begin
  NewBossName:=''; // never forget to initialize all your variables!!!
end;


Procedure SaveAccount(ID: Byte);
 Var S, AccountFile: String;
  Begin
   AccountFile := 'scripts/'+ScriptName+'/Accounts/'+Player[ID].Name+'.ini';
    if FileExists(AccountFile) Then begin
     S := Chr(13)+Chr(10);
    WriteFile(AccountFile,'[Account]'+S+Player[ID].Password+S+Money[ID]);
   end else WriteConsole(ID,'Account doesnt exists',$FFFFFF);
 end;

Procedure LoadAccount(ID: Byte; Username, Pass: String);
 Var TempAcc: Array of String; AccountFile: String;
  Begin
   AccountFile := 'scripts/'+ScriptName+'/Accounts/'+UserName+'.ini';
    if FileExists(AccountFile) Then Begin
     TempAcc := XSplit(ReadFile(AccountFile),Chr(13)+Chr(10));
Try
     TempAcc[1] := Player[ID].Password;
    TempAcc[2] := StrToInt(Money[ID]);
Except
   WriteConsole(ID,'Error ocurred!',$FFFFFF);
  end;
 end;


Procedure ResetStats(ID: Byte; LoggedIN: Boolean); //LoggedIN should determine if he stays logged in. True = yes.. 
Begin 
 Player[ID].Money := 0; 
Player[ID].Logged := LoggedIN; 
end;

Procedure CreateAccount(ID: Byte; UserName, Pass: String);
 Var AccountFile, S: String;
  Begin
   AccountFile := 'scripts/'+ScriptName+'/Accounts/'+UserName+'.ini';
    if NOT FileExists(AccountFile) Then Begin
     S := Chr(13)+Chr(10);
     WriteFile(AccountFile,'[Account]'+S+Player[ID].Password+S+IntToStr(Money[ID]));
 end else WriteConsole(ID,'Error! Account already exists!',$FFFFFF);
end;



procedure ActivateServer();
  begin
    InitScript();
    statcost        := 30;
    psgcost         := 40;
    invcost         := 10;
    medcost         := 10;
    nadecost        := 10;
    flamecost       := 10;
    vestcost        := 10;
    serkcost        := 10;
    clustcost       := 10;
    powercost       := 40;
    eaglecost       := 17;
    mp5cost         := 16;
    ak47cost        := 17;
    augcost         := 17;
    spascost        := 18;
    rugecost        := 17;
    m79cost         := 17;
    barrcost        := 18;
    minimcost       := 19;
    minigcost       := 18;
    allcost         := 50;
  end;


procedure OnJoinGame(ID, Team: byte);
  begin
  money[ID] := 0
  writeConsole(ID, 'Say !shop to see the shop, Say !money to see your money !', Color); 
end; 






procedure OnPlayerKill(Killer, Victim: byte;Weapon: string);
begin
if Killer <> Victim then
begin
if (IdToName(victim) = 'ZoMbIe')
then begin
money[Killer] := money[Killer]+1;
writeConsole(Killer, 'You just got 1$ for killing a ZoMbIe ! your money is now :' + inttostr(money[Killer]), Color);
end;         
   
if (IdToName(victim) = 'CoWbOy ZoMbIe')
then begin
money[Killer] := money[Killer]+10;
writeConsole(Killer, 'You just got 10$ for killing CoWbOy ZoMbIe ! your money is now :' + inttostr(money[Killer]), Color);
end;         
 
    if (IdToName(victim) = 'WTF ZoMbIe')
then begin
money[Killer] := money[Killer]+30;
writeConsole(Killer, 'You just got 30$ for killing WTF ZoMbIe ! your money is now :' + inttostr(money[Killer]), Color);
end;

    if (IdToName(victim) = 'GlAdIaTor ZoMbIe')
then begin
money[Killer] := money[Killer]+15;
writeConsole(Killer, 'You just got 15$ for killing GlAdIaToR ZoMbIe ! your money is now :' + inttostr(money[Killer]), Color);
end;
   
if (IdToName(victim) = 'ViRuS ZoMbIe')
then begin
money[Killer] := money[Killer]+25;
writeConsole(Killer, 'You just got 25$ for killing ViRuS ZoMbIe! your money is now :' + inttostr(money[Killer]), Color);
end;

    if (IdToName(victim) = 'SpArTaAa ZoMbIe')
then begin
money[Killer] := money[Killer]+20;
writeConsole(Killer, 'You just got 20$ for killing SpArTaAa ZoMbIe ! your money is now :' + inttostr(money[Killer]), Color);
end;
CheckBotBoss(Victim);
end else begin
writeConsole(Killer,'you cant kill yourself for money !', Color);
end;
end;



procedure OnFlagScore(ID, TeamFlag: byte);
      begin
        money[ID] := money[ID]+10;
        writeConsole(ID,'you just got 10$ for scoring ! your money is now :' + inttostr(money[ID]), Color);
end;




function OnPlayerCommand(ID: Byte; Text: string): boolean;
  begin



  give := GetPiece(LowerCase(Text), ' ', 0);
  ammount := GetPiece(LowerCase(Text), ' ', 1);
  player := GetPiece(Text, ' ', 2);
  if give = '/give' then
    begin
      if money[ID] > strtoint(ammount) then
        begin
          giveid := NameToID(player);

          if giveid > 0 then
            begin
              money[ID] := money[ID] - strtoint(ammount);
              money[giveid] := money[giveid] + strtoint(ammount);
              writeconsole(ID, 'You gave $' + ammount + ' to: ' + IDToName(giveid) + ', Your money is now: $' + inttostr(money[ID]) , Color);
              writeconsole(giveid, 'You recived $' + ammount + ' from: ' + IDToName(ID) + ', Your money is now: $' + inttostr(money[giveid]), Color);
            end else
              begin
                writeconsole(ID, 'That person does not exist at all !', Color);
              end;

        end else
        begin
          writeconsole(ID, 'You dont have enough money', Color);
        end;

    end;

ifGetPiece(Text,' ',0) = '/login'Then begin
  LoadAccount(GetPiece(Text,' ',1),GetPiece(Text,' ',2)); 
end; 



if (Text = '/save')Then
 begin
  SaveAccount(ID); 
 end;




    if regExpMatch('^/(money|moneys)$', Text) then
      begin
        writeConsole(ID, 'Your money is: $' + inttostr(money[ID]), Color);
     end;



    if regExpMatch('^/(commands|shop|spawn|help)$', Text) then
      begin
        writeConsole(ID, '#############SHOP#########################', Color);
        writeConsole(ID, '#commands:                               #', Color);
        writeConsole(ID, '#/stat $30 (spawn a turret)              #', Color);
        writeConsole(ID, '#/psg $40 (Spawn a sentry gun)           #', Color);
        writeConsole(ID, '#/inv  $10(Give you the invisibility)    #', Color);
        writeConsole(ID, '#/med $10 (Give you a medic kit)         #', Color);
        writeConsole(ID, '#/nade $10 (Give to you some nade)       #', Color);
        writeConsole(ID, '#/flame $10 (Give you a flamer)          #', Color);
        writeConsole(ID, '#/vest $10 (Give you a Bullet proof)     #', Color);
        writeConsole(ID, '#/serk $10 (Give you the RAGE !!!)       #', Color);
        writeConsole(ID, '#/clust $10 (Give you some cluster)      #', Color);
        writeConsole(ID, '#/power $40 (Spawn all bonus above you)  #', Color);
        writeConsole(ID, '#/eagle $17 (Give you a Desert Eagle)    #', Color);
        writeConsole(ID, '#/mp5 $16 (Give you a Hk mp5)            #', Color);
        writeConsole(ID, '#/ak47 $17 (Give you a Ak 47)            #', Color);
        writeConsole(ID, '#/aug $17 (Give you a Steyr AUG)         #', Color);
        writeConsole(ID, '#/spas $18 (Give you a spas 12)          #', Color);
        writeConsole(ID, '#/ruger $17 (Give you a Ruger)           #', Color);
        writeConsole(ID, '#/m79 $17 (Give you a m79)               #', Color);
        writeConsole(ID, '#/barr $18 (Give you a Barret)           #', Color);
        writeConsole(ID, '#/minim $19 (Give you a FN minimi)       #', Color);
        writeConsole(ID, '#/minig $18 (Give you a Minigun)         #', Color);
        writeConsole(ID, '#/guns $50(Spawn all gun above you)      #', Color);
        writeConsole(ID, '#############END##########################', Color);
      end;





if regExpMatch('^/(stationary|stat|turrent)$', Text) then
  begin
      if money[ID] >= statcost then
        begin
          money[ID] := money[ID] - statcost;
          SpawnObject(GetPlayerStat(ID,'x')+20,GetPlayerStat(ID,'y')-20,15);
          writeconsole(ID, 'You bought a Stat Gun for $30, you have $' + inttostr(money[ID]), Color);

        end else begin writeconsole(ID, 'You do not have enough money', Color);
      end;
  end;
  result := false;






if regExpMatch('^/(psg)$', Text) then begin
      if money[ID] >= psgcost then begin
          money[ID] := money[ID] - psgcost;
         placesentry(getplayerstat(ID,'x'),getplayerstat(ID,'y'),ID,getplayerstat(ID,'team'));
          writeconsole(ID, 'You bought a Sentry Gun for $50, you have $' + inttostr(money[ID]), Color);
        end else begin writeconsole(ID, 'You do not have enough money', Color);
    end;
end;


  if regExpMatch('^/(desert eagles|eagle|deagles|deserteagles)$', Text) then
    begin
      if money[ID] >= eaglecost then
        begin
          money[ID] := money[ID] - eaglecost;
          forceWeapon(ID,1,GetPlayerStat(ID,'Primary'),0);
          writeconsole(ID, 'You bought deagles for $17, you have $' + inttostr(money[ID]), Color);

        end else begin writeconsole(ID, 'You do not have enough money', Color); end;
    end;

  if regExpMatch('^/(hkmp5|mp5|hk)$', Text) then
    begin
      if money[ID] >= mp5cost then
        begin
          money[ID] := money[ID] - mp5cost;
          forceWeapon(ID,2,GetPlayerStat(ID,'Primary'),0);
          writeconsole(ID, 'You bought a HK MP5 for $16, you have $' + inttostr(money[ID]), Color);

        end else begin writeconsole(ID, 'You do not have enough money', Color); end;

    end;

  if regExpMatch('^/(ak47)$', Text) then
    begin
      if money[ID] >= ak47cost then
        begin
          money[ID] := money[ID] - ak47cost;
          forceWeapon(ID,3,GetPlayerStat(ID,'Primary'),0);
          writeconsole(ID, 'You bought a AK47 for $18, you have $' + inttostr(money[ID]), Color);

        end else begin writeconsole(ID, 'You do not have enough money', Color); end;

    end;

  if regExpMatch('^/(steyr|aug)$', Text) then
    begin
      if money[ID] >= augcost then
        begin
          money[ID] := money[ID] - augcost;
          forceWeapon(ID,4,GetPlayerStat(ID,'Primary'),0);
          writeconsole(ID, 'You bought a Steyr Aug for $17, you have $' + inttostr(money[ID]), Color);

        end else begin writeconsole(ID, 'You do not have enough money', Color); end;

    end;

  if regExpMatch('^/(spas 12|spas|spas12)$', Text) then
    begin
      if money[ID] >= spascost then
        begin
          money[ID] := money[ID] - spascost;
          forceWeapon(ID,5,GetPlayerStat(ID,'Primary'),0);
          writeconsole(ID, 'You bought a SPAS12 for $18, you have $' + inttostr(money[ID]), Color);

        end else begin writeconsole(ID, 'You do not have enough money', Color); end;

    end;

  if regExpMatch('^/(ruger|ruge|ruger77)$', Text) then
    begin
      if money[ID] >= rugecost then
        begin
          money[ID] := money[ID] - rugecost;
          forceWeapon(ID,6,GetPlayerStat(ID,'Primary'),0);
          writeconsole(ID, 'You bought a Ruger for $17, you have $' + inttostr(money[ID]), Color);

        end else begin writeconsole(ID, 'You do not have enough money', Color); end;

    end;

  if regExpMatch('^/(m79)$', Text) then
    begin
      if money[ID] >= m79cost then
        begin
          money[ID] := money[ID] - m79cost;
          forceWeapon(ID,7,GetPlayerStat(ID,'Primary'),0);
          writeconsole(ID, 'You bought a M79 for $17, you have $' + inttostr(money[ID]), Color);

        end else begin writeconsole(ID, 'You do not have enough money', Color); end;
    end;

  if regExpMatch('^/(barreta|barr|barrett m82a1|barret|barret m)$', Text) then
    begin
      if money[ID] >= barrcost then
        begin
          money[ID] := money[ID] - barrcost;
          forceWeapon(ID,8,GetPlayerStat(ID,'Primary'),0);
          writeconsole(ID, 'You bought a Barreta for $18, you have $' + inttostr(money[ID]), Color);

        end else begin writeconsole(ID, 'You do not have enough money', Color); end;
    end;

  if regExpMatch('^/(fn minimi|minim|fn)$', Text) then
    begin
      if money[ID] >= minimcost then
        begin
          money[ID] := money[ID] - minimcost;
          forceWeapon(ID,9,GetPlayerStat(ID,'Primary'),0);
          writeconsole(ID, 'You bought a FN Minimi for $19, you have $' + inttostr(money[ID]), Color);

        end else begin writeconsole(ID, 'You do not have enough money', Color); end;
    end;

  if regExpMatch('^/(minigun|minig)$', Text) then
    begin
      if money[ID] >= minigcost then
        begin
          money[ID] := money[ID] - minigcost;
          forceWeapon(ID,10,GetPlayerStat(ID,'Primary'),0);
          writeconsole(ID, 'You bought a Minigun for $18, you have $' + inttostr(money[ID]), Color);

        end else begin writeconsole(ID, 'You do not have enough money', Color); end;
    end;


  if regExpMatch('^/(medic|med|health|med pack)$', Text) then
    begin
      if money[ID] >= medcost then
        begin
          money[ID] := money[ID] - medcost;
          SpawnObject(GetPlayerStat(ID,'x')+20,GetPlayerStat(ID,'y')-20,16);
          writeconsole(ID, 'You bought a Medkit for $10, you have $' + inttostr(money[ID]), Color);

        end else begin writeconsole(ID, 'You do not have enough money', Color); end;
    end;

  if regExpMatch('^/(grenade|nade)$', Text) then
    begin
      if money[ID] >= nadecost then
        begin
          money[ID] := money[ID] - nadecost;
          SpawnObject(GetPlayerStat(ID,'x')+20,GetPlayerStat(ID,'y')-20,17);
          writeconsole(ID, 'You bought some Grenades for $10, you have $' + inttostr(money[ID]), Color);

        end else begin writeconsole(ID, 'You do not have enough money', Color); end;
    end;

  if regExpMatch('^/(cluster|clust|clustergrandes|clusternades|clustnades)$', Text) then
    begin
      if money[ID] >= clustcost then
        begin
          money[ID] := money[ID] - clustcost;
          SpawnObject(GetPlayerStat(ID,'x')+20,GetPlayerStat(ID,'y')-20,22);
          writeconsole(ID, 'You bought some Cluster Greanades for $10, you have $' + inttostr(money[ID]), Color);

        end else begin writeconsole(ID, 'You do not have enough money', Color); end;
    end;

  if regExpMatch('^/(armor|vest|bulletproofvest)$', Text) then
    begin
      if money[ID] >= vestcost then
        begin
          money[ID] := money[ID] - vestcost;
          SpawnObject(GetPlayerStat(ID,'x')+20,GetPlayerStat(ID,'y')-20,19);
          writeconsole(ID, 'You bought a Bullet Proof Vest for $10, you have $' + inttostr(money[ID]), Color);

        end else begin writeconsole(ID, 'You do not have enough money', Color); end;
    end;


  if regExpMatch('^/(boxes|power|box)$', Text) then
    begin
      if money[ID] >= powercost then
        begin
          money[ID] := money[ID] - powercost;
          SpawnObject(GetPlayerStat(ID,'x')+20,GetPlayerStat(ID,'y')-20,16);
          SpawnObject(GetPlayerStat(ID,'x')+30,GetPlayerStat(ID,'y')-20,17);
          SpawnObject(GetPlayerStat(ID,'x')+40,GetPlayerStat(ID,'y')-20,18);
          SpawnObject(GetPlayerStat(ID,'x')+50,GetPlayerStat(ID,'y')-20,19);
          SpawnObject(GetPlayerStat(ID,'x')+60,GetPlayerStat(ID,'y')-20,20);
          SpawnObject(GetPlayerStat(ID,'x')+70,GetPlayerStat(ID,'y')-20,21);
          SpawnObject(GetPlayerStat(ID,'x')+80,GetPlayerStat(ID,'y')-20,22);
          writeconsole(ID, 'You bought all Powerups for $40, you have $' + inttostr(money[ID]), Color);

        end else begin writeconsole(ID, 'You do not have enough money', Color); end;

    end;

  if regExpMatch('^/(preditor|inv|invisible)$', Text) then
    begin
      if money[ID] >= invcost then
        begin
          money[ID] := money[ID] - invcost;
          SpawnObject(GetPlayerStat(ID,'x')+20,GetPlayerStat(ID,'y')-20,20);
          writeconsole(ID, 'You bought a Preditor Box for $10, you have $' + inttostr(money[ID]), Color);

        end else begin writeconsole(ID, 'You do not have enough money', Color); end;
    end;

  if regExpMatch('^/(flame god|flame|flamegodmode|flame god mode)$', Text) then
    begin
      if money[ID] >= flamecost then
        begin
          money[ID] := money[ID] - flamecost;
          SpawnObject(GetPlayerStat(ID,'x')+20,GetPlayerStat(ID,'y')-20,18);
          writeconsole(ID, 'You bought a Flame God Box for $10, you have $' + inttostr(money[ID]), Color);

        end else begin writeconsole(ID, 'You do not have enough money', Color); end;
    end;

  if regExpMatch('^/(berseker|serk)$', Text) then
    begin
      if money[ID] >= serkcost then
        begin
          money[ID] := money[ID] - serkcost;
          SpawnObject(GetPlayerStat(ID,'x')+20,GetPlayerStat(ID,'y')-20,21);
          writeconsole(ID, 'You bought a Berseker Box for $10, you have $' + inttostr(money[ID]), Color);

        end else begin writeconsole(ID, 'You do not have enough money', Color); end;
    end;



if regExpMatch('^/(gunz|guns|weapons|weaps|weps)$', Text) then
    begin
      if money[ID] >= allcost then
        begin
          money[ID] := money[ID] - allcost;
          SpawnObject(GetPlayerStat(ID,'x')+20,GetPlayerStat(ID,'y')-20,1);
          SpawnObject(GetPlayerStat(ID,'x')+30,GetPlayerStat(ID,'y')-20,2);
          SpawnObject(GetPlayerStat(ID,'x')+40,GetPlayerStat(ID,'y')-20,3);
          SpawnObject(GetPlayerStat(ID,'x')+50,GetPlayerStat(ID,'y')-20,4);
          SpawnObject(GetPlayerStat(ID,'x')+60,GetPlayerStat(ID,'y')-20,5);
          SpawnObject(GetPlayerStat(ID,'x')+70,GetPlayerStat(ID,'y')-20,6);
          SpawnObject(GetPlayerStat(ID,'x')+80,GetPlayerStat(ID,'y')-20,7);
          SpawnObject(GetPlayerStat(ID,'x')-20,GetPlayerStat(ID,'y')-20,8);
          SpawnObject(GetPlayerStat(ID,'x')-30,GetPlayerStat(ID,'y')-20,9);
          SpawnObject(GetPlayerStat(ID,'x')-40,GetPlayerStat(ID,'y')-20,10);
          SpawnObject(GetPlayerStat(ID,'x')-50,GetPlayerStat(ID,'y')-20,11);
          SpawnObject(GetPlayerStat(ID,'x')-60,GetPlayerStat(ID,'y')-20,12);
          SpawnObject(GetPlayerStat(ID,'x')-70,GetPlayerStat(ID,'y')-20,13);
          SpawnObject(GetPlayerStat(ID,'x')-80,GetPlayerStat(ID,'y')-20,14);
          writeconsole(ID, 'You bought all Weapon for $50, you have $' + inttostr(money[ID]), Color);

        end else begin writeconsole(ID, 'You do not have enough money', Color);
   end;

end;
end;

procedure OnMapChange(newmap:string);
var n:byte;
begin
    command('/kick CoWbOy ZoMbIe');
    command('/kick GlAdIaTor ZoMbIe');
    command('/kick SpArTaAa ZoMbIe');
    command('/kick ViRuS ZoMbIe');
    command('/kick WTF ZoMbIe');
SummonRandomBotBoss();
for n:=1 to maxpsg do begin sgd[n]:=false; end;
end;

procedure OnLeaveGame(ID,team:byte;kicked:boolean);
var n:byte;
begin
for n:=1 to maxpsg do
begin if sgo[n]=ID then sgd[n]:= false;
end;
SaveAccount(ID); 
ResetStats(ID); 
end;

Procedure AllDraw();
var
  i:Byte;
begin
  for i := 1 to 32 do if (GetPlayerStat(i,'Active') = true) AND (GetPlayerStat(i,'Human') = true) then
    DrawText(i,'Money: $' + inttostr(Money[i]),65,Color,0.08,15,320);

end;


Function OnPlayerCommand(ID: Byte; Text: String): Boolean;
 Var TempName, TempPass: String;
  Begin
   Text := LowerCase(Text);
    if GetPiece(Text,' ',0) = '/create' Then if GetPiece(Text,' ',2) <> Nil Then Begin //It's quite important to have this, otherwise it could return errors.
    TempName := GetPiece(Text,' ',1);
   TempPass := GetPiece(Text,' ',2);
  CreateAccount(ID,TempName,TempPass);
 end;
end;



Procedure AppOnIdle(Ticks: Integer);
 Var N, K: Byte;
  X, Y, Dista: Single;
   Begin
    For N := 1 To maxpsg Do Begin
AllDraw();     
if sgd[n] = True Then Begin
      CreateBullet(sgx[n],sgy[n],0,0,0,5,sgo[n]);
       For K := 1 To 32 Do Begin
        GetPlayerXy(K,X,Y);
         if GetPlayerStat(K,'Team') <> sgt[n] Then if GetPlayerStat(K,'Alive') = True Then if RayCast(sgx[n],sgy[n],x,y,dista,psgrang) = True Then if dista <= psgrang Then Begin
          x := ((x-sgx[n]) / dista)*psgspee;
         y := ((y-sgy[n]) / dista)*psgspee;
          CreateBullet(sgx[n],sgy[n],x,y,psgpowa,psgtype,sgo[n]); sga[n]:=sga[n]-1;
         if sga[n] = 0 Then Begin
      sgd[n] := false;
      Writeconsole(sgo[n],'One of your sentry guns ran out of ammo.',$0000FF00);     
end;
Break;
    end;
   end;
  end;
 end;
end;




procedure OnPlayerSpeak(ID:Byte;Text:String);
begin
if (Text='!money')
      then begin
        writeConsole(ID, 'Your money is: $' + inttostr(money[ID]), Color);
     end;



if(Text='!shop')
     then begin
        writeConsole(ID, '#############SHOP#########################', Color);
        writeConsole(ID, '#commands:                               #', Color);
        writeConsole(ID, '#/stat $30 (spawn a turret)              #', Color);
        writeConsole(ID, '#/psg $40 (Spawn a sentry gun)           #', Color);
        writeConsole(ID, '#/inv  $10(Give you the invisibility)    #', Color);
        writeConsole(ID, '#/med $10 (Give you a medic kit)         #', Color);
        writeConsole(ID, '#/nade $10 (Give to you some nade)       #', Color);
        writeConsole(ID, '#/flame $10 (Give you a flamer)          #', Color);
        writeConsole(ID, '#/vest $10 (Give you a Bullet proof)     #', Color);
        writeConsole(ID, '#/serk $10 (Give you the RAGE !!!)       #', Color);
        writeConsole(ID, '#/clust $10 (Give you some cluster)      #', Color);
        writeConsole(ID, '#/power $40 (Spawn all bonus above you)  #', Color);
        writeConsole(ID, '#/eagle $17 (Give you a Desert Eagle)    #', Color);
        writeConsole(ID, '#/mp5 $16 (Give you a Hk mp5)            #', Color);
        writeConsole(ID, '#/ak47 $17 (Give you a Ak 47)            #', Color);
        writeConsole(ID, '#/aug $17 (Give you a Steyr AUG)         #', Color);
        writeConsole(ID, '#/spas $18 (Give you a spas 12)          #', Color);
        writeConsole(ID, '#/ruger $17 (Give you a Ruger)           #', Color);
        writeConsole(ID, '#/m79 $17 (Give you a m79)               #', Color);
        writeConsole(ID, '#/barr $18 (Give you a Barret)           #', Color);
        writeConsole(ID, '#/minim $19 (Give you a FN minimi)       #', Color);
        writeConsole(ID, '#/minig $18 (Give you a Minigun)         #', Color);
        writeConsole(ID, '#/guns $50(Spawn all gun above you)      #', Color);
        writeConsole(ID, '#############END##########################', Color);
      end;
 end;

Offline Norbo

  • Camper
  • ***
  • Posts: 338
Re: Help to place these part in this script .
« Reply #7 on: July 10, 2010, 01:04:13 pm »
The problem is here:

AccountFile := 'scripts/'+ScriptName+'/Accounts/'+Player[ID].Name+'.ini';

you dont have a class called Player.

Offline mich1103

  • Flagrunner
  • ****
  • Posts: 557
  • Did you say chocolate ? O.o
    • ZoMbIe-DeStRoYeR pk server
Re: Help to place these part in this script .
« Reply #8 on: July 10, 2010, 01:39:39 pm »
you dont have a class called Player.
I need it ?

Offline kosik231

  • Major
  • *
  • Posts: 70
  • Where can I find Your soul?
Re: Help to place these part in this script .
« Reply #9 on: July 10, 2010, 02:02:47 pm »
ehh, i made it for you PK, here is it, put attached files in your shop folder, all works for me
For signatures, you are allowed only one image in your signature which may not be wider and taller than 300 and 125 pixels, and may not be over 20kB in file size. No BMPs are allowed.

Offline mich1103

  • Flagrunner
  • ****
  • Posts: 557
  • Did you say chocolate ? O.o
    • ZoMbIe-DeStRoYeR pk server
Re: Help to place these part in this script .
« Reply #10 on: July 10, 2010, 02:28:17 pm »
My old script was like that ...  :-\
I said that i want a account system ...
Your gentle but thats not what i want ...  :-\

Offline kosik231

  • Major
  • *
  • Posts: 70
  • Where can I find Your soul?
Re: Help to place these part in this script .
« Reply #11 on: July 10, 2010, 03:07:51 pm »
so... give us all features that you want in account system, i think you mean login/logout commands included... and char stats like on my server...?
For signatures, you are allowed only one image in your signature which may not be wider and taller than 300 and 125 pixels, and may not be over 20kB in file size. No BMPs are allowed.

Offline Norbo

  • Camper
  • ***
  • Posts: 338
Re: Help to place these part in this script .
« Reply #12 on: July 10, 2010, 03:29:54 pm »
you dont have a class called Player.
I need it ?
Yes, obviously you do.

Offline mich1103

  • Flagrunner
  • ****
  • Posts: 557
  • Did you say chocolate ? O.o
    • ZoMbIe-DeStRoYeR pk server
Re: Help to place these part in this script .
« Reply #13 on: July 10, 2010, 03:30:53 pm »
I want people to be able to do
/create username password (to create an account)
/save (to save)
/login username password (to login)
/logout (to logout)
 and i want that when a player left the game that save hes stat !

Offline kosik231

  • Major
  • *
  • Posts: 70
  • Where can I find Your soul?
Re: Help to place these part in this script .
« Reply #14 on: July 12, 2010, 12:16:13 pm »
here you go, i made it, but help with commands make yourself, i think you can do this... all works when i test it...
For signatures, you are allowed only one image in your signature which may not be wider and taller than 300 and 125 pixels, and may not be over 20kB in file size. No BMPs are allowed.

Offline mich1103

  • Flagrunner
  • ****
  • Posts: 557
  • Did you say chocolate ? O.o
    • ZoMbIe-DeStRoYeR pk server
Re: Help to place these part in this script .
« Reply #15 on: July 12, 2010, 02:29:31 pm »
Thanks !  ;D
I'll try it !
but help with commands make yourself, i think you can do this...
Yeah i can do this !