Raised This Month: $ Target: $400
 0% 

[Tutorial] Tenth lesson in a series develop [ZPA 1.61] - Add Countdown Timer.


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
arvEL.
Senior Member
Join Date: Dec 2014
Location: Iraq
Old 12-09-2015 , 15:55   [Tutorial] Tenth lesson in a series develop [ZPA 1.61] - Add Countdown Timer.
Reply With Quote #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_MsgSyncg_MsgSync2 g_MsgSync3 // message sync objects 
replace all codes to:

PHP Code:
new g_MsgSyncg_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(17900, -1.00.2820.021.00.010.110);    
    if (
countdown_timer != 1)
    
ShowSyncHudMsg(0g_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.-


__________________
arvEL. is offline
Send a message via Skype™ to arvEL.
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 23:15.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode