Eclipse
January 05, 2009, 04:12:00 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News:
 
   Home   Chat Help Rules Arcade Search Calendar Gallery Login Register  
 
 
 
Recent Topics +-
The New Eclipse Raid on Runscape by The Oracle
Today at 04:11:45 PM

I'm New/Back/Leaving! by The Oracle
Today at 04:08:25 PM

SnowCap by grenegg1
Today at 04:08:24 PM

STOP COMPARING EVERYTHING TO RUNESCAPE by ‪‫‬‭‮‪‫‬‭Admiral Refuge
Today at 04:04:57 PM

New Squiddle Online Tiles ~ Please help make better by >~(Squiddle)~<
Today at 04:04:34 PM

fun with photoshop by ‪‫‬‭‮‪‫‬‭Admiral Refuge
Today at 04:04:19 PM

Sylerean Online Alpha 1.2 Released by James
Today at 04:01:30 PM

Spike's Adminishness! by ‪‫‬‭‮‪‫‬‭Admiral Refuge
Today at 04:00:42 PM

Delete this! by The Oracle
Today at 04:00:27 PM

MUST READ Tutorials!!!!! by The Oracle
Today at 04:00:02 PM

Members Online +-
25 Guests, 31 Users
‪‫‬‭‮‪‫‬‭Admiral Refuge,
azkanan,
Airscar,
The Oracle,
Reguba,
Almighty Wing,
>~(Squiddle)~<,
Munro,
timster0,
Marsh,
ShadowChao,
Zuleloan,
Gwendalin,
franqetesh,
Ambard,
HawkStorm95,
tiggilyboo,
ploxie,
grenegg1,
Hikaru,
Kevin,
Juggernaut,
linetrip,
‪‫‬‭‮‪‫Kusy,
Warconn,
Jarvis ♥ Pie,
Teh Joker,
James,
ralir,
~<Danny>~,
Niko
Pages: [1] 2
  Print  
Author Topic: My Capture the flag script  (Read 2025 times)
0 Members and 1 Guest are viewing this topic.
The Emblem
Uber Programmer
Emblem
Advanced Member
******
Offline Offline

Posts: 517


The game


View Profile Email
« on: April 15, 2006, 11:31:42 AM »

I was bored today so I tried making a capture the flag script.
I am compleatly new to this language (i dont even know what its called)
I thought it might inspire others to edit it and make it work.
Notes:
It Does not work:
  • Very Buggy
  • Untested
  • 100+ Script Errors
  • Im a newb
  • [/list:u]
    Some info you will need to know:
Map 1:Lobby
Map 2:Red Team Waiting Room
Map 3:Blue Waiting Room
Map 4:Red Team Base
Map 5:Blue Team Base
Item 1:Red Bandana (Team Emblem)
Item 2:Blue Bandana
Item 3:Red Flag
Item 4:Blue Flag

Any way well if you want to help me get it to work I would be happy to help  :P
Anyway here is the code: Just look for all the 'TODO: 's to fund out what you need to change.
Code: [Select]

'********************************
'Capture The Flag               *
'********************************
'Capture The Flag was made by:  *
'    Emblem Of Eclips Forums    *
'                               *
'Anyone may use and/or change   *
'This script as long as you     *
'Leave the origional            *
'Author note where it is.       *
'********************************


'********************************
'TODO:Add this to the end of your main file:
'********************************


Sub CTF_Chose_Red(index)
If GetPlayerHelmetSlot(index)=0 Then
 If GetPlayerShieldSlot(index)=0 Then
  If GetVar("CTF.ini", "Settings", "GameOn") = 1 Then
   Call PlayerMsg(index, "There is already a game started.", 14)
   Call PlayerMsg(index, "Please wait untill another game starts.", 14)
   Else
    If GetVar("CTF.ini", "Red", "Players")=5 Then
    Call PlayerMsg(index, "This team is already full.", 14)
    Else
    Call PlayerMsg(index, "You have joined the red team.", 4)
    Call PlayerMsg(index, "Please wait till both teams have 5 players.", 4)
    Call MapMsg(1, GetPlayerName(index)& " has joined the Red team.", 14)
    Call MapMsg(1, GetPlayerName(index)& " has joined the Red team.", 14)
    Call MapMsg(1, GetPlayerName(index)& " has joined the Red team.", 14)
    Call PutVar("CTF.ini", "Red", "Player"& GetVar("CTF.ini", "Red", "Players"), index)
    Call PutVar("CTF.ini", "Red", "Players", int(GetVar("CTF.ini", "Red", "Players"))+1)
   '********************************
    'TODO:Change Red Wait Room Location Here:
    '********************************
    Call SetPlayerMap(index,3)
    Call SetPlayerX(index, 5)
    Call SetPlayery(index, 5)
    '********************************
    'TODO: Set Item Representing Red Team.
    '********************************
    Call SetPlayerInvItemNum(index, 25, 1)
    Call SetPlayerHelmetSlot(index, 25)
    Call CTF_Begin()
   End If
  End If
  Else
  Call PlayerMsg(index, "Please Unequip your sheild to join a team.", 14)
 End If
 Else
 Call PlayerMsg(index, "Please Unequip your Helmet to join a team.", 14)
End If
End Sub


Sub CTF_Chose_Blue(index)
If GetPlayerHelmetSlot(index)=0 Then
 If GetPlayerShieldSlot(index)=0 Then
  If GetVar("CTF.ini", "Settings", "GameOn") = 1 Then
   Call PlayerMsg(index, "There is already a game started.", 14)
   Call PlayerMsg(index, "Please wait untill another game starts.", 14)
   Else
    If GetVar("CTF.ini", "Blue", "Players")=5 Then
    Call PlayerMsg(index, "This team is already full.", 14)
    Else
    Call PlayerMsg(index, "You have joined the blue team.", 1)
    Call PlayerMsg(index, "Please wait till both teams have 5 players.", 1)
    Call MapMsg(1, GetPlayerName(index)& " has joined the blue team.", 14)
    Call MapMsg(2, GetPlayerName(index)& " has joined the blue team.", 14)
    Call MapMsg(3, GetPlayerName(index)& " has joined the blue team.", 14)
    Call PutVar("CTF.ini", "Blue", "Player"& GetVar("CTF.ini", "Blue", "Players"), index)
    Call PutVar("CTF.ini", "Blue", "Players", int(GetVar("CTF.ini", "Blue", "Players"))+1)
    '********************************
    'TODO:Change Blue Wait Room Location Here:
    '********************************
    Call SetPlayerMap(index,2)
    Call SetPlayerX(index, 5)
    Call SetPlayery(index, 5)
    '********************************
    'TODO: Set Item Representing Blue Team.
    '********************************
    Call SetPlayerInvItemNum(index, 25, 2)
    Call SetPlayerHelmetSlot(index, 25)
    Call CTF_Begin()
   End If
  End If
  Else
  Call PlayerMsg(index, "Please Unequip your sheild to join a team.", 14)
 End If
 Else
 Call PlayerMsg(index, "Please Unequip your Helmet to join a team.", 14)
End If
End Sub


Sub CTF_Begin()
Dim tele
tele=1
If GetVar("CTF.ini, "Blue", "Players")=5 Then
 If GetVar("CTF.ini, "Red", "Players")=5 Then
  Call PutVar("CTF.ini", "Settings", "GameOn", 1)
  Do While Int(tele) < 5
   '********************************
   'TODO:Change Red Respawn Location Here:
   '********************************
   Call SetPlayerMap(GetVar("CTF.ini", "Red", "Player"& tele, index), 4)
   Call SetPlayerX(GetVar("CTF.ini", "Red", "Player"& tele, index), 2)
   Call SetPlayery(GetVar("CTF.ini", "Red", "Player"& tele, index), 3+tele)
   tele= tele + 1
  Loop
  tele=1
  Do While Int(tele) < 5
   '********************************
   'TODO:Change Blue Respawn Location Here:
   '********************************
   Call SetPlayerMap(GetVar("CTF.ini", "Blue", "Player"& tele, index), 5)
   Call SetPlayerX(GetVar("CTF.ini", "Blue", "Player"& tele, index), 7)
   Call SetPlayery(GetVar("CTF.ini", "Blue", "Player"& tele, index), 3+tele)
   tele= tele + 1
  Loop
 End If
End If
End Sub

Sub Red_Flag(index)
If GetVar("CTF.ini", "Settings", "RedCapture") = 1 Then
 '********************************
  'TODO:Put red Flag Item #    vvv
 '********************************
  If GetPlayerShieldSlot(index)=3 Then
  SetPlayerInvItemNum(index, 24, 0)
  Call PutVar("CTF.ini", "Settings", "RedCapture", 0)
  Call MapMsg(4, GetPlayerName(index)& " has returned the Red Flag.", 14)
  Call MapMsg(5, GetPlayerName(index)& " has returned the Red Flag.", 14)
  Else
  '********************************
  'TODO:Put Blue Flag Item #   vvv
  '********************************
  If GetPlayerShieldSlot(index)=4 Then
  SetPlayerInvItemNum(index, 24, 0)
  Call PutVar("CTF.ini", "Settings", "BlueCapture", 0)
  Call PutVar("CTF.ini", "Settings", "RedScore", int(GetVar("CTF.ini", "Settings",

"RedScore"))+1)
  Call MapMsg(4, GetPlayerName(index)& " has scored a point for the Red Team.", 14)
  Call MapMsg(5, GetPlayerName(index)& " has scored a point for the Red Team.", 14)
 End If
 Else
 If GetPlayerShieldSlot(index)=0 Then
  '********************************
  'TODO:Put red Flag Item #          vvv
  '********************************
  Call SetPlayerInvItemNum(index, 24, 3)
  Call SetPlayerShieldSlot(index, 24)
  Call PutVar("CTF.ini", "Settings", "RedCapture", 1)
  Call MapMsg(4, GetPlayerName(index)& " has took the Flag from Red Base.", 14)
  Call MapMsg(5, GetPlayerName(index)& " has took the Flag from Red Base.", 14)
 End If
End If
Call CTF_End()
End Sub

Sub Blue_Flag(index)
If GetVar("CTF.ini", "Settings", "BlueCapture") = 1 Then
 '********************************
  'TODO:Put Blue Flag Item #   vvv
 '********************************
  If GetPlayerShieldSlot(index)=4 Then
  SetPlayerInvItemNum(index, 24, 0)
  Call PutVar("CTF.ini", "Settings", "BlueCapture", 0)
  Call MapMsg(4, GetPlayerName(index)& " has returned the Blue Flag.", 14)
  Call MapMsg(5, GetPlayerName(index)& " has returned the Blue Flag.", 14)
  Else
 '********************************
  'TODO:Put Blue Flag Item #    vvv
  '********************************
  If GetPlayerShieldSlot(index)=3 Then
  SetPlayerInvItemNum(index, 24, 0)
  Call PutVar("CTF.ini", "Settings", "RedCapture", 0)
  Call PutVar("CTF.ini", "Settings", "BlueScore", int(GetVar("CTF.ini", "Settings",

"BlueScore"))+1)
  Call MapMsg(4, GetPlayerName(index)& " has scored a point for the Blue Team.", 14)
  Call MapMsg(5, GetPlayerName(index)& " has scored a point for the Blue Team.", 14)
 End If
 Else
 If GetPlayerShieldSlot(index)=0 Then
  '********************************
  'TODO:Put Blue Flag Item #         vvv
  '********************************
  Call SetPlayerInvItemNum(index, 24, 4)
  Call SetPlayerShieldSlot(index, 24)
  Call PutVar("CTF.ini", "Settings", "BlueCapture", 1)
  Call MapMsg(4, GetPlayerName(index)& " has took the Flag from Blue Base.", 14)
  Call MapMsg(5, GetPlayerName(index)& " has took the Flag from Blue Base.", 14)
 End If
End If
Call CTF_End()
End Sub


Sub CTF_End()
If GetVar("CTF.ini", "Settings", "BlueScore")=5 Then
 If If GetVar("CTF.ini", "Settings", "RedScore")=5 Then
 '********************************
 'TODO:Say on every map who won.
 '********************************
 Call MapMsg(1, "Both teams won!", 14)
 Call MapMsg(2, "Both teams won!", 14)
 Call MapMsg(3, "Both teams won!", 14)
 Call MapMsg(4, "Both teams won!", 14)
 Call MapMsg(5, "Both teams won!", 14)
 Call CTF_Exit()
 End If
End If

If GetVar("CTF.ini", "Settings", "BlueScore")=5 Then
 '********************************
 'TODO:Say on every map who won.
 '********************************
 Call MapMsg(4, "Blue team has won!", 4)
 Call MapMsg(5, "Blue team has won!", 4)
 Call MapMsg(2, "Blue team has won!", 4)
 Call MapMsg(3, "Blue team has won!", 4)
 Call MapMsg(1, "Blue team has won!", 4)
 Call CTF_Exit()
End If
If GetVar("CTF.ini", "Settings", "RedScore")=5 Then
 '********************************
 'TODO:Say on every map who won.
 '********************************
 Call MapMsg(4, "Red team has won!", 4)
 Call MapMsg(5, "Red team has won!", 4)
 Call MapMsg(2, "Red team has won!", 4)
 Call MapMsg(3, "Red team has won!", 4)
 Call MapMsg(1, "Red team has won!", 4)
 Call CTF_Exit()
End If
End Sub

Sub CTF_Exit()
Dim tele
tele=1
  Do While Int(tele) < 5
   '********************************
   'TODO:Change Exit Location Here:
   '********************************
   Call SetPlayerMap(GetVar("CTF.ini", "Red", "Player"& tele, index), 4)
   Call SetPlayerX(GetVar("CTF.ini", "Red", "Player"& tele, index), 5)
   Call SetPlayery(GetVar("CTF.ini", "Red", "Player"& tele, index), 5)
   Call SetPlayerInvItemNum(GetVar("CTF.ini", "Red", "Player"& tele, index), 24, 0)
   Call SetPlayerInvItemNum(GetVar("CTF.ini", "Red", "Player"& tele, index), 25, 0)
   Call SetPlayerShieldSlot(GetVar("CTF.ini", "Red", "Player"& tele, index), 24)
   Call SetPlayerHelmetSlot(GetVar("CTF.ini", "Red", "Player"& tele, index), 25)
   tele= tele + 1
  Loop
  tele=1
  Do While Int(tele) < 5
   '********************************
   'TODO:Change Exit Location Here:
   '********************************
   Call SetPlayerMap(GetVar("CTF.ini", "Blue", "Player"& tele, index), 1)
   Call SetPlayerX(GetVar("CTF.ini", "Blue", "Player"& tele, index), 5)
   Call SetPlayery(GetVar("CTF.ini", "Blue", "Player"& tele, index), 5)
   Call SetPlayerInvItemNum(GetVar("CTF.ini", "Blue", "Player"& tele, index), 24, 0)
   Call SetPlayerInvItemNum(GetVar("CTF.ini", "Blue", "Player"& tele, index), 25, 0)
   Call SetPlayerShieldSlot(GetVar("CTF.ini", "Blue", "Player"& tele, index), 24)
   Call SetPlayerHelmetSlot(GetVar("CTF.ini", "Blue", "Player"& tele, index), 25)
   tele= tele + 1
  Loop
  Call PutVar("CTF.ini", "Settings", "GameOn", 0)
  Call PutVar("CTF.ini", "Settings", "RedScore", 0)
  Call PutVar("CTF.ini", "Settings", "BlueScore", 0)
  Call PutVar("CTF.ini", "Settings", "RedCapture", 0)
  Call PutVar("CTF.ini", "Settings", "BlueCapture", 0)
  Call PutVar("CTF.ini", "Red", "Players", 0)
  Call PutVar("CTF.ini", "Red", "Player1", 0)
  Call PutVar("CTF.ini", "Red", "Player2", 0)
  Call PutVar("CTF.ini", "Red", "Player3", 0)
  Call PutVar("CTF.ini", "Red", "Player4", 0)
  Call PutVar("CTF.ini", "Red", "Player5", 0)
  Call PutVar("CTF.ini", "Blue", "Players", 0)
  Call PutVar("CTF.ini", "Blue", "Player1", 0)
  Call PutVar("CTF.ini", "Blue", "Player2", 0)
  Call PutVar("CTF.ini", "Blue", "Player3", 0)
  Call PutVar("CTF.ini", "Blue", "Player4", 0)
  Call PutVar("CTF.ini", "Blue", "Player5", 0)
End Sub

'********************************
'TODO:Add this to the OnDeath Sub
'********************************
'********************************
'TODO:Change Everything here so it works with your maps/items etc.
'********************************
If GetPlayerShieldSlot(index)=3 Then
 Call PutVar("CTF.ini", "Settings", "BlueCapture", 0)
 Call MapMsg(4, "The Blue Flag has returned to its base.", 14)
 Call MapMsg(5, "The Blue Flag has returned to its base.", 14)
End If
If GetPlayerShieldSlot(index)=4 Then
 Call PutVar("CTF.ini", "Settings", "BlueCapture", 0)
 Call MapMsg(4, "The Blue Flag has returned to its base.", 14)
 Call MapMsg(5, "The Blue Flag has returned to its base.", 14)
End If
If GetPlayerHelmetSlot(index)=1 Then
 townx=2
 towny=5
 townmap=4
 Call PlayerWarp(index, Int(townmap), Int(townx), Int(towny) )
End If
If GetPlayerHelmetSlot(index)=2 Then
 townx=10
 towny=5
 townmap=5
 Call PlayerWarp(index, Int(townmap), Int(townx), Int(towny) )
End If
'********************************
'TODO:Add this to the Scripted Tiles
'********************************
'Red Portal:
Case 3
Call CTF_Chose_Red(index)

'Blue Portal:
Case 4
Call CTF_Chose_Blue(index)

'Around Red Flag
Case 5
Call Red_Flag(index)

'Around Blue Flag
Case 6
Call Blue_Flag(index)
michael0987
Active Member
***
Offline Offline

Posts: 218



View Profile Email
« Reply #1 on: April 15, 2006, 11:38:01 PM »

its sound cool but you have fix bugs if there are =p

and i hope its work to you
The Emblem
Uber Programmer
Emblem
Advanced Member
******
Offline Offline

Posts: 517


The game


View Profile Email
« Reply #2 on: April 16, 2006, 08:23:41 AM »

Well do you think you could help me? im used to writing javascript. Like you said i wrote this just for ideas but i would like to make it work :)
Lee_Dragoon
Active Member
***
Offline Offline

Posts: 167



View Profile Email
« Reply #3 on: April 16, 2006, 09:38:44 AM »

Damn thats pretty good, i know java, visual basic .net and html myself, and i wouldn't have gotten that far. I hope someone can help you because that is really awsome. When I get better a scripting I'll let you know, im working on some stuff right now.
Anonymous
Guest


Email
« Reply #4 on: April 16, 2006, 09:41:22 AM »

Thanks a bunch :) Im looking over the code right not trying to find some bugs.
Can someone test it for me? im affraid it might screw up my game  :?
The Emblem
Uber Programmer
Emblem
Advanced Member
******
Offline Offline

Posts: 517


The game


View Profile Email
« Reply #5 on: April 16, 2006, 09:43:16 AM »

Quote from: Anonymous
Thanks a bunch :) Im looking over the code right not trying to find some bugs.
Can someone test it for me? im affraid it might hammer up my game  :?

Sorry that was me :?
And i ment to say im looking over it for bugs right now.
michael
Guest


Email
« Reply #6 on: April 16, 2006, 09:47:15 AM »

try dp there no bugs couse people hate bugs =p
The Emblem
Uber Programmer
Emblem
Advanced Member
******
Offline Offline

Posts: 517


The game


View Profile Email
« Reply #7 on: April 16, 2006, 09:48:22 AM »

Quote from: michael
try dp there no bugs couse people hate bugs =p

Pardon me but DP? sorry in new like i said :?
Sk8erace1
Member
**
Offline Offline

Posts: 67


View Profile WWW Email
« Reply #8 on: September 21, 2007, 07:14:54 PM »

think i may have fixed it ^_^ here ya go

Code: [Select]
'XXXXXXXXXXXXXXXXXXXXXXXXXX
Sub CTF_Chose_Red(index)
'XXXXXXXXXXXXXXXXXXXXXXXXXX
If GetPlayerHelmetSlot(index)=0 Then
 If GetPlayerShieldSlot(index)=0 Then
  If GetVar("CTF.ini", "Settings", "GameOn") = 1 Then
   Call PlayerMsg(index, "There is already a game started.", 14)
   Call PlayerMsg(index, "Please wait untill another game starts.", 14)
   Else
    If GetVar("CTF.ini", "Red", "Players")=5 Then
    Call PlayerMsg(index, "This team is already full.", 14)
    Else
    Call PlayerMsg(index, "You have joined the red team.", 4)
    Call PlayerMsg(index, "Please wait till both teams have 5 players.", 4)
    Call MapMsg(1, GetPlayerName(index)& " has joined the Red team.", 14)
    Call MapMsg(1, GetPlayerName(index)& " has joined the Red team.", 14)
    Call MapMsg(1, GetPlayerName(index)& " has joined the Red team.", 14)
    Call PutVar("CTF.ini", "Red", "Player"& GetVar("CTF.ini", "Red", "Players"), index)
    Call PutVar("CTF.ini", "Red", "Players", int(GetVar("CTF.ini", "Red", "Players"))+1)
   '********************************
    'TODO:Change Red Wait Room Location Here:
    '********************************
    Call SetPlayerMap(index,3)
    Call SetPlayerX(index, 5)
    Call SetPlayery(index, 5)
    '********************************
    'TODO: Set Item Representing Red Team.
    '********************************
    Call SetPlayerInvItemNum(index, 25, 1)
    Call SetPlayerHelmetSlot(index, 25)
    Call CTF_Begin()
   End If
  End If
  Else
  Call PlayerMsg(index, "Please Unequip your sheild to join a team.", 14)
 End If
 Else
 Call PlayerMsg(index, "Please Unequip your Helmet to join a team.", 14)
End If
End Sub

'XXXXXXXXXXXXXXXXXXXXXXXXXXX
Sub CTF_Chose_Blue(index)
'XXXXXXXXXXXXXXXXXXXXXXXXXXXX
If GetPlayerHelmetSlot(index)=0 Then
 If GetPlayerShieldSlot(index)=0 Then
  If GetVar("CTF.ini", "Settings", "GameOn") = 1 Then
   Call PlayerMsg(index, "There is already a game started.", 14)
   Call PlayerMsg(index, "Please wait untill another game starts.", 14)
   Else
    If GetVar("CTF.ini", "Blue", "Players")=5 Then
    Call PlayerMsg(index, "This team is already full.", 14)
    Else
    Call PlayerMsg(index, "You have joined the blue team.", 1)
    Call PlayerMsg(index, "Please wait till both teams have 5 players.", 1)
    Call MapMsg(1, GetPlayerName(index)& " has joined the blue team.", 14)
    Call MapMsg(2, GetPlayerName(index)& " has joined the blue team.", 14)
    Call MapMsg(3, GetPlayerName(index)& " has joined the blue team.", 14)
    Call PutVar("CTF.ini", "Blue", "Player"& GetVar("CTF.ini", "Blue", "Players"), index)
    Call PutVar("CTF.ini", "Blue", "Players", int(GetVar("CTF.ini", "Blue", "Players"))+1)
    '********************************
    'TODO:Change Blue Wait Room Location Here:
    '********************************
    Call SetPlayerMap(index,2)
    Call SetPlayerX(index, 5)
    Call SetPlayery(index, 5)
    '********************************
    'TODO: Set Item Representing Blue Team.
    '********************************
    Call SetPlayerInvItemNum(index, 25, 2)
    Call SetPlayerHelmetSlot(index, 25)
    Call CTF_Begin()
   End If
  End If
  Else
  Call PlayerMsg(index, "Please Unequip your sheild to join a team.", 14)
 End If
 Else
 Call PlayerMsg(index, "Please Unequip your Helmet to join a team.", 14)
