Forum

> > CS2D > Scripts > [RELEASED] Achievements and Statistics Script
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch [RELEASED] Achievements and Statistics Script

262 Antworten
Seite
Zum Anfang Vorherige 1 211 12 13 14 Nächste Zum Anfang

Umfrage Umfrage

Do you like the idea of the script?

Nur registrierte Benutzer können abstimmen
No, it is nothing new
4,17% (3)
Yes
95,83% (69)
72 Stimmen abgegeben

alt Re: [RELEASED] Achievements and Statistics Script

mrc
User Off Offline

Zitieren
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

alt Re: [RELEASED] Achievements and Statistics Script

SQ
Moderator Off Offline

Zitieren
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
Zum Anfang Vorherige 1 211 12 13 14 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht