AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Suggestions / Requests (https://forums.alliedmods.net/forumdisplay.php?f=12)
-   -   Explosive Grenade Chat (https://forums.alliedmods.net/showthread.php?t=335074)

SHIFT0 11-06-2021 14:41

Explosive Grenade Chat
 
Hi guys this script from @Supremache
I want when 20seconds finish
all CT Listen a music called " Taktucal nuke ready, turn a key " cstrike/sound/ReadyHE.mp3
and in chat too

!g[Zombie Unique] !y*** Now you can use High Explosive Grenade ***

PHP Code:

#include <amxmodx>
#include <fun>

new g_Time;

public 
plugin_init()
{
    
register_plugin("Give grenade after 20 secound""1.0""Supremache"); 
    
register_logevent"LogEventRoundStart"2"1=Round_Start" )
    
    
g_Time register_cvar("amx_give_he_time""20");
}

public 
LogEventRoundStart()
{
    
set_task(get_pcvar_float(g_Time),"GiveHeGrenades",789123)
}

public 
GiveHeGrenades()
{
    new 
iPlayers[32], iHnum
    get_players
(iPlayersiHnum"ae""CT"
    
    for( new 
iPlayer0iHnumi++ )
    {
        
iPlayer iPlayers[i]
        
give_item(iPlayer,"weapon_hegrenade")
        
set_hudmessage255000.090.0010.51.00.515.0, -1)
        
show_hudmessage0"*** Now you can use High Explosive Grenade ***")
    }



yRemootz 11-06-2021 19:38

Re: Explosive Grenade Chat
 
Quote:

Originally Posted by SHIFT0 (Post 2762674)
Hi guys this script from @Supremache
I want when 20seconds finish
all CT Listen a music called " Taktucal nuke ready, turn a key " cstrike/sound/ReadyHE.mp3
and in chat too

!g[Zombie Unique] !y*** Now you can use High Explosive Grenade ***

PHP Code:

#include <amxmodx>
#include <fun>

new g_Time;

public 
plugin_init()
{
    
register_plugin("Give grenade after 20 secound""1.0""Supremache"); 
    
register_logevent"LogEventRoundStart"2"1=Round_Start" )
    
    
g_Time register_cvar("amx_give_he_time""20");
}

public 
LogEventRoundStart()
{
    
set_task(get_pcvar_float(g_Time),"GiveHeGrenades",789123)
}

public 
GiveHeGrenades()
{
    new 
iPlayers[32], iHnum
    get_players
(iPlayersiHnum"ae""CT"
    
    for( new 
iPlayer0iHnumi++ )
    {
        
iPlayer iPlayers[i]
        
give_item(iPlayer,"weapon_hegrenade")
        
set_hudmessage255000.090.0010.51.00.515.0, -1)
        
show_hudmessage0"*** Now you can use High Explosive Grenade ***")
    }



Alright, so, you need add the
PHP Code:

client_print_color(iPlayerprint_team_default"^4[Zombie Unique]^1 *** Now you can use High Explosive Grenade ***" 

under the show_hudmessage I'm sure about that.
About the sound, I think it's:

PHP Code:

#include <amxmodx>
#include <fun>

new g_Time;
new 
String:g_szReadyHE[96] = "cstrike/sound/ReadyHE.mp3"// Constant of the sound

public plugin_init()
{
    
register_plugin("Give grenade after 20 secound""1.1""Supremache"); 
    
register_logevent"LogEventRoundStart"2"1=Round_Start" )
    
    
g_Time register_cvar("amx_give_he_time""20");
}

public 
plugin_precache() // Precaching the sound 
{
    
precache_sound(g_szReadyHE)
}

public 
LogEventRoundStart()
{
    
set_task(get_pcvar_float(g_Time),"GiveHeGrenades",789123)
}

public 
GiveHeGrenades()
{
    new 
iPlayers[32], iHnum
    get_players
(iPlayersiHnum"ae""CT"
    
    for( new 
iPlayer0iHnumi++ )
    {
        
iPlayer iPlayers[i]
        
give_item(iPlayer,"weapon_hegrenade")
        
set_hudmessage255000.090.0010.51.00.515.0, -1)
        
show_hudmessage0"*** Now you can use High Explosive Grenade ***")
        
client_print_color(iPlayerprint_team_default"^4[Zombie Unique]^1 *** Now you can use High Explosive Grenade ***"g_szReadyHE// Here's the code of the chat.
    
}


/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ ansicpg1252\\ deff0\\ deflang1036{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ f0\\ fs16 \n\\ par }
*/ 

If the sound didn't work, contact another experienced programmer, because I'm starting out as a programmer, so I don't know many things. Or, use only the chat with this code:

PHP Code:

#include <amxmodx>
#include <fun>

new g_Time;

public 
plugin_init()
{
    
register_plugin("Give grenade after 20 secound""1.1""Supremache"); 
    
register_logevent"LogEventRoundStart"2"1=Round_Start" )
    
    
g_Time register_cvar("amx_give_he_time""20");
}

public 
LogEventRoundStart()
{
    
set_task(get_pcvar_float(g_Time),"GiveHeGrenades",789123)
}

public 
GiveHeGrenades()
{
    new 
iPlayers[32], iHnum
    get_players
(iPlayersiHnum"ae""CT"
    
    for( new 
iPlayer0iHnumi++ )
    {
        
iPlayer iPlayers[i]
        
give_item(iPlayer,"weapon_hegrenade")
        
set_hudmessage255000.090.0010.51.00.515.0, -1)
        
show_hudmessage0"*** Now you can use High Explosive Grenade ***")
        
client_print_color(iPlayerprint_team_default"^4[Zombie Unique]^1 *** Now you can use High Explosive Grenade ***"// Here's the code of the chat.
    
}


/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ ansicpg1252\\ deff0\\ deflang1036{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ f0\\ fs16 \n\\ par }
*/ 

Make SURE you're using the include's when compile it.

SHIFT0 11-07-2021 06:03

Re: Explosive Grenade Chat
 
Done this plugin solved by my friend !


All times are GMT -4. The time now is 13:50.

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