Author Topic: Help [Scriming Server]  (Read 2831 times)

0 Members and 1 Guest are viewing this topic.

Offline Pawi

  • Major(1)
  • Posts: 16
    • BoG Clan Site
Help [Scriming Server]
« on: October 26, 2007, 07:33:37 am »
Hello all!

I've got an idea for great-usable script!

Maybe one of great scripters (^_^) would make this script. The idea is:

- When players type ex: "!Scrim [BoG] -=SoFF=- then:
- from 1 to 3(???) do:
- If Nick = [BoG]* /setteam1
- From 1 to 3(???) do:
- if nick = -=SoFF=-* /setteam2
- else /setteam5

I mean, it have to move one clan to Alpha, second to Beta and rest to Spec. Hope some1 would help me to make it :)

Clans Used is R/S ;P

Offline ghg

  • Camper
  • ***
  • Posts: 411
  • Village Idiot
Re: Help [Scriming Server]
« Reply #1 on: October 26, 2007, 08:20:26 am »
Seems simple enough. I'll have a go.

function OnPlayerCommand(ID: Byte; Text: string): boolean;
var
alpha_tag: string;
bravo_tag: string;
begin
  //NOTE: This function will be called when [_ANY_] player types a / command.
  Result := false; //Return true if you want disable the command typed.
 
  if(GetPiece(Text,' ',0)='!scrim') begin
  Command('/say -=Scrim started!=-');
  Command('/say Scrim script by Gradius wuvz you');
  alpha_tag=GetPiece(Text,' ',1)
  bravo_tag=GetPiece(Text,' ',2)
  //Clear team scores
  SetTeamScore(1,0);
  SetTeamScore(2,0);
 
  for i:=1 to NumPlayers do begin
   if(ContainsString((IDToName(i),alpha_tag)) begin
    Command('/SETTEAM1 '+inttostr(i));
   end else begin
    if(ContainsString((IDToName(i),bravo_tag)) begin
     Command('/SETTEAM2 '+inttostr(i));
    end else begin
     Command('/SETTEAM6 '+inttostr(i));
   end;
   i+=1;
  end;
  end;
end;


You might have to work with it a bit to suit your exact needs.
« Last Edit: October 26, 2007, 08:51:01 am by ghg »
-=Gradius wuz you=-

Offline Pawi

  • Major(1)
  • Posts: 16
    • BoG Clan Site
Re: Help [Scriming Server]
« Reply #2 on: October 26, 2007, 10:10:18 am »
Won't working on 2.6.2 ;(

On 2.6.3 also ;(:(

Code: [Select]
function OnPlayerCommand(ID: Byte; Text: string): boolean;
var
alpha_tag: string;
bravo_tag: string;
begin
  //NOTE: This function will be called when [_ANY_] player types a / command.
  Result := false; //Return true if you want disable the command typed.
 
  if(GetPiece(Text,' ',0)='!scrim') then begin
  Command('/say -=Scrim started!=-');
  Command('/say Scrim script by Gradius wuvz you');
  alpha_tag=GetPiece(Text,' ',1)
  bravo_tag=GetPiece(Text,' ',2)
  //Clear team scores
  SetTeamScore(1,0);
  SetTeamScore(2,0);
 
  for i:=1 to NumPlayers do begin
   if(ContainsString((IDToName(i),alpha_tag)) then begin
    Command('/SETTEAM1 '+inttostr(i));
   end else begin
    if(ContainsString((IDToName(i),bravo_tag)) then begin
     Command('/SETTEAM2 '+inttostr(i));
    end else begin
     Command('/SETTEAM5 '+inttostr(i));
   end;
   i+=1;
  end;
  end;
end;

It's makking error.
(62:12): Assignment expected

Any1 got idea?
« Last Edit: October 26, 2007, 11:03:56 am by Pawi »

Offline Toumaz

  • Veteran
  • *****
  • Posts: 1904
Re: Help [Scriming Server]
« Reply #3 on: October 26, 2007, 11:06:08 am »
Protip: At least make sure your code compiles before posting it.

Code: [Select]
procedure OnPlayerSpeak(ID: byte; Text: string);
var
alpha_tag,bravo_tag: string;
i: byte;
begin
if LowerCase(GetPiece(Text,' ',0))='!scrim' then begin
alpha_tag:=GetPiece(Text,' ',1);
bravo_tag:=GetPiece(Text,' ',2);

for i:=1 to 32 do begin
if GetPlayerStat(i,'active')=false then continue;
if ContainsString(GetPlayerStat(i,'name'),alpha_tag) then
Command('/setteam1 '+inttostr(i))
else if ContainsString(GetPlayerStat(i,'name'),bravo_tag) then
Command('/setteam2 '+inttostr(i))
else
Command('/setteam5 '+inttostr(i));
end;
end;
end;

Offline Pawi

  • Major(1)
  • Posts: 16
    • BoG Clan Site
Re: Help [Scriming Server]
« Reply #4 on: October 26, 2007, 11:18:27 am »
Thanks all a lot xD

BTW, it should become publicated, Because as i know, very much clan's looking about it.

Well, is will be completely, when there is a timer, that wouldn't let 2 scrims at once, and a 5 Min's break after every scrim and some jointeam stoper.

Also a message after starting scrim. Something like
Writeln(Alpha tag, 'VS', bravo_tag); xD

P.S
I've tried to make a messages by:

Code: [Select]
Command('/say Scrim Started!');
Command('/say '+inttostr(alpha_tag));
Command('/say VS');
Command('/say '+inttostr(bravo_tag));

But it won't working ;/

I guess, to won't let 2 scrim's at once, i must make a Variable ex. Scrim_on: Bollean, and make little changes in code, right?

And to block joining the teams, when scriming, the Scrim_On variable must be global? Becose only way is editing OnJoinTeam.

Code: [Select]
procedure OnJoinTeam(ID, Team: byte);
begin
if (GetPlayerStat(ID,'Name') = 'Major') or (MaskCheck(GetPlayerStat(ID,'Name'), 'Major(?)')) or (MaskCheck(GetPlayerStat(ID,'Name'), 'Major(??)')) then begin
WriteConsole(ID,'Please use a unique name',$FF0000);
KickPlayer(ID);
if Scrim_On=true then begin;
command('/setteam5 '+ID);
Command('/say The scrim is going, no Abuse'+inttosrt(ID));
end;
end;

Is it gonna work?
« Last Edit: October 26, 2007, 12:18:05 pm by Pawi »

Offline ghg

  • Camper
  • ***
  • Posts: 411
  • Village Idiot
Re: Help [Scriming Server]
« Reply #5 on: October 26, 2007, 11:51:15 am »
Quote from: Dis wuz probably it
i+=1;
That may be it.
« Last Edit: October 26, 2007, 12:07:54 pm by ghg »
-=Gradius wuz you=-

Offline Pawi

  • Major(1)
  • Posts: 16
    • BoG Clan Site
Re: Help [Scriming Server]
« Reply #6 on: October 26, 2007, 01:59:57 pm »
*** Refreshing ***

Offline ghg

  • Camper
  • ***
  • Posts: 411
  • Village Idiot
Re: Help [Scriming Server]
« Reply #7 on: October 27, 2007, 11:07:38 am »
alpha/bravo_tag are strings, not integers. So why are you trying to convert them with inttostring?

For the scrim thang use: Command('/say '+alpha_tag+' vs '+bravo_tag);
« Last Edit: October 27, 2007, 11:11:29 am by ghg »
-=Gradius wuz you=-

Offline Pawi

  • Major(1)
  • Posts: 16
    • BoG Clan Site
Re: Help [Scriming Server]
« Reply #8 on: October 27, 2007, 11:19:35 am »
Ok, it's working xD

Now only timer, and double-scriming punisher.

Offline ghg

  • Camper
  • ***
  • Posts: 411
  • Village Idiot
Re: Help [Scriming Server]
« Reply #9 on: October 28, 2007, 03:29:28 am »
Also, are you using this from my original code:
//Clear team scores
  SetTeamScore(1,0);
  SetTeamScore(2,0);

???

I think it'd make a fair bit of sense. Unfortunetly I don't know nearly enough to help with timers.
-=Gradius wuz you=-

Offline Toumaz

  • Veteran
  • *****
  • Posts: 1904
Re: Help [Scriming Server]
« Reply #10 on: October 28, 2007, 04:01:08 am »
... or Command('/restart'), but from my experience you usually have the teams pick a map themselves.

Offline ghg

  • Camper
  • ***
  • Posts: 411
  • Village Idiot
Re: Help [Scriming Server]
« Reply #11 on: October 28, 2007, 03:57:52 pm »
Might be interesing to add the map name as an extra parameter.
-=Gradius wuz you=-

Offline Toumaz

  • Veteran
  • *****
  • Posts: 1904
Re: Help [Scriming Server]
« Reply #12 on: October 28, 2007, 04:00:35 pm »
Ugh, getting quite off-topic, but screw it.

Might be interesing to add the map name as an extra parameter.
Which would probably be unnecessary seeing as the teams only need to be balanced once, whereas map changes are usually done  at least twice.

Offline amb2010

  • Camper
  • ***
  • Posts: 264
  • Fear the dot ...
Re: Help [Scriming Server]
« Reply #13 on: October 28, 2007, 11:09:56 pm »
Well I made this today, borrowed some code from here too. Its my first script but hey it works. Made it so just an admin can start the scrim. They would type /scrim (Tag) (Tag) (Map name with the ctf_ inf_ etc....) (Time Limit) (Score Limit) (Password) with out the (). Its very sloppy, anyone better at this can clean up if they feel like spending some time. Ill just attach it.


(Edit: der forgot to attach it  :-\)
And as the lyrics go in the United State's national anthem: "America, f**k YEAH!".

Offline Pawi

  • Major(1)
  • Posts: 16
    • BoG Clan Site
Re: Help [Scriming Server]
« Reply #14 on: October 30, 2007, 03:56:25 am »
Big thanks to amb2010 :)

BTW, you know, I'm playing R/S, so just some more/less function need/unneeded ;P

We're always playing to 10, so the Point Limit is not needed.

First map is always selected by Victims(???), second by looses of first, and is it's 1:1, Thurd map is selected by looses of third ;P

After map select, the second clan can select the sides on map.

So the perfect script should be making it:

!scrim [BoG] -=SoFF=-
*Server* Scrim Started! Fixing Teams:
(Bog to red, soff to blue)
*Server* Teams Fixed. -=SoFF=-, please select you map: (countdown to 120, is map not selected, avoid scrim)
-=SoFF=_ (any1 wifth this tag): !map ctf_ash
*Server* -=SoFFF=- Map: ctf_ash. [BoG], select sides.
[BoG] (any1 wifth it's tag): !red
*Server* Mixing Teams... (if [BoG] in red, don't make anything. Else move to red.)
*Server* Scrim Begins. GL&HF.
<Now players playing scrim ;P>
*Server* [BoG]/-=SoFF=- Wins! It's 1:0/0:1 (Nice tip: The variable called "loser" can be useful to know, who have to take map in next round)
*Server* (loser) map?
(loser) !map ctf_kampf
*Server* (Winers) sides?
(Winers) !Blue (Now arranging teams, same us up)

If it's 1:1, then third map, same as second. At last, a big text at center, who wins, and how much.

Ex.
*Server* -=SoFF=- Wins 2:0!
*Server* Ctf_ash 10:9 on red.
*Server* Ctf_Kampf 10:4 on red.

And the most happyfool thing would be a written the scores to file ex. Scores.txt in Soldatserver.

This script can be the most useful at all, Becose the R/S scene is requesting it from last year. If some1 would have to much free time, please thing about it ;P

Thanks to everyone, who helped or will help xD

I'm not best at scripting, so need some help ;P I can make a little changes, but a big project like this is scaring me xD

Btw, it's unfair, thet forums won't support my clan tag ;P  [B(o) G]. Seems like it cannot be 2 "[" near ;/

I know, it can be anoying, that i'm not making anything, but i realy don't know how ;P I forgot about, that every map can be selected only once on scrim. The useful can be a timer, that making a 5-min pause after every scrim and a Block, that won't allow 2 scrim's at once.
« Last Edit: October 30, 2007, 04:12:27 am by Pawi »

Offline amb2010

  • Camper
  • ***
  • Posts: 264
  • Fear the dot ...
Re: Help [Scriming Server]
« Reply #15 on: October 30, 2007, 02:04:31 pm »
Ok, I think I can do that for you. I'll start working on it this weekend.
And as the lyrics go in the United State's national anthem: "America, f**k YEAH!".

Offline ghg

  • Camper
  • ***
  • Posts: 411
  • Village Idiot
Re: Help [Scriming Server]
« Reply #16 on: October 30, 2007, 04:35:23 pm »
Are you going to bring up a message on join with the likes of "Server running scrim-script by blah blah, blah and blag"?
-=Gradius wuz you=-

Offline Pawi

  • Major(1)
  • Posts: 16
    • BoG Clan Site
Re: Help [Scriming Server]
« Reply #17 on: October 31, 2007, 04:48:31 am »
Of course. Why i won't have to make it, if it won't be my script? I'll always restricted Copyright's ;P

Offline KwS Pall

  • Major(1)
  • Posts: 49
  • I'm going to write Tibia for Soldat
Re: Help [Scriming Server]
« Reply #18 on: October 31, 2007, 01:25:07 pm »
I going to do it at weekend... Should be easy :D

Now Writing...

Already have:
- starting  8)
- team moving
- choosing 1st map
- choosing team : /red or /blue
- starting 1st map
- saving 1st map score
- choose second map
- choose team
- start 2nd map
- save 2nd map score
- summary

last testing...
« Last Edit: November 01, 2007, 08:48:48 am by KwS Pall »
I'm going to write Tibia for Soldat

Offline Pawi

  • Major(1)
  • Posts: 16
    • BoG Clan Site
Re: Help [Scriming Server]
« Reply #19 on: October 31, 2007, 03:09:33 pm »
Wow, it's nice, that 2 peoples gonna work about it so fast. Thx a lot guys ;P