Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Server messages and CTF OnPlayerScore function --
- scores = {}
- welcome_message_table = {}
- persistant_message_table = {}
- welcome_message_table[1] = "<LTD2CLAN.NET> WELCOME ON LTD2 ROCKETGULCH CTF !"
- welcome_message_table[2] = "<LTD2CLAN.NET> GAMESPY IS CLOSING SOON - PLEASE USE DIRECT IP TO JOIN OUR SERVERS"
- welcome_message_table[3] = "<LTD2CLAN.NET> 1 - TYPE ip IN SERVER CHAT TO SEE THIS SERVER ADRESS"
- welcome_message_table[4] = "<LTD2CLAN.NET> 2 - PRESS F1 TO SEE THE SERVER'S IP AND THEN WRITE IT DOWN"
- welcome_message_table[5] = "<LTD2CLAN.NET> 3 - USE GAMETRACKER TO CHECK FOR HALO SERVER LISTS AND IP'S"
- welcome_message_table[8] = "<LTD2CLAN.NET> FOR A FULL LIST OF OUR SERVER'S IP VISIT : WWW.LTD2CLAN.NET/SERVERS"
- welcome_message_table[9] = "ENTER YOUR TEXT HERE"
- persistant_message_table[1] = "<LTD2CLAN.NET> WELCOME ON LTD2 ROCKETGULCH CTF !"
- persistant_message_table[2] = "<LTD2CLAN.NET> GAMESPY IS CLOSING SOON - PLEASE USE DIRECT IP TO JOIN OUR SERVERS"
- persistant_message_table[3] = "<LTD2CLAN.NET> 1 - TYPE ip IN SERVER CHAT TO SEE THIS SERVER ADRESS"
- persistant_message_table[4] = "<LTD2CLAN.NET> 2 - PRESS F1 TO SEE THE SERVER'S IP AND THEN WRITE IT DOWN"
- persistant_message_table[5] = "<LTD2CLAN.NET> 3 - USE GAMETRACKER TO CHECK FOR HALO SERVER LISTS AND IP'S"
- persistant_message_table[8] = "<LTD2CLAN.NET> FOR A FULL LIST OF OUR SERVER'S IP VISIT : WWW.LTD2CLAN.NET/SERVERS"
- persistant_message_table[9] = "ENTER YOUR TEXT HERE"
- function GetRequiredVersion() return 200 end
- function OnScriptLoad(processId, game, persistent)
- gametype_game = readbyte(0x671340 + 0x30)
- team_play = readbyte(0x671340 + 0x34)
- messageTimer = registertimer(3*60000, "AutoMessage")
- end
- function OnGameEnd(stage)
- removetimer(messageTimer)
- end
- function AutoMessage(id, count)
- for i = 1, #persistant_message_table do
- if persistant_message_table[i] ~= "ENTER YOUR TEXT HERE" and persistant_message_table[i] ~= "" and persistant_message_table[i] ~= nil then
- say(persistant_message_table[i], false)
- end
- end
- return true
- end
- function OnPlayerJoin(player)
- scores[gethash(player)] = 0
- for i = 1, #welcome_message_table do
- if welcome_message_table[i] ~= "ENTER YOUR TEXT HERE" and welcome_message_table[i] ~= "" and welcome_message_table[i] ~= nil then
- privatesay(player, welcome_message_table[i], false)
- end
- end
- end
- function OnServerChat(player, type, message)
- local response = nil
- if player then
- if string.lower(message) == "ip" then
- local response = false
- privatesay(player, "<LTD2CLAN.NET> 185.16.85.100:2301", false)
- return response
- end
- end
- return response
- end
- function OnTeamChange(player, old_team, new_team, relevant)
- scores[gethash(player)] = 0
- end
- function OnPlayerScore(player, score, gametype)
- local name = getname(player)
- local team = getteam(player)
- privatesay(player, "<LTD2CLAN.NET> Welldone !", false)
- if team == 1 then
- say("<LTD2CLAN.NET> " .. name .. " just scored, good job blue team", false)
- else
- say("<LTD2CLAN.NET> " .. name .. " just scored, good job red team", false)
- end
- end
- function OnClientUpdate(player)
- if gethash(player) then
- local score = getscore(player)
- if score > scores[gethash(player)] then
- OnPlayerScore(player, score, gametype_game)
- scores[gethash(player)] = score
- end
- end
- end
- function getscore(player)
- local score = 0
- local timed = false
- if gametype_game == 1 then
- score = readword(getplayer(player) + 0xC8)
- end
- if timed == true then
- score = math.floor(score / 30)
- end
- return score
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement