|
Brutal - Zeldo
|
 |
« on: July 13, 2006, 07:55:57 PM » |
|
Ok i got a request for this in my request topic so i made it... Difficulty unknown/5 lol yep i dont know again
Ok First Place This At the bottom of your main.txt
Sub when_you_die_for_ctf(index) If GetVar("accounts\" & GetPlayerLogin(index) & ".ini " , "CTF", "playing") = 1 Then Call PutVar("accounts\" & GetPlayerLogin(index) & ".ini " , "CTF", "playing", 0) If GetVar("accounts\" & GetPlayerLogin(index) & ".ini " , "CTF", "has_flag") = 1 Then Call PutVar("accounts\" & GetPlayerLogin(index) & ".ini " , "CTF", "has_flag", 0) If GetVar("accounts\" & GetPlayerLogin(index) & ".ini " , "CTF", "color") = 1 Then Call PutVar("CTF.ini " , "CTF", "blue_captured", 0) Call PutVar("accounts\" & GetPlayerLogin(index) & ".ini " , "CTF", "color", 0) Call PlayerMsg(index, "You had the Blue flag when you died... You Have Been Removed From the game. Good Luck Next Time", 2) ElseIf GetVar("accounts\" & GetPlayerLogin(index) & ".ini " , "CTF", "color") = 2 Then Call PutVar("CTF.ini " , "CTF", "red_captured", 0) Call PutVar("accounts\" & GetPlayerLogin(index) & ".ini " , "CTF", "color", 0) Call PlayerMsg(index, "You had the Red flag when you died... You Have Been Removed From the game. Good Luck Next Time", 2) End If ElseIf GetVar("accounts\" & GetPlayerLogin(index) & ".ini " , "CTF", "has_flag") = 0 Then Call PlayerMsg(index, "You Didnt have the flag when you died... You Have Been Removed From the game.", 2) End If Else Call PlayerMsg(index, "I see you have once played Capture The Flag Come Play Again!", 2) End If End Sub
'****************************************** Sub start_C_T_F_red(index)'*************** 'By Brutal <-- (must stay if code edited)** '****************************************** On Error Resume next Dim playing_red Dim players_playing_red Dim color_red Dim amount_needed_red Dim red_start_map Dim red_start_y Dim red_start_x Dim red_ban Dim red_game
red_start_map = GetVar("CTF.ini ", "CTF", "red_start_map") red_start_x = GetVar("CTF.ini ", "CTF", "red_start_x") red_start_y = GetVar("CTF.ini ", "CTF", "red_start_y") red_ban = GetVar("accounts\" & GetPlayerLogin(index) & ".ini " , "CTF", "banned")
playing_red = GetVar("accounts\" & GetPlayerLogin(index) & ".ini " , "CTF", "playing") color_red = GetVar("accounts\" & GetPlayerLogin(index) & ".ini " , "CTF", "color") players_playing_red = GetVar("CTF.ini ", "CTF", "playersplayingred") amount_needed_red = GetVar("CTF.ini ", "CTF", "amountofplayersneededforred") red_game = GetVar("CTF.ini ", "CTF", "gamegoing") if red_game = 0 Then If red_ban = 0 Then If playing_red = 0 Then Call PutVar("accounts\" & GetPlayerLogin(index) & ".ini " , "CTF", "playing", Int(1)) Call PutVar("accounts\" & GetPlayerLogin(index) & ".ini " , "CTF", "has_flag", 0) Call PutVar("accounts\" & GetPlayerLogin(index) & ".ini " , "CTF", "color", 2) If players_playing_red = 0 Then players_playing_red = 1 Call PutVar("CTF.ini " , "CTF", "playersplaying", Int(players_playing_red)) Call MapMsg(GetPlayerMap(index), "There is now " & players_playing_red & " Player and you need " & amount_needed_red & " Players to start the game once there is enough players please step on the portal again to start the game!!!", 6) ElseIf players_playing_red > 0 Then Call PutVar("CTF.ini " , "CTF", "playersplaying", players_playing_red+1) Call MapMsg(GetPlayerMap(index), "There is now " & players_playing_red+1 & " Players and you need " & amount_needed_red & " Players to start the game once there is enough players please step on the portal again to start the game!!!", 6) End If ElseIf playing_red > 0 Then If color_red = 1 Then If players_playing_red = amount_needed_red Then Call PlayerWarp(index, red_start_map, red_start_x, red_start_y) Call PutVar("CTF.ini " , "CTF", "gamegoing", 1) Else If color_red = 2 Then Call PlayerMsg(index, "You Are Already Waiting for a game to start. you are the color Red going for the Blue flag", 2) Else Call PlayerMsg(index, "You Are Already Waiting for a game to start. you are the color Blue going for the Red flag", 2) End If End If Else Call PlayerMsg(index, "Get On your own portal!!!!", 2) End If End If ElseIf red_ban = 1 Then Call PlayerMsg(index, "you have been banned do not return here until a mod unbans you...", 2) End If ElseIf red_game = 1 Then Call PlayerMsg(index, "Sorry there is already a game going", 2) End If
End Sub
'****************************************** Sub start_C_T_F_blue(index)'*************** 'By Brutal <-- (must stay if code edited)** '****************************************** On Error Resume next Dim playing_blue Dim players_playing_blue Dim color_blue Dim amount_needed Dim blue_start_map Dim blue_start_y Dim blue_start_x Dim blue_ban
blue_start_map = GetVar("CTF.ini ", "CTF", "blue_start_map") blue_start_x = GetVar("CTF.ini ", "CTF", "blue_start_x") blue_start_y = GetVar("CTF.ini ", "CTF", "blue_start_y") blue_ban = GetVar("accounts\" & GetPlayerLogin(index) & ".ini " , "CTF", "banned")
playing_blue = GetVar("accounts\" & GetPlayerLogin(index) & ".ini " , "CTF", "playing") color_blue = GetVar("accounts\" & GetPlayerLogin(index) & ".ini " , "CTF", "color") players_playing_blue = GetVar("CTF.ini ", "CTF", "playersplaying") amount_needed = GetVar("CTF.ini ", "CTF", "amountofplayersneeded") blue_game = GetVar("CTF.ini ", "CTF", "gamegoing")
if blue_game = 0 Then If blue_ban = 0 Then
If playing_blue = 0 Then Call PutVar("accounts\" & GetPlayerLogin(index) & ".ini " , "CTF", "playing", Int(1)) Call PutVar("accounts\" & GetPlayerLogin(index) & ".ini " , "CTF", "has_flag", 0) Call PutVar("accounts\" & GetPlayerLogin(index) & ".ini " , "CTF", "color", 2) If players_playing_blue = 0 Then players_playing_blue = 1 Call PutVar("CTF.ini " , "CTF", "playersplaying", Int(players_playing_blue)) Call MapMsg(GetPlayerMap(index), "There is now " & players_playing_blue & " Player and you need " & amount_needed & " Players to start the game once there is enough players please step on the portal again to start the game!!!", 6) ElseIf players_playing_blue > 0 Then Call PutVar("CTF.ini " , "CTF", "playersplaying", players_playing_blue+1) Call MapMsg(GetPlayerMap(index), "There is now " & players_playing_blue+1 & " Players and you need " & amount_needed & " Players to start the game once there is enough players please step on the portal again to start the game!!!", 6) End If ElseIf playing_blue > 0 Then If color_blue = 2 Then If players_playing_blue = amount_needed Then Call PlayerWarp(index, blue_start_map, blue_start_x, blue_start_y) Call PutVar("CTF.ini " , "CTF", "gamegoing", 1) Else If color_blue = 2 Then Call PlayerMsg(index, "You Are Already Waiting for a game to start. you are the color blue going for the red flag", 2) Else Call PlayerMsg(index, "You Are Already Waiting for a game to start. you are the color red going for the blue flag", 2) End If End If ElseIf color_blue = 1 Then Call PlayerMsg(index, "Get On your own portal!!!!", 2) End If End If ElseIf blue_ban = 1 Then Call PlayerMsg(index, "you have been banned do not return here until a mod unbans you...", 2) End If ElseIf blue_game = 1 Then Call PlayerMsg(index, "Sorry there is already a game going", 2) End If End Sub
'****************************************** Sub blue_flag(index)'********************** 'By Brutal <-- (must stay if code edited)** '****************************************** Dim Get_Color Dim Get_Red_Map Dim Get_Blue_Map Dim Get_Has_Flag Dim game_portals_Map Dim game_portals_Y Dim game_portals_X Dim players_playing_blue2 Dim Game_Over Get_Color = GetVar("accounts\" & GetPlayerLogin(index) & ".ini " , "CTF", "color") Get_Red_Map = GetVar("CTF.ini ", "CTF", "red_start_map") Get_Blue_Map = GetVar("CTF.ini ", "CTF", "blue_start_map") Game_Over = GetVar("CTF.ini ", "CTF", "game_over")
game_portals_Map = GetVar("CTF.ini ", "CTF", "game_portals_map") game_portals_X = GetVar("CTF.ini ", "CTF", "game_portals_x") game_portals_Y = GetVar("CTF.ini ", "CTF", "game_portals_y") players_playing_blue2 = GetVar("CTF.ini ", "CTF", "playersplaying") Get_Has_Flag = GetVar("accounts\" & GetPlayerLogin(index) & ".ini " , "CTF", "has_flag")
If Get_Color = 1 Then Call PlayerMsg(index, "You Got There Flag Now Take It Back To Your Flag and Stand UNder Yours!!! Hurry and dont die!!!", 2) Call PutVar("accounts\" & GetPlayerLogin(index) & ".ini " , "CTF", "has_flag", 1) Call MapMsg(Get_Red_Map, GetPlayerName(index) & "Has The Red Flag You Better Kill Him Red Team!!!", 15) Call MapMsg(Get_Blue_Map, GetPlayerName(index) & "Has The Red Flag You Better Kill Him Red Team!!!", 15) ElseIf Get_Color = 2 Then Get_Has_Flag = GetVar("accounts\" & GetPlayerLogin(index) & ".ini " , "CTF", "has_flag") If Get_Has_Flag = 1 Then Call PutVar("accounts\" & GetPlayerLogin(index) & ".ini " , "CTF", "has_flag", 0) Call PutVar("CTF.ini ", "CTF", "game_over", 1) Call MapMsg(Get_Red_Map, GetPlayerName(index) & "Has Won The Game For The Red Team!!! Return to a flag to be warp out(a new game cannot be started while someone is in the playing field and mods can ban you from the game)", 15) Call MapMsg(Get_Blue_Map, GetPlayerName(index) & "Has Won The Game For The Red Team!!!Return to a flag to be warp out(a new game cannot be started while someone is in the playing field and mods can ban you from the game)", 15) Else
If Game_Over = 1 Then If players_playing_blue2 > 1 Then Call PutVar("CTF.ini " , "CTF", "playersplaying", Int(players_playing_blue2-1)) Call PutVar("accounts\" & GetPlayerLogin(index) & ".ini " , "CTF", "color", 0) Call PutVar("accounts\" & GetPlayerLogin(index) & ".ini " , "CTF", "playing", 0) Call PlayerWarp(index, game_portals_Map, game_portals_X, game_portals_Y) ElseIf players_playing_blue2 = 1 Then Call PutVar("CTF.ini " , "CTF", "playersplaying", Int(players_playing_blue2-1)) Call PutVar("CTF.ini " , "CTF", "gamegoing", 0) Call PutVar("CTF.ini " , "CTF", "gave_over", 0) Call PutVar("accounts\" & GetPlayerLogin(index) & ".ini " , "CTF", "color", 0) Call PutVar("accounts\" & GetPlayerLogin(index) & ".ini " , "CTF", "playing", 0) Call PlayerWarp(index, game_portals_Map, game_portals_X, game_portals_Y) End If ElseIf Game_Over = 0 Then Call PlayerMsg(index, "Return Once You Have The Flag!!! Or the game is over!", 2) End If End If End If End Sub
'****************************************** Sub red_flag(index)'********************** 'By Brutal <-- (must stay if code edited)** '****************************************** Dim Get_Color2 Dim Get_Red_Map2 Dim Get_Blue_Map2 Dim Get_Has_Flag2 Dim game_portals_Map2 Dim game_portals_Y2 Dim game_portals_X2 Dim players_playing_blue22 Dim Game_Over2 Get_Color2 = GetVar("accounts\" & GetPlayerLogin(index) & ".ini " , "CTF", "color") Get_Red_Map2 = GetVar("CTF.ini ", "CTF", "red_start_map") Get_Blue_Map2 = GetVar("CTF.ini ", "CTF", "blue_start_map") Game_Over2 = GetVar("CTF.ini ", "CTF", "game_over")
game_portals_Map2 = GetVar("CTF.ini ", "CTF", "game_portals_map") game_portals_X2 = GetVar("CTF.ini ", "CTF", "game_portals_x") game_portals_Y2 = GetVar("CTF.ini ", "CTF", "game_portals_y") players_playing_blue22 = GetVar("CTF.ini ", "CTF", "playersplaying") Get_Has_Flag = GetVar("accounts\" & GetPlayerLogin(index) & ".ini " , "CTF", "has_flag")
If Get_Color2 = 2 Then Call PlayerMsg(index, "You Got There Flag Now Take It Back To Your Flag and Stand UNder Yours!!! Hurry and dont die!!!", 2) Call PutVar("accounts\" & GetPlayerLogin(index) & ".ini " , "CTF", "has_flag", 1) Call MapMsg(Get_Red_Map, GetPlayerName(index) & "Has The Red Flag You Better Kill Him Red Team!!!", 15) Call MapMsg(Get_Blue_Map, GetPlayerName(index) & "Has The Red Flag You Better Kill Him Red Team!!!", 15) ElseIf Get_Color2 = 1 Then Get_Has_Flag2 = GetVar("accounts\" & GetPlayerLogin(index) & ".ini " , "CTF", "has_flag") If Get_Has_Flag2 = 1 Then Call PutVar("accounts\" & GetPlayerLogin(index) & ".ini " , "CTF", "has_flag", 0) Call PutVar("CTF.ini ", "CTF", "game_over", 1) Call MapMsg(Get_Red_Map2, GetPlayerName(index) & "Has Won The Game For The Red Team!!! Return to a flag to be warp out(a new game cannot be started while someone is in the playing field and mods can ban you from the game)", 15) Call MapMsg(Get_Blue_Map2, GetPlayerName(index) & "Has Won The Game For The Red Team!!!Return to a flag to be warp out(a new game cannot be started while someone is in the playing field and mods can ban you from the game)", 15) Else
If Game_Over2 = 1 Then If players_playing_blue22 > 1 Then Call PutVar("CTF.ini " , "CTF", "playersplaying", Int(players_playing_blue22-1)) Call PutVar("accounts\" & GetPlayerLogin(index) & ".ini " , "CTF", "color", 0) Call PutVar("accounts\" & GetPlayerLogin(index) & ".ini " , "CTF", "playing", 0) Call PlayerWarp(index, game_portals_Map2, game_portals_X2, game_portals_Y2) ElseIf players_playing_blue22 = 1 Then Call PutVar("CTF.ini " , "CTF", "playersplaying", Int(players_playing_blue22-1)) Call PutVar("CTF.ini " , "CTF", "gamegoing", 0) Call PutVar("CTF.ini " , "CTF", "gave_over", 0) Call PutVar("accounts\" & GetPlayerLogin(index) & ".ini " , "CTF", "color", 0) Call PutVar("accounts\" & GetPlayerLogin(index) & ".ini " , "CTF", "playing", 0) Call PlayerWarp(index, game_portals_Map2, game_portals_X2, game_portals_Y2) End If ElseIf Game_Over2 = 0 Then Call PlayerMsg(index, "Return Once You Have The Flag!!! Or the game is over!", 2) End If End If End If End Sub
Then Find This
Sub OnDeath(index) Dim mapnum Dim x Dim y Dim i i = GetPlayerClass(index)
mapnum = GetVar("Classes\Class" & i & ".ini", "CLASS", "Map") y = GetVar("Classes\Class" & i & ".ini", "CLASS", "y") x = GetVar("Classes\Class" & i & ".ini", "CLASS", "x") Call PlayerWarp(index, mapnum, x, y) End Sub
And REPLACE it with this
Sub OnDeath(index) Dim mapnum Dim x Dim y Dim i i = GetPlayerClass(index)
mapnum = GetVar("Classes\Class" & i & ".ini", "CLASS", "Map") y = GetVar("Classes\Class" & i & ".ini", "CLASS", "y") x = GetVar("Classes\Class" & i & ".ini", "CLASS", "x") Call PlayerWarp(index, mapnum, x, y) Call when_you_die_for_ctf(index) End Sub
Then Find This
'******************************** Sub ScriptedTile(index, Script) '********************************
Select Case Script
And Put This Under it CHANGEING THE CASES ACCORDINGLY TO WHAT U ALREADY HAVE!!!!!!!!!
'<><><><><> Case 0 Call start_C_T_F_red(index) '<><><><><> Case 1 Call start_C_T_F_blue(index) '<><><><><> Case 2 Call blue_flag(index) '<><><><><> Case 3 Call red_flag(index)
Then Make an CTF.ini that says this
[CTF] amountofplayersneeded=#replace with amount of players you want per game# red_start_map=#replace with map with the red flag# red_start_x=#replace this with an x right next to the red flag# red_start_y=#replace this with an y right next to the red flag# blue_start_map=#replace with map with the blue flag# blue_start_x=#replace this with an x right next to the blue flag# blue_start_y=#replace this with an y right next to the blue flag# playersplaying=0 game_portals_map=#replace with map that the blue and red portals are on# game_portals_x=#replace with A x that the blue and red portals are on# game_portals_y=#replace with A y that the blue and red poertals are on# game_over=0 gamegoing=0
Ok and thats it(atleast i think i didnt leave out anything it was alot of code so sry if i did...)
HOW TO USE ok place the first 2 scripted tiles on the map you want the portals to start the game to be on. Then fill out the CTF.ini accordingly DO NOT MESS WITH THE GAME_OVER GAMEGOING OR PLAYERSPLAYING OR IT WILL NOT WORK!!!!!. put the 3 scriptited tile i gave you where the blue flag goes and the fourth scripted tile where the red flag go's. There is a way to ban the ppl but u have to have access to there server file for now ill prolly change this later. Thats all feel free to ask questions but be spicific(spelled wrong) but i might just tell you to go away so ya....
~Brutal
|