Dynamic Achievements and Statistics Script (2.0) 
105 comments28.11.15 03:43:30 pm

3.12 mb, 1,514 Downloads










I did contributions such as Zombie Plague, Super Hero, Gun Game and CS2D Lighting & Shadows Engine.
After being absent for a while I'm glad to say that for the last time I'm sharing with you my last CS2D contribution.
- - ==== [






- - ==== [ Installation ] ==== - -
Downloaded ZIP archive includes GFX, SFX, SYS folders that must be overwritten in CS2D. In other words, you can simply extract it in CS2D folder.
- - ==== [ Script Features ] ==== - -







- - ==== [ Rank Feature ] ==== - -




- - ==== [ Configuration Feature ] ==== - -


- - ==== [ Graph Statistics Feature ] ==== - -




- - ==== [ Sample - How to Create Statistics for a Player ] ==== - -



Code:
1
AddStats("Kills", "gfx/stats/stat/stat_kills.png",stat_kills_Variable,stat_kills_Variable,true)



Code:
1
2
3
4
5
6
7
8
9
10
11
2
3
4
5
6
7
8
9
10
11
--==== KILLS STATISTICS ====--
function stat_kills(killer,victim)
if (player(killer,"team") ~= player(victim,"team")) then
IncreaseUserValue(killer,"Kills",1)
end
end
function stat_kills_Variable(id)
return( GetUserValue(id,"Kills"))
end
AddValue("Kills")
AddFunction("kill",stat_kills)
function stat_kills(killer,victim)
if (player(killer,"team") ~= player(victim,"team")) then
IncreaseUserValue(killer,"Kills",1)
end
end
function stat_kills_Variable(id)
return( GetUserValue(id,"Kills"))
end
AddValue("Kills")
AddFunction("kill",stat_kills)
- - ==== [ Sample - How to Create Achievement ] ==== - -



Code:
1
AddAchievement("Body Bagger", GAMEMODE_ALL,"gfx/stats/a/body_bagger.jpg",{"Kill 25 enemies"},"BodyBagger",kill_BodyBaggerProcess)



Code:
1
2
3
4
5
6
7
8
9
10
2
3
4
5
6
7
8
9
10
-- ==== Body Bagger Achievement
function kill_BodyBagger(killer,victim)
if GetUserValue(killer,"Kills") > 24 then
OpenUnlockAchievement(killer,"BodyBagger")
end
end
function kill_BodyBaggerProcess(id)
return(GetUserValue(id,"Kills") / 25)
end
AddFunction("kill",kill_BodyBagger)
function kill_BodyBagger(killer,victim)
if GetUserValue(killer,"Kills") > 24 then
OpenUnlockAchievement(killer,"BodyBagger")
end
end
function kill_BodyBaggerProcess(id)
return(GetUserValue(id,"Kills") / 25)
end
AddFunction("kill",kill_BodyBagger)
- - ==== [ Sample - How to Create Server Statistics ] ==== - -



Code:
1
AddOverallStatistics("Overall Statistics",OvalDescription)



Code:
1
2
3
4
5
2
3
4
5
-- ==== Players Count Graph
function GraphPlayersCount()
SetGraphGlobalVariable("Players Played",#player(0,"table") )
end
AddGlobalFunction("second",GraphPlayersCount)
function GraphPlayersCount()
SetGraphGlobalVariable("Players Played",#player(0,"table") )
end
AddGlobalFunction("second",GraphPlayersCount)
- - ==== [ Player Achievements & Statistics Functions ] ==== - -
-- ==== [ Global Server Statistics Functions ] ==== - -
- - ==== [ Credits ] ==== - -



















edited 25×, last 24.09.19 06:42:38 pm

Comments
105 commentsLog in!
You need to log in to be able to write comments!Log in

Cool Lua Script

Admin/mod comment:


You should add 2 new files with prefix stat_ and then change method of displaying fav. weapon and fav. pistol in statistics. Here is an example why.
http://i.hizliresim.com/jnkkPn.jpg
http://i.hizliresim.com/2ZXXmj.jpg
http://i.hizliresim.com/jnkkPn.jpg
http://i.hizliresim.com/2ZXXmj.jpg
That would mean I would need to do even more achievements.
Now it takes 72 achievements to unlock all 25 ranks. That takes about 16-20 hours. All I can do is to make most already existing achievements more difficult.
Now it takes 72 achievements to unlock all 25 ranks. That takes about 16-20 hours. All I can do is to make most already existing achievements more difficult.
16.12.15 11:33:21 pm

I was planning something like this , but as I never finish my projects , thank you and congratulations. Well done


I have my own rank icon, but those are 55 icons O.o is the rank only limited to 25 or it can be expanded?
04.12.15 02:57:29 pm

You son of a bitch! What have you done?! You gave CS2D a feature I always wanted! How could you, I mean, it's.. it's beautiful! This should be implemented into the game!
Big like from me man, nice work.
Big like from me man, nice work.

This script is cool but after i play it once next time when i enter in a map the CS2D stop working. Please resolve.
(Sry for my bad english)
(Sry for my bad english)