|
Author
|
Message
|
|
Senior Member
Join Date: Dec 2014
Location: Iraq
|

12-09-2015
, 15:55
[Tutorial] Tenth lesson in a series develop [ZPA 1.61] - Add Countdown Timer.
|
#1
|
Tenth Lesson Add (Countdown)
- all rights reserved to arvEL.-, in : 9/12/2015 In these lesson i will explain how to develop [Zombie Plague Advance v1.6.1]
add hud message, countdown timer.
first go to this topic [ # ] and download[ZPA 1.6.1]
after that open the file [zombie_plague_advance_v1-6-1.sma] in [notepad++]
first press [Ctrl + F] and find this line:
PHP Code:
// message sync objects
it's have this codes:
PHP Code:
new g_MsgSync, g_MsgSync2 , g_MsgSync3 // message sync objects
replace all codes to:
PHP Code:
new g_MsgSync, g_MsgSync2 , g_MsgSync3 , g_msgsync // message sync objects
now inside public plugin_init() put this line:
PHP Code:
g_msgsync = CreateHudSyncObj()
now add this variable
PHP Code:
new countdown_timer
after that press [Ctrl + F] and find this line:
PHP Code:
public event_round_start()
put inside it this codes:
PHP Code:
// countdown remove_task(1603); countdown_timer = 10 - 1; set_task(4.0, "countdown", 1603);
now. put this codes in any place inside ZPA.sma main.
PHP Code:
public countdown() { new speak[16][] = { "fvox/biohazard_detected.wav", "fvox/one.wav", "fvox/two.wav", "fvox/three.wav", "fvox/four.wav", "fvox/five.wav", "fvox/six.wav", "fvox/seven.wav", "fvox/eight.wav", "fvox/nine.wav", "fvox/ten.wav", "fvox/eleven.wav", "fvox/twelve.wav", "fvox/thirteen.wav", "fvox/fourteen.wav", "fvox/fifteen.wav" }
if (countdown_timer > 1) { client_cmd(0, "spk %s", speak[countdown_timer-1]); set_hudmessage(179, 0, 0, -1.0, 0.28, 2, 0.02, 1.0, 0.01, 0.1, 10); if (countdown_timer != 1) ShowSyncHudMsg(0, g_msgsync, "Infection in %i", countdown_timer-1); //the new way }
--countdown_timer; if(countdown_timer >= 1) set_task(1.0, "countdown", 1603); else remove_task(1603); }
now press [Ctrl + F] and find this line:
PHP Code:
public plugin_precache()
put inside it this codes:
PHP Code:
precache_sound("fvox/biohazard_detected.wav") precache_sound("fvox/one.wav") precache_sound("fvox/two.wav") precache_sound("fvox/three.wav") precache_sound("fvox/four.wav") precache_sound("fvox/five.wav") precache_sound("fvox/six.wav") precache_sound("fvox/seven.wav") precache_sound("fvox/eight.wav") precache_sound("fvox/nine.wav") precache_sound("fvox/ten.wav") precache_sound("fvox/eleven.wav") precache_sound("fvox/twelve.wav") precache_sound("fvox/thirteen.wav") precache_sound("fvox/fourteen.wav") precache_sound("fvox/fifteen.wav")
now make compile and ejnoy 
all rights reserved to arvEL.-
__________________
|
|
|
|