×

Langue

Fermer
Atelier 801
  • Forums
  • Dev Tracker
  • Connexion
    • English Français
      Português do Brasil Español
      Türkçe Polski
      Magyar Română
      العربية Skandinavisk
      Nederlands Deutsch
      Bahasa Indonesia Русский
      中文 Filipino
      Lietuvių kalba 日本語
      Suomi עברית
      Italiano Česky
      Hrvatski Slovensky
      Български Latviešu
      Estonian
  • Langue
  • Forums
  • /
  • Transformice
  • /
  • Modules
  • /
  • [Script] [Aniversare RO] Concursul de Survivor și Bootcamp
[Script] [Aniversare RO] Concursul de Survivor și Bootcamp
Orb
« Censeur »
1502485560000
    • Orb#0095
    • Profil
    • Derniers messages
    • Tribu
#1
  12
  • Survivor (v1.0.1.public)
  • Bootcamp (v1.0.public)
http://i.imgur.com/FADXI5q.pngDupă cum v-am promis, am decis să fac public script-ul folosit în timpul Aniversării RO pentru administrarea concursurilor de Survivor, Bootcamp și Racing.

Vă invit să contribuiți la îmbunătățirea acestuia fie postând pe acest thread diferite bug-uri (și soluții, dacă aveți cunoștințe în LUA), fie prin mesaj privat.

Cum folosesc acest script?
Pentru a rula acest script, mergi în Casa Tribului tău (asigură-te că ai rangul necesar pentru a rula scripturi), scrie /lua în chat și lipește script-ul dorit în căsuța care îți apare. Fă modificările necesare fiecărui script în parte și apoi click pe Validează.

Script-ul s-a oprit dintr-o dată! Ce să fac?
Dacă întâmpini probleme cu script-ul, postează aici eroarea pe care tu (sau persoana care rulează script-ul) ai primit-o. Dacă ai făcut modificări care implică ștergerea/adăugarea unor linii de cod, te rog să precizezi acest lucru. Poți pune codul într-un Pastebin (sau aici, pe forum, folosind tag-ul [code=lua]cod aici[/code] ca să îmi fie mai ușor să mă uit peste.

Punctele mele/prietenilor mei s-au resetat!
Având în vedere că funcțiile care permit salvarea datelor pe server nu merg în Casa Tribului, orice informație (punctele, scorul, timpul cel mai bun) este resetată odată ce script-ul este scos și rulat din nou. Din păcate, nu există o modalitate prin care poți să păstrezi punctele astfel încât acestea să nu se „piardă”. De asemenea, există posibilitatea ca un admin să fi folosit comanda !reset pentru a-ți reseta manual punctele.

Pentru mai multe informații despre modul în care funcționează script-ul (toate cele 3 script-uri diferă puțin prin modul de funcționare), dă click pe tab-ul corespunzător.

SURVIVOR


Script-ul de Survivor este bazat pe Modul de Survivor clasic, ceea ce înseamnă:
  • Doar ghiulele
  • Fără totem
  • Meep-ul este permis
  • Fără spirit

Întrebări frecvente


Ce trebuie să modific?
Singurele date pe care trebuie să le modifici sunt acestea:
Code Lua

1
2
3
4
players={"Tigrounette"} -- Aici pui numele celor care vrei să participe la concurs. Cei care nu sunt în această listă vor muri automat la începutul fiecărei runde.
admins={"Magicalorb"} -- Aici pui numele celor care vrei să aibă acces la comenzi.
maps={281431, 281492, 293222} -- Aici pui câte mape vrei să aibă concursul.
mapaAsteptare=0 -- Această variabilă este opțională. Pune numărul mapei care vrei să rămână după ce mapele de concurs s-au epuizat. Dacă nu dorești o astfel de mapă, lasă 0.

Care este sistemul de punctaj?
  • +1 punct dacă supraviețuiești la sfârșitul rundei
  • +1 punct la fiecare 10 șoareci omorâți ca șaman
  • -2 punct dacă mori
  • -3 puncte dacă folosești Spiritul (-1 penalizare + -2 de la moarte)
  • În viitor, vei putea să personalizezi numărul de puncte în funcție de aceste criterii.
Ce comenzi există?
Momentan, există doar 3 comenzi disponibile adminilor:

  • !reset numeUtilizator - Resetează punctajul unui utilizator la 0
  • !resetAll - Resetează punctajul tuturor jucătorilor din sală la 0
  • !next - Sare la următoarea mapă din listă

Click aici pentru script!
Code Lua

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
-----------------------------------------SURVIVOR-----------------------------------------

tfm.exec.disableAutoNewGame(true)
tfm.exec.disableAllShamanSkills(true)
tfm.exec.disablePhysicalConsumables(true)

players={"Tigrounette"}
admins={"Magicalorb"}
maps={281431, 281492, 293222}
mapaAsteptare=0

cannons={17, 1701, 1702, 1702, 1703, 1704, 1705, 1706}
clasament={"<J><p align='center'><b>Clasament</b></p><V><p align='center'>Scroll pentru mai multe rezultate!</p>"}
log={"<J><p align='center'><b>Activitatea concursului</b></p>"}
points={}
over=false
alive=0
rounds=0
killed=0
logCounter=0
names=""

function inTable(tbl, item) for key, value in pairs(tbl) do if value == item then return true end end return false end
function table.concat(tbl,delim) local str='' if delim==nil then delim='' end for k,v in pairs(tbl) do str=str..v..delim end return str end
function table.count(tbl,subtbl) local i=0 if subtbl then for k,v in pairs(tbl) do if v[subtbl] then i=i+1 end end else for _ in pairs(tbl) do i=i+1 end end return i end
function string.split(str, del) del=del or ',' local res={} for s in str:gmatch('[^'..del..']+') do table.insert(res, s) end return res end
function updateScore(p) ui.addTextArea(101, "<a href='event:openLog'><font size='16'><ROSE><b>"..points[p].."</a>", p, 0, 20, 40, 20, 0x000001, 0x000001, 0) end
function openLog(p) if logCounter%2==0 then ui.addTextArea(100, table.concat(log, "<br/>"), p, -210, 35, 200, 350, 0x000001, 0x000001, 0.5, true) else ui.removeTextArea(100, p) end logCounter=logCounter+1 end
updateLog = function(p) if table.count(log) == 50 then table.remove(log, 2) end ui.updateTextArea(100, table.concat(log, "<br/>"), nil) end
update = function(p) ui.addTextArea(1, table.concat(clasament, "<br>"), p, 300, 50, 200, 300, 0x000001, 0x000001, 0.5) ui.addTextArea(2, "<R><b><a href='event:close'>X</a>", p, 485, 50, 20, 20, 0x000001, 0x000001, 0) end
function sendUpdate(text) table.insert(log, text) updateLog() end
function addData() for p in pairs(tfm.get.room.playerList) do table.insert(clasament, "<CH>[<VP>"..points[p].."p<CH>] <J>"..p.."<BL>") table.sort(clasament, function(a, b) return a > b end) end end
function table.count(tbl,subtbl) local i=0 if subtbl then for k,v in pairs(tbl) do if v[subtbl] then i=i+1 end end else for _ in pairs(tbl) do i=i+1 end end return i end
function eventSummoningEnd (p, id, x, y, ang, prop) if inTable(cannons, id)==false then tfm.exec.removeObject(prop.id) end if id==24 then points[p]=points[p]-1 tfm.exec.killPlayer(p) sendUpdate("<R>• <J><b>"..p.."</b><R> a fost penalizat cu <J><b>1p</b><R> pentru folosirea Spiritului.") updateScore(p) end end
function eventTextAreaCallback (id, p, name) if id==101 then openLog(p) end if id==3 then update(p) end if id==2 then ui.removeTextArea(2, p) ui.removeTextArea(1, p) end end
function eventPlayerLeft(p) alive=alive-1 end

if mapaAsteptare~=0 then table.insert(maps, mapaAsteptare) nrRunde=table.count(maps)-1
else nrRunde=table.count(maps) end

function eventNewPlayer(p)
points[p]=0
if inTable(admins, p) then table.insert(players, p) end
openLog(p)
updateScore(p)
end

function eventNewGame()
names=""
killed=0
alive=0
for p in pairs(tfm.get.room.playerList) do
alive=alive+1
if inTable(players, p) == false then tfm.exec.killPlayer(p) end
end

rounds=rounds+1

tfm.exec.setUIMapName("Runda: <b>"..rounds.."</b> / "..nrRunde)
if(rounds>nrRunde) then tfm.exec.setUIMapName("Mapa de așteptare") end

if rounds>nrRunde then
over=true
tfm.exec.setGameTime(99999)
sendUpdate("<ROSE>• Concursul de Survivor s-a încheiat.")
for p in pairs(tfm.get.room.playerList) do
table.insert(clasament, "<CH>[<VP>"..points[p].."p<CH>] <J>"..p.."<BL>")
table.sort(clasament, function(a, b) return a > b end)
ui.addTextArea(3, "<ROSE><b><a href='event:clasament'>CLASAMENT</a>", p, 350, 20, 80, 20, 0x000001, 0x000001, 0.5)
end
end
end

function eventChatCommand(p, message)
if inTable(admins, p) then local arg = {} for argument in message:gmatch ("[^%s]+") do table.insert (arg, argument); end

if arg[1]=="reset" and arg[2] then
points[arg[2]]=0
sendUpdate("<V>• Punctele au fost resetate pentru <J><b>"..arg[2].."</b><V>.")
updateScore(arg[2])
end

if arg[1]=="next" then
tfm.exec.newGame(maps[1])
table.remove(maps, 1)
end

if arg[1]=="resetAll" then
for n in pairs(tfm.get.room.playerList) do
points[n]=0
tfm.exec.setPlayerScore(n, 0)
updateScore(n)
end
sendUpdate("<V>• Punctele au fost resetate pentru toți din sală.")
end
end
end

function eventPlayerDied(p)
killed=killed+1
alive=alive-1
if alive==0 and rounds<=nrRunde then tfm.exec.newGame(maps[1]) table.remove(maps, 1) end

if rounds<=nrRunde and inTable(players, p)==true then
points[p]=points[p]-2
sendUpdate("<R>• <J><b>"..p.."</b><R> a fost penalizat cu <J><b>2p</b><R> pentru că a murit.")
updateScore(p)
end

if killed%10==0 then
for n in pairs(tfm.get.room.playerList) do
if tfm.get.room.playerList[n].isShaman then
points[n]=points[n]+1
updateScore(n)
sendUpdate("<VP>• <J><b>"..n.."</b> a omorât <J><b>10 șoareci</b><VP> și a câștigat <J><b>1p</b><VP>.")
end
end
end
end

function eventLoop(c, r)
if(r<=2) and over==false then
for p in pairs(tfm.get.room.playerList) do
if not tfm.get.room.playerList[p].isDead and tfm.get.room.playerList[p].isShaman==false then
points[p]=points[p]+1
updateScore(p)
names=names..p.."<VP>,<J> "
end
end
if mapaAsteptare==0 and over==false then
for p in pairs(tfm.get.room.playerList) do
table.insert(clasament, "<CH>[<VP>"..points[p].."p<CH>] <J>"..p.."<BL>")
table.sort(clasament, function(a, b) return a > b end)
ui.addTextArea(3, "<ROSE><b><a href='event:clasament'>CLASAMENT</a>", p, 350, 20, 80, 20, 0x000001, 0x000001, 0.5)
end
over=true
end
if names~="" then sendUpdate("<VP>• "..string.sub(tostring(names), 0, string.len(tostring(names))-5).." au supraviețuit și au câștigat <J><b>1p</b><VP>.") end
tfm.exec.newGame(maps[1])
table.remove(maps, 1)
end
end

for p in pairs(tfm.get.room.playerList) do eventNewPlayer(p) end

tfm.exec.newGame(maps[1])
table.remove(maps, 1)

for i, v in ipairs({"next", "reset", "resetAll"}) do system.disableChatCommandDisplay(v) end


Istoricul schimbărilor

  • 12.08.2017 (v1.0.public) - Lansarea oficială a primei versiuni publice a scriptului
  • 12.08.2017 (v1.0.1.public) - Am actualizat textele pentru a ocupa mai puțin spațiu în Activitatea Concursului

BOOTCAMP

Întrebări frecvente


Ce trebuie să modific?
Singurele date pe care trebuie să le modifici sunt acestea:
Code Lua

1
2
3
4
players={"Tigrounette"} -- Aici pui numele celor care vrei să participe la concurs. Cei care nu sunt în această listă vor muri automat la începutul fiecărei runde.
admins={"Magicalorb"} -- Aici pui numele celor care vrei să aibă acces la comenzi.
maps={281431, 281492, 293222} -- Aici pui câte mape vrei să aibă concursul.
mapaAsteptare=0 -- Această variabilă este opțională. Pune numărul mapei care vrei să rămână după ce mapele de concurs s-au epuizat. Dacă nu dorești o astfel de mapă, lasă 0.

Care este sistemul de punctaj?
  • +1 punct la fiecare intrare în gaură
  • +10 puncte pentru cel mai bun timp la finalul rundei
  • În viitor, vei putea să personalizezi numărul de puncte în funcție de aceste criterii.
Ce comenzi există?
Momentan, există doar 4 comenzi disponibile adminilor:

  • !reset numeUtilizator - Resetează punctajul unui utilizator la 0
  • !resetAll - Resetează punctajul tuturor jucătorilor din sală la 0
  • !time numărSecunde - Setează timpul rămas din rundă
  • !next - Sare la următoarea mapă din listă

Click aici pentru script!
Code Lua

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
-----------------------------------------BOOTCAMP-----------------------------------------

tfm.exec.disableAutoNewGame(true)
tfm.exec.disableAutoTimeLeft(true)
tfm.exec.disableAfkDeath(true)
tfm.exec.disableAutoShaman(true)
tfm.exec.disableAutoScore(true)

players={"Tigrounette"}
admins={"Magicalorb"}
maps={1, 190646, 1593066, 374995, 5092739}
mapaAsteptare=0

clasament={"<J><p align='center'><b>Clasament</b></p><V><p align='center'>Scroll pentru mai multe rezultate!</p>"}
log={"<J><p align='center'><b>Activitatea concursului</b></p>"}
points={}
bootcamp_time={}
bootcamp_bestTime={}
over=false
rounds=0
bestTime=999999
logCounter=0
names=""

function inTable(tbl, item) for key, value in pairs(tbl) do if value == item then return true end end return false end
function table.concat(tbl,delim) local str='' if delim==nil then delim='' end for k,v in pairs(tbl) do str=str..v..delim end return str end
function table.count(tbl,subtbl) local i=0 if subtbl then for k,v in pairs(tbl) do if v[subtbl] then i=i+1 end end else for _ in pairs(tbl) do i=i+1 end end return i end
function string.split(str, del) del=del or ',' local res={} for s in str:gmatch('[^'..del..']+') do table.insert(res, s) end return res end
function updateScore(p) ui.addTextArea(101, "<a href='event:openLog'><font size='16'><ROSE><b>"..points[p].."</a>", p, 0, 20, 40, 20, 0x000001, 0x000001, 0) end
function openLog(p) if logCounter%2==0 then ui.addTextArea(100, table.concat(log, "<br/>"), p, -210, 35, 200, 350, 0x000001, 0x000001, 0.5, true) else ui.removeTextArea(100, p) end logCounter=logCounter+1 end
updateLog = function(p) if table.count(log) == 14 then table.remove(log, 2) end ui.updateTextArea(100, table.concat(log, "<br/>"), nil) end
update = function(p) ui.addTextArea(1, table.concat(clasament, "<br>"), p, 300, 50, 200, 300, 0x000001, 0x000001, 0.5) ui.addTextArea(2, "<R><b><a href='event:close'>X</a>", p, 485, 50, 20, 20, 0x000001, 0x000001, 0) end
function sendUpdate(text) table.insert(log, text) updateLog() end
function addData() for p in pairs(tfm.get.room.playerList) do table.insert(clasament, "<CH>[<VP>"..points[p].."p<CH>] <J>"..p.."<BL>") table.sort(clasament, function(a, b) return a > b end) end end
function eventTextAreaCallback (id, p, name) if id==101 then openLog(p) end if id==3 then update(p) end if id==2 then ui.removeTextArea(2, p) ui.removeTextArea(1, p) end end
function eventPlayerDied(p) if inTable(players, p) == true then tfm.exec.respawnPlayer(p) end end

if mapaAsteptare~=0 then table.insert(maps, mapaAsteptare) nrRunde=table.count(maps)-1
else nrRunde=table.count(maps) end

function eventNewPlayer(p)
if inTable(admins, p) then table.insert(players, p) end
points[p]=0 bootcamp_time[p]=0 bootcamp_bestTime[p]=0
openLog(p)
updateScore(p)
end

function eventNewGame()
for p in pairs(tfm.get.room.playerList) do
if bootcamp_bestTime[p]==bestTime then
points[p]=points[p]+10
tfm.exec.setPlayerScore(p, points[p])
updateScore(p)
if bestTime ~= 999999 then sendUpdate("<ROSE>• <J><b>"..p.."</b><ROSE> a obținut cel mai bun timp pe mapa precedentă (<J><b>"..bestTime.."s</b><ROSE>), câștigând <J><b>10 puncte</b><ROSE>!")
else sendUpdate("<V>• Din păcate, nimeni nu a reușit să completeze mapa runda trecută.") end
break
end
end
tfm.exec.setGameTime(361)
for p in pairs(tfm.get.room.playerList) do
bootcamp_time[p]=999999
bootcamp_bestTime[p]=999999
end

bestTime=999999
rounds=rounds+1
tfm.exec.setUIMapName("Runda: <b>"..rounds.."</b> / "..nrRunde)

if rounds>nrRunde then
tfm.exec.setUIMapName("Mapa de așteptare")
tfm.exec.setGameTime(99999)
sendUpdate("<ROSE>• Concursul de Bootcamp s-a încheiat.")
for p in pairs(tfm.get.room.playerList) do
system.loadPlayerData(p)
table.insert(clasament, "<CH>[<VP>"..points[p].."p<CH>] <J>"..p.."<BL>")
table.sort(clasament, function(a, b) return a > b end)
ui.addTextArea(3, "<ROSE><b><a href='event:clasament'>CLASAMENT</a>", p, 350, 20, 80, 20, 0x000001, 0x000001, 0.5)
end
end
end

function eventLoop(c, r)
if r<=1 then
tfm.exec.newGame(maps[1])
table.remove(maps, 1)
end
end

function eventChatCommand(p, message)
if inTable(admins, p) then local arg = {} for argument in message:gmatch ("[^%s]+") do table.insert(arg, argument); end

if arg[1]=="reset" and arg[2] then
points[arg[2]]=0
bootcamp_time[arg[2]]=0
bootcamp_bestTime[arg[2]]=0
tfm.exec.setPlayerScore(arg[2], 0)
updateScore(arg[2])
sendUpdate("<V>• Punctele au fost resetate pentru <J><b>"..arg[2].."</b><V>.")
end

if arg[1]=="time" then
tfm.exec.setGameTime(arg[2])
end

if arg[1]=="next" then
tfm.exec.newGame(maps[1])
table.remove(maps, 1)
end

if arg[1]=="resetAll" then
for n in pairs(tfm.get.room.playerList) do
points[n]=0
bootcamp_time[n]=0
bootcamp_bestTime[n]=0
tfm.exec.setPlayerScore(n, 0)
updateScore(n)
end
sendUpdate("<V>• Punctele au fost resetate pentru toată lumea.")
end
end
end

function eventPlayerWon(p, tE, tER)
if rounds<=nrRunde then
tER=tER/100
bootcamp_time[p]=tER
points[p]=points[p]+1
tfm.exec.setPlayerScore(p, points[p])
updateScore(p)

if bootcamp_time[p]<=bootcamp_bestTime[p] then
if bootcamp_bestTime[p]~=999999 then sendUpdate("<CH>• <J><b>"..p.."</b><CH> și-a întrecut recordul cu <J><b>"..bootcamp_bestTime[p]-bootcamp_time[p].."s</b><CH>!", p) end
bootcamp_bestTime[p]=bootcamp_time[p]
end

if tER<bestTime then
if bestTime~=999999 then sendUpdate("<V>• <J><b>"..p.."</b><V> are nou record de <J><b>"..tER.."s</b><V> (Record anterior: <J><b>"..bestTime.."s</b><V>)") end
bestTime=tER
end

sendUpdate("<VP>• <J><b>"..p.."</b><VP> a intrat în gaură în <J><b>"..tER.."s</b><VP> și a primit <J><b>1p</b><VP>!")
tfm.exec.respawnPlayer(p)
end
end

for p in pairs(tfm.get.room.playerList) do eventNewPlayer(p) end

tfm.exec.newGame(maps[1])
table.remove(maps, 1)

for i, v in ipairs({"next", "time", "reset", "resetAll"}) do system.disableChatCommandDisplay(v) end


Istoricul schimbărilor

  • 12.08.2017 (v1.0.public) - Lansarea oficială a primei versiuni publice a scriptului

Dernière modification le 1517947560000
Tucancitto
« Citoyen »
1502485620000
    • Tucancitto#4143
    • Profil
    • Derniers messages
    • Tribu
#2
  0
Ayyyy, mulţumim, aşteptam de mult timp!! *-*
Anie
« Censeur »
1502487900000
    • Anie#7777
    • Profil
    • Derniers messages
    • Tribu
#3
  0
bravo magic pentru thread
nici n-am citit despre ce e vorba si probabil nu o voi face dar te felicit pentru munca depusa si ajutorul oferit planetei pe parcursul-
script de concurs zici huh
Awfullies
« Censeur »
1502492280000
    • Awfullies#6351
    • Profil
    • Derniers messages
    • Tribu
#4
  0
Frumos! !!
Antoniovesel
« Censeur »
1502521740000
    • Antoniovesel#0000
    • Profil
    • Derniers messages
#5
  0
multumim magic!!
Lisa_w
« Citoyen »
1502524560000
    • Lisa_w#5418
    • Profil
    • Derniers messages
    • Tribu
#6
  0
mulțumim!!
Alexxx27
« Censeur »
1502529060000
    • Alexxx27#0000
    • Profil
    • Derniers messages
    • Tribu
#7
  0
Multumim! :)

Dernière modification le 1502529120000
Ceapasy
« Censeur »
1502530800000
    • Ceapasy#4992
    • Profil
    • Derniers messages
    • Tribu
#8
  0
Cookiez pt script, ms!
Orb
« Censeur »
1502543160000
    • Orb#0095
    • Profil
    • Derniers messages
    • Tribu
#9
  4
Script-ul pentru Bootcamp a fost postat!

Sistemul este același ca și cel din timpul Aniversării RO. Deoarece am primit unele sugestii referitoare la modul de acordare a punctelor (Farm), vrem să vă invităm să vă spuneți părerea despre cum ar trebui să se acorde punctele pentru ca concursul să fie cât mai fair pentru toată lumea!

De asemenea, am actualizat script-ul de la Survivor la versiunea 1.0.1.public cu următoarea schimbare:
  • Am actualizat textele pentru a ocupa mai puțin spațiu în Activitatea Concursului
Antoniovesel
« Censeur »
1502784480000
    • Antoniovesel#0000
    • Profil
    • Derniers messages
#10
  0
multumim magicc!
foarte frumos!!

Dernière modification le 1502784540000
Whitesound
« Citoyen »
1512846300000
    • Whitesound#0220
    • Profil
    • Derniers messages
#11
  0
scriptul de racing va mai devenii public?
Orb
« Censeur »
1512907080000
    • Orb#0095
    • Profil
    • Derniers messages
    • Tribu
#12
  1
Din pacate, nu prea mai am timp sa-l repar. Insa o sa incerc sa-mi iau o zi libera si sa ma uit peste, dar asta in preajma Craciunului.
Wazzy
« Citoyen »
1514570100000
    • Wazzy#5563
    • Profil
    • Derniers messages
#13
  0
Frumos !
Zet_x
« Censeur »
1518722040000
    • Zet_x#0000
    • Profil
    • Derniers messages
#14
  0
Așteptam un script de versus pentru Survivor, Mulțumesc!
Whitesound
« Citoyen »
1525719000000
    • Whitesound#9254
    • Profil
    • Derniers messages
    • Tribu
#15
  0
Pot sugera un update la script-ul de bootcamp editat de mine?
Orb
« Censeur »
1526055240000
    • Orb#0095
    • Profil
    • Derniers messages
    • Tribu
#16
  0
Whitesound a dit :
Pot sugera un update la script-ul de bootcamp editat de mine?

Desigur :)
Whitesound
« Citoyen »
1526060580000
    • Whitesound#9254
    • Profil
    • Derniers messages
    • Tribu
#17
  0
Mici edituri însă aspectul este puțin mai frumos după mine
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
tfm.exec.disableAutoNewGame(true)
tfm.exec.disableAutoTimeLeft(true)
tfm.exec.disableAfkDeath(true)
tfm.exec.disableAutoShaman(true)
tfm.exec.disableAutoScore(true)

players={"Whitesound","Magicalwhite"}
admins={"Whitesound"}
maps={"@1726", "@1714", "@1805", "@1715", "@1483"}
mapaAsteptare=0
clasament={"<J><p align='center'><b>Clasament</b></p><V><p align='center'>Scroll pentru mai multe rezultate!</p>"}
log={"<J><p align='center'><b>Activitatea concursului</b></p>"}
points={}
bootcamp_time={}
bootcamp_bestTime={}
over=false
rounds=0
bestTime=999999
logCounter=0
names=""

function inTable(tbl, item) for key, value in pairs(tbl) do if value == item then return true end end return false end
function table.concat(tbl,delim) local str='' if delim==nil then delim='' end for k,v in pairs(tbl) do str=str..v..delim end return str end
function table.count(tbl,subtbl) local i=0 if subtbl then for k,v in pairs(tbl) do if v[subtbl] then i=i+1 end end else for _ in pairs(tbl) do i=i+1 end end return i end
function string.split(str, del) del=del or ',' local res={} for s in str:gmatch('[^'..del..']+') do table.insert(res, s) end return res end
function updateScore(p) ui.addTextArea(101, "<a href='event:openLog'><font size='18'><BV><b>"..points[p].." puncte</a>", p, 700, 370, 400, 200, 0x000001, 0x000001, 0) end
function openLog(p) if logCounter%2==0 then ui.addTextArea(100, table.concat(log, "<br/>"), p, 600, 30, 200, 200, 0x000001, 0x000001, 0.5, true) else ui.removeTextArea(100, p) end logCounter=logCounter+1 end
updateLog = function(p) if table.count(log) == 14 then table.remove(log, 2) end ui.updateTextArea(100, table.concat(log, "<br/>"), nil) end
update = function(p) ui.addTextArea(1, table.concat(clasament, "<br>"), p, 300, 50, 200, 300, 0x000001, 0x000001, 0.5) ui.addTextArea(2, "<R><b><a href='event:close'>X</a>", p, 485, 50, 20, 20, 0x000001, 0x000001, 0) end
function sendUpdate(text) table.insert(log, text) updateLog() end
function addData() for p in pairs(tfm.get.room.playerList) do table.insert(clasament, "<CH>[<VP>"..points[p].."p<CH>] <J>"..p.."<BL>") table.sort(clasament, function(a, b) return a > b end) end end
function eventTextAreaCallback (id, p, name) if id==101 then openLog(p) end if id==3 then update(p) end if id==2 then ui.removeTextArea(2, p) ui.removeTextArea(1, p) end end
function eventPlayerDied(p) if inTable(players, p) == true then tfm.exec.respawnPlayer(p) end end

