Forum

> > CS2D > Scripts > [RELEASED] Achievements and Statistics Script
Forums overviewCS2D overview Scripts overviewLog in to reply

English [RELEASED] Achievements and Statistics Script

262 replies
Page
To the start Previous 1 211 12 13 14 Next To the start

Poll Poll

Do you like the idea of the script?

Only registered users are allowed to vote
No, it is nothing new
4.17% (3)
Yes
95.83% (69)
72 votes cast

old Re: [RELEASED] Achievements and Statistics Script

SQ
Moderator Off Offline

Quote
Am, you could suggest me to add Language file, so it would be easier to change everything. However there aren't many words to change in the code except for the achievements.

old Re: [RELEASED] Achievements and Statistics Script

mrc
User Off Offline

Quote
I've trying add this for testing:

increased 5 to 6
1
GAMEMODE_ALL = 6

1
AddAchievement("M4A1 Expert", GAMEMODE_ALL,"gfx/stats/a/m4a1_expert.jpg",{"Kill 2 enemies", "with the M4A1"},"M4A1 Expert",kill_m4a1_process)

I've set low values just for testing
1
2
3
4
5
6
7
8
9
10
11
12
13
-- ==== M4A1 Expert
function kill_m4a1(killer,victim,w)
	if (w == 32) then -- m4a1
		IncreaseUserValue(killer,"M4A1",1)
	end
	if GetUserValue(killer,"M4A1") > 1 then
		OpenUnlockAchievement(killer,"M4A1Expert")
	end
end

function kill_m4a1_process(id)
	return(GetUserValue(id,"M4A1") / 2)
end

old Re: [RELEASED] Achievements and Statistics Script

SQ
Moderator Off Offline

Quote
1
GAMEMODE_ALL = 6

It's a constant, you may not change it. It must be 5.

Also you have forgot to initialize user value.

1
AddValue("M4A1")

Also I suggest having code like this, it requires less performance.
1
2
3
4
5
6
7
8
9
-- ==== M4A1 Expert
function kill_m4a1(killer,victim,w)
	if (w == 32) then
		IncreaseUserValue(killer,"M4A1",1)
		if GetUserValue(killer,"M4A1") > 1 then
			OpenUnlockAchievement(killer,"M4A1Expert")
		end
	end
end
To the start Previous 1 211 12 13 14 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview