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

[FIXED][ZP] ScreenShake when the round Ends


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
T0pARG
Junior Member
Join Date: Jun 2019
Old 06-29-2019 , 11:09   [FIXED][ZP] ScreenShake when the round Ends
Reply With Quote #1

Hi everbody i'm new in this website, i tried add ScreenShake, but the server its down!

Help me please!!

Last edited by T0pARG; 07-02-2019 at 12:14.
T0pARG is offline
<VeCo>
Veteran Member
Join Date: Jul 2009
Location: Bulgaria
Old 06-29-2019 , 12:09   Re: [ZP] ScreenShake when the round Ends
Reply With Quote #2

what exactly did you try
__________________
<VeCo> is offline
T0pARG
Junior Member
Join Date: Jun 2019
Old 06-29-2019 , 14:12   Re: [ZP] ScreenShake when the round Ends
Reply With Quote #3

PHP Code:
public Sshake(id)
{
    
message_begin(MSG_ONE_UNRELIABLEg_msgScreenShake_id)
    
write_short(UNIT_SECOND*10// amplitude
    
write_short(UNIT_SECOND*6// duration
    
write_short(UNIT_SECOND*10// frequency
    
message_end()

I want to add this, but idk where, I was did it here

PHP Code:
// Show HUD notice, play win sound, update team scores...
    
static sound[64]
    if (!
fnGetZombies())
    {
        
        
// Play win sound and increase score, unless game commencing
        
ArrayGetString(sound_win_humansrandom_num(0ArraySize(sound_win_humans) - 1), soundcharsmax(sound))
        
PlaySound(sound)
        if (!
g_gamecommencingg_scorehumans++
                
        
// Round end forward
        
ExecuteForward(g_fwRoundEndg_fwDummyResultZP_TEAM_HUMAN);
    }
    else if (!
fnGetHumans())
    {
        
        
// Play win sound and increase score, unless game commencing
        
ArrayGetString(sound_win_zombiesrandom_num(0ArraySize(sound_win_zombies) - 1), soundcharsmax(sound))
        
PlaySound(sound)
        if (!
g_gamecommencingg_scorezombies++
        
        
// Round end forward
        
ExecuteForward(g_fwRoundEndg_fwDummyResultZP_TEAM_ZOMBIE);
    }
    else
    {
        
// No one wins
        
set_hudmessage(02000HUD_EVENT_XHUD_EVENT_Y00.03.02.01.0, -1)
        
ShowSyncHudMsg(0g_MsgSync"%L"LANG_PLAYER"WIN_NO_ONE")
        
        
// Play win sound
        
ArrayGetString(sound_win_no_onerandom_num(0ArraySize(sound_win_no_one) - 1), soundcharsmax(sound))
        
PlaySound(sound)
        
        
// Round end forward
        
ExecuteForward(g_fwRoundEndg_fwDummyResultZP_TEAM_NO_ONE);
    } 
But the game doesn't works and closes it

Last edited by T0pARG; 06-29-2019 at 14:13.
T0pARG is offline
<VeCo>
Veteran Member
Join Date: Jul 2009
Location: Bulgaria
Old 06-29-2019 , 15:27   Re: [ZP] ScreenShake when the round Ends
Reply With Quote #4

There is no player index in the function you provided, use this to send it to all players:
PHP Code:
public Sshake()
{
    
message_begin(MSG_BROADCASTg_msgScreenShake)
    
write_short(UNIT_SECOND*10// amplitude
    
write_short(UNIT_SECOND*6// duration
    
write_short(UNIT_SECOND*10// frequency
    
message_end()

__________________

Last edited by <VeCo>; 06-29-2019 at 15:27.
<VeCo> is offline
T0pARG
Junior Member
Join Date: Jun 2019
Old 06-29-2019 , 19:40   Re: [ZP] ScreenShake when the round Ends
Reply With Quote #5

PHP Code:
// Show HUD notice, play win sound, update team scores...
    
static sound[64]
    if (!
fnGetZombies())
    {
        
        
// Play win sound and increase score, unless game commencing
        
ArrayGetString(sound_win_humansrandom_num(0ArraySize(sound_win_humans) - 1), soundcharsmax(sound))
        
PlaySound(sound)
        if (!
g_gamecommencingg_scorehumans++
                
        
// Round end forward
        
ExecuteForward(g_fwRoundEndg_fwDummyResultZP_TEAM_HUMAN);
    }
    else if (!
fnGetHumans())
    {
        
        
// Play win sound and increase score, unless game commencing
        
ArrayGetString(sound_win_zombiesrandom_num(0ArraySize(sound_win_zombies) - 1), soundcharsmax(sound))
        
PlaySound(sound)
        if (!
g_gamecommencingg_scorezombies++
        
        
// Round end forward
        
ExecuteForward(g_fwRoundEndg_fwDummyResultZP_TEAM_ZOMBIE);
    }
    else
    {
        
// No one wins
        
set_hudmessage(02000HUD_EVENT_XHUD_EVENT_Y00.03.02.01.0, -1)
        
ShowSyncHudMsg(0g_MsgSync"%L"LANG_PLAYER"WIN_NO_ONE")
        
        
// Play win sound
        
ArrayGetString(sound_win_no_onerandom_num(0ArraySize(sound_win_no_one) - 1), soundcharsmax(sound))
        
PlaySound(sound)
        
        
// Round end forward
        
ExecuteForward(g_fwRoundEndg_fwDummyResultZP_TEAM_NO_ONE);
    } 
where i put the
PHP Code:
Sshake 
PHP Code:
if (!fnGetZombies())
    {
        
        
// Play win sound and increase score, unless game commencing
        
ArrayGetString(sound_win_humansrandom_num(0ArraySize(sound_win_humans) - 1), soundcharsmax(sound))
        
PlaySound(sound)
        if (!
g_gamecommencingg_scorehumans++
                
        
// Round end forward
        
ExecuteForward(g_fwRoundEndg_fwDummyResultZP_TEAM_HUMAN);
        
Sshake // Here?
    


Last edited by T0pARG; 06-29-2019 at 19:41.
T0pARG is offline
<VeCo>
Veteran Member
Join Date: Jul 2009
Location: Bulgaria
Old 06-30-2019 , 05:21   Re: [ZP] ScreenShake when the round Ends
Reply With Quote #6

Use Sshake() to call the function.

if (!fnGetZombies()) is when humans win
else if (!fnGetHumans()) is when zombies win
else is when no one wins

If you want it to be called in all cases, put it under the else closing bracket, or before static sound[64], doesn't matter.. But yes, otherwise that's correct.
__________________
<VeCo> is offline
T0pARG
Junior Member
Join Date: Jun 2019
Old 06-30-2019 , 15:03   Re: [ZP] ScreenShake when the round Ends
Reply With Quote #7

I did it like you said me, but an error appears me "WriteDest_Param: not a client"
Help me please

PHP Code:
// Show HUD notice, play win sound, update team scores...
    
static sound[64]
    
Sshake // Idk where i put this!
    
if (!fnGetZombies())
    {
        
        
// Play win sound and increase score, unless game commencing
        
ArrayGetString(sound_win_humansrandom_num(0ArraySize(sound_win_humans) - 1), soundcharsmax(sound))
        
PlaySound(sound)
        if (!
g_gamecommencingg_scorehumans++
        
        
// Round end forward
        
ExecuteForward(g_fwRoundEndg_fwDummyResultZP_TEAM_HUMAN);
    }
    else if (!
fnGetHumans())
    {
        
        
// Play win sound and increase score, unless game commencing
        
ArrayGetString(sound_win_zombiesrandom_num(0ArraySize(sound_win_zombies) - 1), soundcharsmax(sound))
        
PlaySound(sound)
        if (!
g_gamecommencingg_scorezombies++
        
        
// Round end forward
        
ExecuteForward(g_fwRoundEndg_fwDummyResultZP_TEAM_ZOMBIE);
    }
    else
    {
        
// No one wins
        
set_hudmessage(02000HUD_EVENT_XHUD_EVENT_Y00.03.02.01.0, -1)
        
ShowSyncHudMsg(0g_MsgSync"%L"LANG_PLAYER"WIN_NO_ONE")
        
        
// Play win sound
        
ArrayGetString(sound_win_no_onerandom_num(0ArraySize(sound_win_no_one) - 1), soundcharsmax(sound))
        
PlaySound(sound)
        
        
// Round end forward
        
ExecuteForward(g_fwRoundEndg_fwDummyResultZP_TEAM_NO_ONE);
    } 

Last edited by T0pARG; 06-30-2019 at 15:04.
T0pARG is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 07-02-2019 , 02:40   Re: [ZP] ScreenShake when the round Ends
Reply With Quote #8

OP show all your defines (what is unit_second and g_msgScreenShake are equal to )


Use this to fix the value

PHP Code:
    FixedUnsigned16 ( const Float:Value, const Scale )
    {
        return 
clampfloatroundValue Scale ), 00xFFFF );
    } 

Use this stock instead
PHP Code:
public Sshake(idFloat:AMPFloat:DURFloat:FREQ)
{
    
message_begin(!id MSG_BROADCAST:MSG_ONE_UNRELIABLEg_msgScreenShake_id)
    
write_short(FixedUnsigned16(AMPUNIT_SECOND)) // amplitude
    
write_short(FixedUnsigned16(DURUNIT_SECOND)) // duration
    
write_short(FixedUnsigned16(FREQUNIT_SECOND)) // frequency
    
message_end()


If you have no idea where to put the code then post in the right section
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 07-02-2019 at 03:11.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
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 06:46.


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