if mapaAsteptare~=0 then table.insert(maps, mapaAsteptare) nrRunde=table.count(maps)-1
else nrRunde=table.count(maps) end

function eventNewPlayer(p)
if inTable(admins, p) then table.insert(players, p) end
points[p]=0 bootcamp_time[p]=0 bootcamp_bestTime[p]=0
openLog(p)
updateScore(p)
end

function eventNewGame()
for p in pairs(tfm.get.room.playerList) do
if bootcamp_bestTime[p]==bestTime then
if bestTime ~=999999 then
points[p]=points[p]+5
else
tfm.exec.setPlayerScore(p, points[p])
updateScore(p)
if bestTime ~= 999999 then sendUpdate("<ROSE>• <J><b>"..p.."</b><ROSE> a obținut cel mai bun timp pe mapa precedentă (<J><b>"..bestTime.."s</b><ROSE>), câstigând <J><b>5 puncte</b><ROSE>!")
else sendUpdate("<V>• Din păcate, nimeni nu a reușit să completeze mapa runda trecută.") end
break
end
end
end
tfm.exec.setGameTime(361)
for p in pairs(tfm.get.room.playerList) do
bootcamp_time[p]=999999
bootcamp_bestTime[p]=999999
end

bestTime=999999
rounds=rounds+1
tfm.exec.setUIMapName("<BV>Bootcamp Event<BL> | <J>Runda: <b>"..rounds.."</b> / "..nrRunde)