End If
End Sub

'XXXXXXXXXXXXXXXXXXXXXXXX
Sub CTF_Begin()
'XXXXXXXXXXXXXXXXXXXXXXXX
Dim tele
tele=1
If GetVar("CTF.ini", "Blue", "Players")=5 Then
 If GetVar("CTF.ini", "Red", "Players")=5 Then
  Call PutVar("CTF.ini", "Settings", "GameOn", 1)
  Do While Int(tele) < 5
   '********************************
   'TODO:Change Red Respawn Location Here:
   '********************************
   Call SetPlayerMap(GetVar("CTF.ini", "Red", "Player"& tele, index), 4)
   Call SetPlayerX(GetVar("CTF.ini", "Red", "Player"& tele, index), 2)
   Call SetPlayery(GetVar("CTF.ini", "Red", "Player"& tele, index), 3+tele)
   tele= tele + 1
  Loop
  tele=1
  Do While Int(tele) < 5
   '********************************
   'TODO:Change Blue Respawn Location Here:
   '********************************
   Call SetPlayerMap(GetVar("CTF.ini", "Blue", "Player"& tele, index), 5)
   Call SetPlayerX(GetVar("CTF.ini", "Blue", "Player"& tele, index), 7)
   Call SetPlayery(GetVar("CTF.ini", "Blue", "Player"& tele, index), 3+tele)
   tele= tele + 1
  Loop
 End If
End If
End Sub

'XXXXXXXXXXXXXXXXXXXXXX
Sub Red_Flag(index)   
'XXXXXXXXXXXXXXXXXXXXXX
If GetVar("CTF.ini", "Settings", "RedCapture") = 1 Then
 '********************************
  'TODO:Put red Flag Item #    vvv
 '********************************
  If GetPlayerShieldSlot(index)=3 Then
  Call SetPlayerInvItemNum(index, 24, 0)
  Call PutVar("CTF.ini", "Settings", "RedCapture", 0)
  Call MapMsg(4, GetPlayerName(index)& " has returned the Red Flag.", 14)
  Call MapMsg(5, GetPlayerName(index)& " has returned the Red Flag.", 14)
  Else
  '********************************
  'TODO:Put Blue Flag Item #   vvv
  '********************************
  If GetPlayerShieldSlot(index)=4 Then
  Call SetPlayerInvItemNum(index, 24, 0)
  Call PutVar("CTF.ini", "Settings", "BlueCapture", 0)
  Call PutVar("CTF.ini", "Settings", "RedScore", int(GetVar("CTF.ini", "Settings", "RedScore"))+1)
  Call MapMsg(4, GetPlayerName(index)& " has scored a point for the Red Team.", 14)
  Call MapMsg(5, GetPlayerName(index)& " has scored a point for the Red Team.", 14)
 End If
 If GetPlayerShieldSlot(index)=0 Then
  '********************************
  'TODO:Put red Flag Item #          vvv
  '********************************
  Call SetPlayerInvItemNum(index, 24, 3)
  Call SetPlayerShieldSlot(index, 24)
  Call PutVar("CTF.ini", "Settings", "RedCapture", 1)
  Call MapMsg(4, GetPlayerName(index)& " has took the Flag from Red Base.", 14)
  Call MapMsg(5, GetPlayerName(index)& " has took the Flag from Red Base.", 14)
 End If
End If
Call CTF_End()
End If
End Sub
'XXXXXXXXXXXXXXXXXXXXX
Sub Blue_Flag(index)
'XXXXXXXXXXXXXXXXXXXXX
If GetVar("CTF.ini", "Settings", "BlueCapture") = 1 Then
 '********************************
  'TODO:Put Blue Flag Item #   vvv
 '********************************
  If GetPlayerShieldSlot(index)=4 Then
  Call SetPlayerInvItemNum(index, 24, 0)
  Call PutVar("CTF.ini", "Settings", "BlueCapture", 0)
  Call MapMsg(4, GetPlayerName(index)& " has returned the Blue Flag.", 14)
  Call MapMsg(5, GetPlayerName(index)& " has returned the Blue Flag.", 14)
  Else
 '********************************
  'TODO:Put Blue Flag Item #    vvv
  '********************************
  If GetPlayerShieldSlot(index)=3 Then
  Call SetPlayerInvItemNum(index, 24, 0)
  Call PutVar("CTF.ini", "Settings", "RedCapture", 0)
  Call PutVar("CTF.ini", "Settings", "BlueScore", int(GetVar("CTF.ini", "Settings", "BlueScore"))+1)
  Call MapMsg(4, GetPlayerName(index)& " has scored a point for the Blue Team.", 14)
  Call MapMsg(5, GetPlayerName(index)& " has scored a point for the Blue Team.", 14)
 Else
 If GetPlayerShieldSlot(index)=0 Then
  '********************************
  'TODO:Put Blue Flag Item #         vvv
  '********************************
  Call SetPlayerInvItemNum(index, 24, 4)
  Call SetPlayerShieldSlot(index, 24)
  Call PutVar("CTF.ini", "Settings", "BlueCapture", 1)
  Call MapMsg(4, GetPlayerName(index)& " has took the Flag from Blue Base.", 14)
  Call MapMsg(5, GetPlayerName(index)& " has took the Flag from Blue Base.", 14)
 End If
End If
Call CTF_End()
End If
End If
End Sub

'XXXXXXXXXXXXXXXXXXXX
Sub CTF_End()       
'XXXXXXXXXXXXXXXXXXXX
If GetVar("CTF.ini", "Settings", "BlueScore")=5 Then
 If GetVar("CTF.ini", "Settings", "RedScore")=5 Then
 '********************************
 'TODO:Say on every map who won.
 '********************************
 Call MapMsg(1, "Both teams won!", 14)
 Call MapMsg(2, "Both teams won!", 14)
 Call MapMsg(3, "Both teams won!", 14)
 Call MapMsg(4, "Both teams won!", 14)
 Call MapMsg(5, "Both teams won!", 14)
 Call CTF_Exit()
 End If
End If

If GetVar("CTF.ini", "Settings", "BlueScore")=5 Then
 '********************************
 'TODO:Say on every map who won.
 '********************************
 Call MapMsg(4, "Blue team has won!", 4)
 Call MapMsg(5, "Blue team has won!", 4)
 Call MapMsg(2, "Blue team has won!", 4)
 Call MapMsg(3, "Blue team has won!", 4)
 Call MapMsg(1, "Blue team has won!", 4)
 Call CTF_Exit()
End If
If GetVar("CTF.ini", "Settings", "RedScore")=5 Then
 '********************************
 'TODO:Say on every map who won.
 '********************************
 Call MapMsg(4, "Red team has won!", 4)
 Call MapMsg(5, "Red team has won!", 4)
 Call MapMsg(2, "Red team has won!", 4)
 Call MapMsg(3, "Red team has won!", 4)
 Call MapMsg(1, "Red team has won!", 4)
 Call CTF_Exit()
End If
End Sub

'XXXXXXXXXXXXXXXXXXX
Sub CTF_Exit()     
'XXXXXXXXXXXXXXXXXXX
Dim tele
tele=1
  Do While Int(tele) < 5
   '********************************
   'TODO:Change Exit Location Here:
   '********************************
   Call SetPlayerMap(GetVar("CTF.ini", "Red", "Player"& tele, index), 4)
   Call SetPlayerX(GetVar("CTF.ini", "Red", "Player"& tele, index), 5)
   Call SetPlayery(GetVar("CTF.ini", "Red", "Player"& tele, index), 5)
   Call SetPlayerInvItemNum(GetVar("CTF.ini", "Red", "Player"& tele, index), 24, 0)
   Call SetPlayerInvItemNum(GetVar("CTF.ini", "Red", "Player"& tele, index), 25, 0)
   Call SetPlayerShieldSlot(GetVar("CTF.ini", "Red", "Player"& tele, index), 24)
   Call SetPlayerHelmetSlot(GetVar("CTF.ini", "Red", "Player"& tele, index), 25)
   tele= tele + 1
  Loop
  tele=1
  Do While Int(tele) < 5
   '********************************
   'TODO:Change Exit Location Here:
   '********************************
   Call SetPlayerMap(GetVar("CTF.ini", "Blue", "Player"& tele, index), 1)
   Call SetPlayerX(GetVar("CTF.ini", "Blue", "Player"& tele, index), 5)
   Call SetPlayery(GetVar("CTF.ini", "Blue", "Player"& tele, index), 5)
   Call SetPlayerInvItemNum(GetVar("CTF.ini", "Blue", "Player"& tele, index), 24, 0)
   Call SetPlayerInvItemNum(GetVar("CTF.ini", "Blue", "Player"& tele, index), 25, 0)
   Call SetPlayerShieldSlot(GetVar("CTF.ini", "Blue", "Player"& tele, index), 24)
   Call SetPlayerHelmetSlot(GetVar("CTF.ini", "Blue", "Player"& tele, index), 25)
   tele= tele + 1
  Loop
  Call PutVar("CTF.ini", "Settings", "GameOn", 0)
  Call PutVar("CTF.ini", "Settings", "RedScore", 0)
  Call PutVar("CTF.ini", "Settings", "BlueScore", 0)
  Call PutVar("CTF.ini", "Settings", "RedCapture", 0)
  Call PutVar("CTF.ini", "Settings", "BlueCapture", 0)
  Call PutVar("CTF.ini", "Red", "Players", 0)
  Call PutVar("CTF.ini", "Red", "Player1", 0)
  Call PutVar("CTF.ini", "Red", "Player2", 0)
  Call PutVar("CTF.ini", "Red", "Player3", 0)
  Call PutVar("CTF.ini", "Red", "Player4", 0)
  Call PutVar("CTF.ini", "Red", "Player5", 0)
  Call PutVar("CTF.ini", "Blue", "Players", 0)
  Call PutVar("CTF.ini", "Blue", "Player1", 0)
  Call PutVar("CTF.ini", "Blue", "Player2", 0)
  Call PutVar("CTF.ini", "Blue", "Player3", 0)
  Call PutVar("CTF.ini", "Blue", "Player4", 0)
  Call PutVar("CTF.ini", "Blue", "Player5", 0)
End Sub

'********************************
'TODO:Add this to the OnDeath Sub
'********************************
'********************************
'TODO:Change Everything here so it works with your maps/items etc.
'********************************
If GetPlayerShieldSlot(index)=3 Then
 Call PutVar("CTF.ini", "Settings", "BlueCapture", 0)
 Call MapMsg(4, "The Blue Flag has returned to its base.", 14)
 Call MapMsg(5, "The Blue Flag has returned to its base.", 14)
End If
If GetPlayerShieldSlot(index)=4 Then
 Call PutVar("CTF.ini", "Settings", "BlueCapture", 0)
 Call MapMsg(4, "The Blue Flag has returned to its base.", 14)
 Call MapMsg(5, "The Blue Flag has returned to its base.", 14)
End If
If GetPlayerHelmetSlot(index)=1 Then
 townx=2
 towny=5
 townmap=4
 Call PlayerWarp(index, Int(townmap), Int(townx), Int(towny) )
End If
If GetPlayerHelmetSlot(index)=2 Then
 townx=10
 towny=5
 townmap=5
 Call PlayerWarp(index, Int(townmap), Int(townx), Int(towny) )
End If
'********************************
'TODO:Add this to the Scripted Tiles
'********************************
'Red Portal:
Case 3
Call CTF_Chose_Red(index)

'Blue Portal:
Case 4
Call CTF_Chose_Blue(index)

'Around Red Flag
Case 5
Call Red_Flag(index)

'Around Blue Flag
Case 6
Call Blue_Flag(index)
bygcrazy
Member
**
Offline Offline

Posts: 30


View Profile Email
« Reply #9 on: November 01, 2007, 06:26:44 PM »

in whatpart i need put this code in /away where?
i mean to this work ?
hashbakedgoods
The Overlord Rule of The n00bs
Active Member
***
Offline Offline

Posts: 137

I make my own "Stuff"


View Profile Email
« Reply #10 on: November 23, 2007, 11:40:52 AM »

so is this all fixed up?
Sk8erace1
Member
**
Offline Offline

Posts: 67


View Profile WWW Email
« Reply #11 on: November 26, 2007, 05:06:36 AM »

from what icould see whats wrong with it yes but it may have some errors place most of this code at the bottom of your main.txt and place the little parts where the comment says to put them ^_^
RamBONE
Chit Chat God
Teh Uberleet
*****
Offline Offline

Posts: 3,876


Creative Scripter


View Profile Email
« Reply #12 on: December 09, 2007, 04:01:15 PM »

,,,, is this tested or anything?
ノ◊ㄅサкレ∆z, a.k.a King Leonidas!!!
BANNED
Active Member
***
Offline Offline

Posts: 301



View Profile WWW Email
« Reply #13 on: December 11, 2007, 11:40:42 PM »

One of the most impressive scripts I've seen! Especially for a "noob" as you call yourself ;)
RamBONE
Chit Chat God
Teh Uberleet
*****
Offline Offline

Posts: 3,876


Creative Scripter


View Profile Email
« Reply #14 on: December 12, 2007, 05:33:42 PM »

Quote
One of the most impressive scripts I've seen! Especially for a "noob" as you call yourself 

check barons super skills for impersive :D

but yea this is a good script
‪‫‬‭‮‪‫‬‭Admiral Refuge
-_-'
Moderator
Advanced Eclipser
*