Raised This Month: $51 Target: $400
 12% 

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


Post New Thread Reply   
 
Thread Tools Display Modes
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.
amir saiaoud
Senior Member
Join Date: May 2015
Location: essaouira , maroc
Old 12-10-2015 , 04:39   Re: [Tutorial] Tenth lesson in a series develop [ZPA 1.61] - Add Countdown Timer.
Reply With Quote #2

arvEL.-
we already have This
__________________
amir saiaoud is offline
Send a message via Skype™ to amir saiaoud
iLlegalzp
Member
Join Date: Dec 2015
Location: Burgas
Old 12-10-2015 , 05:20   Re: [Tutorial] Tenth lesson in a series develop [ZPA 1.61] - Add Countdown Timer.
Reply With Quote #3

arvEL. Would you tell me how to add only the timer without the souds ?
__________________
iLlegalzp is offline
Send a message via Skype™ to iLlegalzp
arvEL.
Senior Member
Join Date: Dec 2014
Location: Iraq
Old 12-10-2015 , 09:00   Re: [Tutorial] Tenth lesson in a series develop [ZPA 1.61] - Add Countdown Timer.
Reply With Quote #4

Quote:
Originally Posted by amir saiaoud View Post
arvEL.-
we already have This
omG this have alot of files :/
and this just some lines.
__________________
arvEL. is offline
Send a message via Skype™ to arvEL.
arvEL.
Senior Member
Join Date: Dec 2014
Location: Iraq
Old 12-10-2015 , 09:03   Re: [Tutorial] Tenth lesson in a series develop [ZPA 1.61] - Add Countdown Timer.
Reply With Quote #5

Quote:
Originally Posted by iLlegalzp View Post
arvEL. Would you tell me how to add only the timer without the souds ?
well. first replace this codes:

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);

and put:

PHP Code:
public countdown()
{    
    if (
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);

and remove all 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"
__________________
arvEL. is offline
Send a message via Skype™ to arvEL.
iLlegalzp
Member
Join Date: Dec 2015
Location: Burgas
Old 12-12-2015 , 10:02   Re: [Tutorial] Tenth lesson in a series develop [ZPA 1.61] - Add Countdown Timer.
Reply With Quote #6

Quote:
Originally Posted by arvEL. View Post
well. first replace this codes:

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);

and put:

PHP Code:
public countdown()
{    
    if (
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);

and remove all 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"

I got errors

// D:\OriginalZM\cstrike\addons\amxmodx\scriptin g\ZombieWorld.sma(1350) : warning 217: loose indentation
// D:\OriginalZM\cstrike\addons\amxmodx\scriptin g\ZombieWorld.sma(1806) : warning 203: symbol is never used: "countdown_timer"
// D:\OriginalZM\cstrike\addons\amxmodx\scriptin g\ZombieWorld.sma(1845) : error 017: undefined symbol "countdown_timer"
// D:\OriginalZM\cstrike\addons\amxmodx\scriptin g\ZombieWorld.sma(1845) : warning 215: expression has no effect
// D:\OriginalZM\cstrike\addons\amxmodx\scriptin g\ZombieWorld.sma(13347) : error 017: undefined symbol "countdown_timer"
// D:\OriginalZM\cstrike\addons\amxmodx\scriptin g\ZombieWorld.sma(13350) : error 017: undefined symbol "countdown_timer"
// D:\OriginalZM\cstrike\addons\amxmodx\scriptin g\ZombieWorld.sma(13351) : error 017: undefined symbol "countdown_timer"
// D:\OriginalZM\cstrike\addons\amxmodx\scriptin g\ZombieWorld.sma(13354) : error 017: undefined symbol "countdown_timer"
// D:\OriginalZM\cstrike\addons\amxmodx\scriptin g\ZombieWorld.sma(13354 -- 13355) : error 022: must be lvalue (non-constant)
// D:\OriginalZM\cstrike\addons\amxmodx\scriptin g\ZombieWorld.sma(13355) : error 017: undefined symbol "countdown_timer"
// D:\OriginalZM\cstrike\addons\amxmodx\scriptin g\ZombieWorld.sma(13355) : fatal error 107: too many error messages on one line


Line 1350 - http://snag.gy/dJODZ.jpg

Line 1806 - http://snag.gy/75Gyv.jpg

Line 1845 - http://snag.gy/OieF3.jpg

Line 13347 - http://snag.gy/OIdt0.jpg

Line 13350 - http://snag.gy/wgxgZ.jpg

Line 13351 - http://snag.gy/splut.jpg

Line 13355 - http://snag.gy/0MhwT.jpg
__________________

Last edited by iLlegalzp; 12-12-2015 at 10:04.
iLlegalzp is offline
Send a message via Skype™ to iLlegalzp
iLlegalzp
Member
Join Date: Dec 2015
Location: Burgas
Old 12-13-2015 , 04:54   Re: [Tutorial] Tenth lesson in a series develop [ZPA 1.61] - Add Countdown Timer.
Reply With Quote #7

Some help ?
__________________
iLlegalzp is offline
Send a message via Skype™ to iLlegalzp
Chihuahuax
Senior Member
Join Date: Oct 2014
Location: Malaysia
Old 12-13-2015 , 07:07   Re: [Tutorial] Tenth lesson in a series develop [ZPA 1.61] - Add Countdown Timer.
Reply With Quote #8

PHP Code:
new countdown_timer 
Chihuahuax is offline
Send a message via Skype™ to Chihuahuax
Old 12-13-2015, 08:52
iLlegalzp
This message has been deleted by iLlegalzp. Reason: I fixed them
Reply



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 07:35.


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