if rounds>nrRunde then
tfm.exec.setUIMapName("Mapa de așteptare")
tfm.exec.setGameTime(99999)
sendUpdate("<ROSE>• Concursul de Bootcamp s-a încheiat.")
for p in pairs(tfm.get.room.playerList) do
system.loadPlayerData(p)
table.insert(clasament, "<CH>[<VP>"..points[p].."p<CH>] <J>"..p.."<BL>")
table.sort(clasament, function(a, b) return a > b end)
ui.addTextArea(3, "<ROSE><b><a href='event:clasament'>CLASAMENT</a>", p, 350, 20, 80, 20, 0x000001, 0x000001, 0.5)
end
end
end

function eventLoop(c, r)
if r<=1 then
tfm.exec.newGame(maps[1])
table.remove(maps, 1)
end
end


function eventChatCommand(p, message)
if inTable(admins, p) then local arg = {} for argument in message:gmatch ("[^%s]+") do table.insert(arg, argument); end

if arg[1]=="reset" and arg[2] then
points[arg[2]]=0
bootcamp_time[arg[2]]=0
bootcamp_bestTime[arg[2]]=0
tfm.exec.setPlayerScore(arg[2], 0)
updateScore(arg[2])
sendUpdate("<V>• Punctele au fost resetate pentru <J><b>"..arg[2].."</b><V>.")
end

