Author Topic: Mich1103's scripting thread  (Read 9466 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
Mich1103's scripting thread
« on: July 18, 2010, 08:31:20 am »
This will be where i'll ask my question !
(i don't have question now ...)  :D


I add level and xp in my shop script
how can i detect if Xp is higher to maxXp ?
« Last Edit: July 18, 2010, 10:28:52 am by mich1103 »

DarkCrusade

  • Guest
Re: Mich1103's scripting thread
« Reply #1 on: July 18, 2010, 11:31:17 am »
if (xp >= maxxp) then

Offline zyxstand

  • Veteran
  • *****
  • Posts: 1106
  • Mother of all Bombs
Re: Mich1103's scripting thread
« Reply #2 on: July 18, 2010, 01:06:13 pm »
...oh god

i'm usually for helping people, but when the questions are so elementary, i feel like they need to do a bit of research on their own.

mich: how much programming have you done in soldat scripting?
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 #3 on: July 18, 2010, 01:33:03 pm »
@Dark Crusade : Thanks ! ;D

@zyxstand : You're asking me how many script i did ?

Offline zyxstand

  • Veteran
  • *****
  • Posts: 1106
  • Mother of all Bombs
Re: Mich1103's scripting thread
« Reply #4 on: July 18, 2010, 01:38:15 pm »
that's one way of putting it... i'm just asking because your question seemed very basic for a programmer...
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 #5 on: July 18, 2010, 03:02:23 pm »
@zyxstand : I only have 13 years old and im not native english speaker so i learn scripting very slowly ^^

Offline zyxstand

  • Veteran
  • *****
  • Posts: 1106
  • Mother of all Bombs
Re: Mich1103's scripting thread
« Reply #6 on: July 18, 2010, 03:33:12 pm »
@zyxstand : I only have 13 years old and im not native english speaker so i learn scripting very slowly ^^

i started programming when I was 11.  what language do you speak (French?).
I recommend that you learn programming in another language first. it's hard to program in soldat without knowing the basics.
Try starting with QBASIC. this can help you get some basic programming skills.
READ THIS to help you get started.  QBASIC is very old, but so simple that you can learn programming easily!
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 #7 on: July 19, 2010, 08:12:36 am »
I'm not at homw now so i'll learn this language later !
But how can i detect if a player is level 10 and higher ?
like:

Code: [Select]
Onplayerrespawn
begin
If soldier[ID].level >= 10
then begin GiveBonus(ID,3)
end;
 end;

DarkCrusade

  • Guest
Re: Mich1103's scripting thread
« Reply #8 on: July 19, 2010, 08:14:33 am »
First of all understand what an integer is.

Offline mich1103

  • Flagrunner
  • ****
  • Posts: 557
  • Did you say chocolate ? O.o
    • ZoMbIe-DeStRoYeR pk server
Re: Mich1103's scripting thread
« Reply #9 on: July 21, 2010, 09:41:21 am »
I got a problem with AppOnIdles
because there is no ID in AppOnIdles my script wont work ...

I want to put this in apponidle to make that if a player is lvl 25 and higher and that at each second he got 2% of life ! How can i do this ?
Code: [Select]
if soldier[ID].level >=25
then begin 
   DoDamage(ID,-3);
end;

DarkCrusade

  • Guest
Re: Mich1103's scripting thread
« Reply #10 on: July 21, 2010, 09:47:06 am »
Stop wasting our time here. You don't know the basics of programming. Not even simple stuff like if..else.. 

As you seem to be struggling with the use of Google here is a little help: Link

Work through a tutorial and if you have questions afterwards you may ask here again.

Offline mich1103

  • Flagrunner
  • ****
  • Posts: 557
  • Did you say chocolate ? O.o
    • ZoMbIe-DeStRoYeR pk server
Re: Mich1103's scripting thread
« Reply #11 on: July 21, 2010, 10:01:03 am »
Im learning now !
but its hard cause i dont understand all ... (im French) ...

I think i know the basic now !
@Dark Crusade : you can ask me question if u want !
« Last Edit: July 21, 2010, 10:06:56 am by mich1103 »

DarkCrusade

  • Guest
Re: Mich1103's scripting thread
« Reply #12 on: July 21, 2010, 10:29:45 am »
So tell me what this script does: Link

Offline mich1103

  • Flagrunner
  • ****
  • Posts: 557
  • Did you say chocolate ? O.o
    • ZoMbIe-DeStRoYeR pk server
Re: Mich1103's scripting thread
« Reply #13 on: July 21, 2010, 11:20:23 am »
Code: [Select]
const
  MaxRange = 195;

type
  PlayerStats=Record
  RugerKills:Byte;
  end;

var
  Player:Array[1..32] of PlayerStats;

Procedure TriggerRuger(Killer,Victim:Byte); //i don't understand this procedure ...
var
  X1,Y1,X2,Y2:Single;
  i,j,Team:Byte;
  k:Integer;
begin
  GetPlayerXY(Victim,X1,Y1);
  Team := GetPlayerStat(Victim,'Team');
  repeat
    j := j + 1;
    for i := 1 to 32 do if (GetPlayerStat(i,'Active') = true) AND (GetPlayerStat(i,'Team') <> Team) AND (GetPlayerStat(i,'Alive') = true) then begin
      GetPlayerXY(i,X2,Y2);
      if (Distance(X1,Y1,X2,Y2) <= MaxRange) then begin
        CreateBullet(X2,Y2,0,0,0,5,Killer);
DoDamageBy(i,Killer,20);
k := k + 1;
      end;
    end;
  until(j = Player[Killer].RugerKills);
  WriteConsole(Killer,'You''ve hit ' + IntToStr(k) + ' targets.', $FFFFFF);
end;

Procedure OnPlayerKill(Killer,Victim:Byte; Weapon:String); //add 1 ruger kill to player
begin
  if (Weapon = 'RUGER') then begin
    Player[Killer].RugerKills := Player[Killer].RugerKills + 1;   
    TriggerRuger(Killer,Victim);
  end;
end;

Procedure OnJoinGame(ID,Team:Byte); //put that player did 0 ruger kill
begin
  Player[ID].RugerKills := 0;
end;

Procedure ActivateServer(); //write on the server console that the server started !
begin
  WriteLn('*** SERVER STARTED ***');
end;

DarkCrusade

  • Guest
Re: Mich1103's scripting thread
« Reply #14 on: July 21, 2010, 11:32:27 am »
Fine, you were able to click on my link and paste the code here..

Offline mich1103

  • Flagrunner
  • ****
  • Posts: 557
  • Did you say chocolate ? O.o
    • ZoMbIe-DeStRoYeR pk server
Re: Mich1103's scripting thread
« Reply #15 on: July 21, 2010, 12:00:58 pm »
i know the pascal syntax but the problem is with the soldat scripting !
there is no tutorial about wath i want ...

DarkCrusade

  • Guest
Re: Mich1103's scripting thread
« Reply #16 on: July 21, 2010, 12:21:27 pm »
Link

\o/

Offline zyxstand

  • Veteran
  • *****
  • Posts: 1106
  • Mother of all Bombs
Re: Mich1103's scripting thread
« Reply #17 on: July 21, 2010, 12:31:27 pm »
Fine, you were able to click on my link and paste the code here..

lmao

DC, i think we should cease helping people with too basic questions.  Give them a link to a tutorial or whatnot, and let them do the rest... even though it's hard to let questions go by (and not share your knowledge), it does waste our time - and we don't even get paid :P
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 #18 on: July 21, 2010, 12:34:09 pm »
I did the script by another way !
did you guys have an idea of skills that i should add to my server ?

DarkCrusade

  • Guest
Re: Mich1103's scripting thread
« Reply #19 on: July 21, 2010, 12:35:57 pm »
Derp derp don't think about adding advanced things like skills when you don't understand how Soldat coding works.

@zxy: I always feel the urge to help and I have (right now) enough time to response, so why should I refrain?