English LVL SYSTEM

5 replies
Goto Page
To the start Previous 1 Next To the start
14.03.12 02:50:50 am
Up
Jhony
User
Offline Off
Hey , Guy Create Please?

√ 10 KILLS = LEVEL 1
√ LEVEL 1 = UNLOCK WEAPON M4A1
Help Me Please

And when the player exits of server
√ Save the Level of Player
> help ? :p
14.03.12 04:06:30 am
Up
MikuAuahDark
User
Offline Off
it's hard, maybe this one can help file cs2d Point system v0.4.2 (7) it can save player status
file cs2d LuaJIT for Dedicated Server (11) JIT POWER! | Know your Lua errors! | Draw stuff at Pixelize Art --xx-- server!
14.03.12 05:49:28 am
Up
Yamaxanadu
User
Offline Off
y u no english?

There's a couple of level scripts in the file archive, just use the search function
Back in business, and I'll try not to be the Enigmatic asshole that i used to be....I hope
14.03.12 07:35:57 am
Up
Alistaire
User
Offline Off
I could make first part but not a save function.
IMG:http://i.imgur.com/5zhwOTP.png
14.03.12 10:24:04 am
Up
Tobey
User
Offline Off
signature too huge
15.03.12 09:27:45 pm
Up
Avo
User
Offline Off
@user Jhony:
Saving isn't easy, try to do it without saving first.

Code:
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
function array(m,v)
     local array = {}
     for i = 1, m do
          array[i]=v
     end
     return array
end

level=array(32,1)     --1 is start level
kills=array(32,0)
levelup=10          --levelup every 10 kills
weapons={24,32,47}          --24(ump45)for 1st lvl, 32(m4a1) for 2nd lvl, 47(rpg) for 3rd lvl etc...

addhook("kill","onkill")
function onkill(killer,victim)
     if killer~=victim then
          kills[killer]=kills[killer]+1     --you won't get points for killing yourself!
     end
     if kills==levelup[lvl] then
          level[killer]=level[killer]+1
          kills[killer]=0
          msg2(killer,"================>Level up to level: "..level[killer].." !!!")
     end
end

addhook("spawn","onspawn")
function onspawn(id)
     local lvl=level[id]
     local max=#weapons
     if weapons[id]==nil then
          parse("equip "..id.." "weapons[max])     --weapon of max level if player has got higher level than max index of weapons table
     else
          parse("equip "..id.." "weapons[lvl])
     end
end

addhook("leave","onleave")
function onleave(id)
     level[id]=0
     kills[id]=0
end


Not tested, should work. Here start level is 1, no 0. And on level 2 you unlock m4a1, on 3 - RPG launcher. :P. Edit table 'weapons' to change weapons for each level.


If you really want script with saving system just search the file archive.
edited 2×, last 15.03.12 10:05:41 pm
To the start Previous 1 Next To the start