if arg[1]=="time" then
tfm.exec.setGameTime(arg[2])
end

if arg[1]=="next" then
tfm.exec.newGame(maps[1])
table.remove(maps, 1)
end



if arg[1]=="resetAll" then
for n in pairs(tfm.get.room.playerList) do
points[n]=0
bootcamp_time[n]=0
bootcamp_bestTime[n]=0
tfm.exec.setPlayerScore(n, 0)
updateScore(n)
end
sendUpdate("<V>• Punctele au fost resetate pentru toată lumea.")
end
end
end

function eventPlayerWon(p, tE, tER)
if rounds<=nrRunde then
tER=tER/1000
bootcamp_time[p]=tER
points[p]=points[p]+1
tfm.exec.setPlayerScore(p, points[p])
updateScore(p)

if bootcamp_time[p]<=bootcamp_bestTime[p] then
if bootcamp_bestTime[p]~=999999 then sendUpdate("<CH>• <J><b>"..p.."</b><CH> și-a întrecut recordul cu <J><b>"..bootcamp_bestTime[p]-bootcamp_time[p].."s</b><CH>!", p) end
bootcamp_bestTime[p]=bootcamp_time[p]
end

if tER<bestTime then
if bestTime~=999999 then sendUpdate("<V>• <J><b>"..p.."</b><V> are nou record de <J><b>"..tER.."s</b><V> (Record anterior: <J><b>"..bestTime.."s</b><V>)") end
bestTime=tER
end

sendUpdate("<VP>• <J><b>"..p.."</b><VP> a intrat în gaură în <J><b>"..tER.."s</b><VP> și a primit <J><b>1p</b><VP>!")
tfm.exec.respawnPlayer(p)
end
end

for p in pairs(tfm.get.room.playerList) do eventNewPlayer(p) end

tfm.exec.newGame(maps[1])
table.remove(maps, 1)

for i, v in ipairs({"next", "time", "reset", "resetAll"}) do system.disableChatCommandDisplay(v) end
Orb
« Censeur »
1528383300000
    • Orb#0095
    • Profil
    • Derniers messages
    • Tribu
#18
  0
Poti sa spui ce anume ai schimbat (in afara de aspect), te rog?
  • Forums
  • /
  • Transformice
  • /
  • Modules
  • /
  • [Script] [Aniversare RO] Concursul de Survivor și Bootcamp
© Atelier801 2018

Equipe Conditions Générales d'Utilisation Politique de Confidentialité Contact

Version 1.27