Author Topic: Mich1103's scripting thread  (Read 10198 times)

0 Members and 1 Guest are viewing this topic.

Offline Falcon`

  • Flagrunner
  • ****
  • Posts: 792
  • A wanted lagger
Re: Mich1103's scripting thread
« Reply #120 on: July 27, 2010, 09:22:28 am »
you can move your br variable to constants, and make it
br =  #13+#10;

should work, less confusion
If you're not paying for something, you're not the customer; you're the product being sold.
- Andrew Lewis

Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.

DarkCrusade

  • Guest
Re: Mich1103's scripting thread
« Reply #121 on: July 27, 2010, 09:42:21 am »
You don't need to use #13+#10, #13#10 works, too.

Offline mich1103

  • Flagrunner
  • ****
  • Posts: 557
  • Did you say chocolate ? O.o
    • ZoMbIe-DeStRoYeR pk server
Re: Mich1103's scripting thread
« Reply #122 on: July 27, 2010, 09:45:53 am »
I'll do it later ! now i wanna know why the counter always stay to 100

Offline zyxstand

  • Veteran
  • *****
  • Posts: 1106
  • Mother of all Bombs
Re: Mich1103's scripting thread
« Reply #123 on: July 27, 2010, 10:14:29 am »
Hey, I think your indentations are still wrong.  This is what you have:
Code: [Select]
       if (Soldier[i].GodTime > 0) then begin
        Soldier[i].GodTime := Soldier[i].GodTime - 1;
         if (Soldier[i].GodTime = 0) then WriteConsole(i,'You are mortal again..',$CC0000);
          if (Soldier[i].godcooldown > 0) then begin  // cooldown doesn't start until god-mode is over
   Soldier[i].godcooldown := Soldier[i].godcooldown - 1;
    if (Soldier[i].godcooldown = 0) then WriteConsole(i,'God shield is ready to cast !',$CC0000);
           end;
          end;
         end;

Correct indentation (but still wrong code:
Code: [Select]
       if (Soldier[i].GodTime > 0) then begin
         Soldier[i].GodTime := Soldier[i].GodTime - 1;
         if (Soldier[i].GodTime = 0) then WriteConsole(i,'You are mortal again..',$CC0000);
         if (Soldier[i].godcooldown > 0) then begin  // cooldown doesn't start until god-mode is over
           Soldier[i].godcooldown := Soldier[i].godcooldown - 1;
           if (Soldier[i].godcooldown = 0) then WriteConsole(i,'God shield is ready to cast !',$CC0000);
         end;
       end;

The problem is, you need to keep GodTime separate from godcooldown.  This is the correct code:
Code: [Select]
       if (Soldier[i].GodTime > 0) then begin
         Soldier[i].GodTime := Soldier[i].GodTime - 1;
         if (Soldier[i].GodTime = 0) then WriteConsole(i,'You are mortal again..',$CC0000);
       end;
       if (Soldier[i].godcooldown > 0) then begin  // cooldown doesn't start until god-mode is over
         Soldier[i].godcooldown := Soldier[i].godcooldown - 1;
         if (Soldier[i].godcooldown = 0) then WriteConsole(i,'God shield is ready to cast !',$CC0000);
       end;

In your way, it only does the cooldown if the player is also in god-mode (which is wrong).  notice how the END word i put in mark the end of the if-statement code.
Can't think of anything original to put here...

Offline mich1103

  • Flagrunner
  • ****
  • Posts: 557
  • Did you say chocolate ? O.o
    • ZoMbIe-DeStRoYeR pk server
Re: Mich1103's scripting thread
« Reply #124 on: July 27, 2010, 10:32:54 am »
Thanks it work !  ;D
OFF TOPIC(500 post w00t)

Offline zyxstand

  • Veteran
  • *****
  • Posts: 1106
  • Mother of all Bombs
Re: Mich1103's scripting thread
« Reply #125 on: July 27, 2010, 10:44:26 am »
Congrats!
Don't just use the code - try to understand it!
i also like your spongebob quote ;)
Can't think of anything original to put here...

Offline mich1103

  • Flagrunner
  • ****
  • Posts: 557
  • Did you say chocolate ? O.o
    • ZoMbIe-DeStRoYeR pk server
Re: Mich1103's scripting thread
« Reply #126 on: July 27, 2010, 10:55:27 am »
Congrats!
Don't just use the code - try to understand it!
i also like your spongebob quote ;)

its in left 4 dead 2 !
when coach say Did you say chocolate ?

From: July 27, 2010, 11:23:53 am
So did a new zombie named 'KaMiKaZe ZoMbIe' and i add a script to it !
there is the script :
Code: [Select]
function OnPlayerDamage(Victim,Shooter: Byte;Damage: Integer;Weapon: Byte) : integer;
var
X, Y: single;
 begin
  if GetPlayerStat(Victim,'Name') ='KaMiKaZe ZoMbIe'
   then begin
     GetPlayerXY(Victim, X, Y);
      CreateBullet(X, Y - 10, 0, 0,120, 4, Victim);
       CreateBullet(X, Y - 10, 1, 1,120, 4, Victim);
        CreateBullet(X, Y - 10, 2, 2,120, 4, Victim);
         DoDamage(Victim,4000);
        end;
       end; 


When i join the game it spam me up with that |
                                                                  |
                                                                  v
« Last Edit: July 27, 2010, 11:23:53 am by mich1103 »

DarkCrusade

  • Guest
Re: Mich1103's scripting thread
« Reply #127 on: July 27, 2010, 01:53:05 pm »
Learn to use indentations better. Take this as an example:

Code: (pascal) [Select]
Function OnPlayerDamage(Victim,Shooter:Byte; Damage:Integer; Weapon:Byte):Integer;
var
  X,Y:Single;
begin
  if GetPlayerStat(Victim,'Name') ='KaMiKaZe ZoMbIe' then begin
    GetPlayerXY(Victim, X, Y);
    CreateBullet(X, Y - 10, 0, 0,120, 4, Victim);
    CreateBullet(X, Y - 10, 1, 1,120, 4, Victim);
    CreateBullet(X, Y - 10, 2, 2,120, 4, Victim);
    DoDamage(Victim,4000);
  end;
end; 

2.6.5: Function OnPlayerDamage(Victim,Shooter:Byte; Damage:Integer):Integer;
3.0:   Function OnPlayerDamage(Victim,Shooter:Byte; Damage:Integer; Weapon:Byte):Integer;

You use the wrong server version.

Offline mich1103

  • Flagrunner
  • ****
  • Posts: 557
  • Did you say chocolate ? O.o
    • ZoMbIe-DeStRoYeR pk server
Re: Mich1103's scripting thread
« Reply #128 on: August 06, 2010, 05:18:03 pm »
How can i disable grenade throw for a bot ?

Offline kosik231

  • Major
  • *
  • Posts: 70
  • Where can I find Your soul?
Re: Mich1103's scripting thread
« Reply #129 on: August 06, 2010, 06:47:11 pm »
open bot file and make:
Code: [Select]
Grenade_Frequency=1000that 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: Mich1103's scripting thread
« Reply #130 on: August 07, 2010, 09:43:48 am »
It d'ont work for me ...
they throw grenade ...

Offline kosik231

  • Major
  • *
  • Posts: 70
  • Where can I find Your soul?
Re: Mich1103's scripting thread
« Reply #131 on: August 07, 2010, 12:14:35 pm »
change difficulty of bots to "Stupid" if you have other
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: Mich1103's scripting thread
« Reply #132 on: August 07, 2010, 12:30:34 pm »
currently the bot difficulty is 50 ... i change it to which number ?

Offline kosik231

  • Major
  • *
  • Posts: 70
  • Where can I find Your soul?
Re: Mich1103's scripting thread
« Reply #133 on: August 07, 2010, 01:17:45 pm »
just go to Options in Soldat and change Difficulty to STUPID (mark first dot)
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: Mich1103's scripting thread
« Reply #134 on: August 07, 2010, 07:54:06 pm »
i want to disable grenade throw not ingame for my server !

Offline kosik231

  • Major
  • *
  • Posts: 70
  • Where can I find Your soul?
Re: Mich1103's scripting thread
« Reply #135 on: August 08, 2010, 03:01:45 am »
Code: [Select]
Difficulty=300is that hard to find in Soldat.ini?
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: Mich1103's scripting thread
« Reply #136 on: August 09, 2010, 08:48:29 am »
Thanks !  ;D

I got a problem with the nuke skills ...
i want to put that if a player type nuke
money[ID] := money[ID]-60;
xp[ID] := xp[ID]+30;

but if i do this it loop 32 time so its like
-60X32 money ....
+30X32 xp ...

Nuke skills procedure !
Code: [Select]
procedure Nuke(ID: byte);
 begin
   if GetPlayerStat(ID,'Human') = False
    then begin
     if (GetPlayerStat(ID,'Active') = true)
      then begin
       if (GetPlayerStat(ID,'name') = 'ZoMbIe')
        then begin
        DoDamage(ID,4000);
       end;
      end;
     end;
    end;

Code: [Select]
if regExpMatch('^/(nuke)$', Text) then
 begin
  if (soldier[ID].level >= 45) and (soldier[ID].money >= 60) then
   begin
    For i := 1 to 32 do  begin   
     Nuke(i);
      WriteConsole(i, 'NUCLEAR BOMB !', Color);
     end;
     end else begin
     writeconsole(ID, 'You are not lvl 45 + or you dont have enough money.', Color);
    end;
   end;

Offline kosik231

  • Major
  • *
  • Posts: 70
  • Where can I find Your soul?
Re: Mich1103's scripting thread
« Reply #137 on: August 09, 2010, 09:14:04 am »
put
money[ID] := money[ID]-60;
xp[ID] := xp[ID]+30;

before loop, this should work, btw why you use nuke only for zombie? change "name = zombie" to "team = 2" ^^ this should kill all players from bravo team, also change position of getplayerstat(id,'active') with getplayerstat(id,'human'), rememer, first check active, then next "if" questions because that making laggs
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: Mich1103's scripting thread
« Reply #138 on: August 09, 2010, 09:20:43 am »
Its only for zombie cause this will hurt boss ...
Come on my server !
i have currentrly 11 skills
soldat://soldat.no-ip.ca:23098

Offline kosik231

  • Major
  • *
  • Posts: 70
  • Where can I find Your soul?
Re: Mich1103's scripting thread
« Reply #139 on: August 09, 2010, 09:51:43 am »
i dont have time to play, im still working hard with my script...
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.