Cerere plugin mesaje fiecarei echipa la inceput de runda

Categoria cu cereri de pluginuri si nu numai.

Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com

Forum rules
Accesează link-ul pentru a putea vedea regulile forumului

Daca doriti sa vi se modifice un plugin, va rugam postati aici .
Post Reply
User avatar
H3adShoT
Membru, skill +3
Membru, skill +3
Posts: 1254
Joined: 03 May 2009, 18:19
Detinator Steam: Da
CS Status: Nu mai incercati sa-mi furati contul!
Detinator server CS: Nimic
SteamID: PM
Reputatie: Restrictie moderator
Location: Hunedoara
Has thanked: 47 times
Been thanked: 92 times
Contact:

04 Sep 2010, 13:38

As vrea ca dupa 10 secunde de la inceperea rundei sa apara un mesaj fiecarei echipe
De exemplu la tero sa apara asa
Obiective : Tero plantati bomba si paziti-o !

la ct :
Obiective : CT paziti x / dezamorsati bomba !

Multumesc
Retras din activitate.
compaq
Fost moderator
Fost moderator
Posts: 2598
Joined: 01 Dec 2008, 15:32
Detinator Steam: Da
Reputatie: Fost eXtream Mod
Fost contribuitor
Fost manager
Fost Scripter eXtreamCS
Has thanked: 15 times
Been thanked: 150 times

04 Sep 2010, 14:43

Code: Select all

#include <amxmodx>
#include <cstrike>

#pragma semicolon 1

new const g_version[] = "0.1";

new const g_Messages[ 2 ][] =
{
    "T, plantati bomba!", // T
    "CT, paziti X" // CT
};

public plugin_init()
{
    register_plugin( "Team messages", g_version, "compaq" );
    register_event("HLTV", "eNewRound", "a", "1=0", "2=0");
}

public eNewRound()
{
    static iPlayers[ 32 ], iNum, i;
    get_players( iPlayers, iNum );

    for( i = 0; i < iNum; i++ )
    {
        switch( cs_get_user_team( iPlayers[ i ] ) )
        {
            case CS_TEAM_T:
            {
                client_print( iPlayers[ i ], print_chat, "%s", g_Messages[ 0 ] );
            }

            case CS_TEAM_CT:
            {
                client_print( iPlayers[ i ], print_chat, "%s", g_Messages[ 1 ] );
            }

            default: return PLUGIN_HANDLED;
        }
    }

    return PLUGIN_CONTINUE;
}
Afiseaza in chat.
User avatar
H3adShoT
Membru, skill +3
Membru, skill +3
Posts: 1254
Joined: 03 May 2009, 18:19
Detinator Steam: Da
CS Status: Nu mai incercati sa-mi furati contul!
Detinator server CS: Nimic
SteamID: PM
Reputatie: Restrictie moderator
Location: Hunedoara
Has thanked: 47 times
Been thanked: 92 times
Contact:

04 Sep 2010, 18:09

compaq wrote:

Code: Select all

#include <amxmodx>
#include <cstrike>

#pragma semicolon 1

new const g_version[] = "0.1";

new const g_Messages[ 2 ][] =
{
    "T, plantati bomba!", // T
    "CT, paziti X" // CT
};

public plugin_init()
{
    register_plugin( "Team messages", g_version, "compaq" );
    register_event("HLTV", "eNewRound", "a", "1=0", "2=0");
}

public eNewRound()
{
    static iPlayers[ 32 ], iNum, i;
    get_players( iPlayers, iNum );

    for( i = 0; i < iNum; i++ )
    {
        switch( cs_get_user_team( iPlayers[ i ] ) )
        {
            case CS_TEAM_T:
            {
                client_print( iPlayers[ i ], print_chat, "%s", g_Messages[ 0 ] );
            }

            case CS_TEAM_CT:
            {
                client_print( iPlayers[ i ], print_chat, "%s", g_Messages[ 1 ] );
            }

            default: return PLUGIN_HANDLED;
        }
    }

    return PLUGIN_CONTINUE;
}
Afiseaza in chat.
merge compilat , dar nu apare nici un mesaj
Retras din activitate.
User avatar
Ciprian
Fost administrator
Fost administrator
Posts: 5172
Joined: 10 May 2008, 20:29
Detinator Steam: Da
CS Status: ^^
SteamID: crazycipry
Reputatie: Fost administrator
Fost Scripter eXtreamCS
Fost Supervizor CS.eXtreamCS.com
Fost Unbanner ZM.eXtreamCS.com
Fost Contribuitor
Nume anterior: crazy.cipry
Location: Baia Mare
Has thanked: 176 times
Been thanked: 401 times
Contact:

05 Sep 2010, 16:42

| Afiseaza codul
[code=php]/* Plugin generated by AMXX-Studio */

#include < amxmodx >
#include < amxmisc >

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "Ciprian"

new g_HudMsgSync;
new const g_Messages[ 2 ][ 128 ] = {
    "Obiective : Tero plantati bomba si paziti-o !",
    "Obiective : CT paziti x / dezamorsati bomba !"
}

public plugin_init ( ) {
    register_plugin ( PLUGIN, VERSION, AUTHOR );
    
    register_event ( "HLTV", "event_new_round", "a", "1=0", "2=0" );
    
    g_HudMsgSync = CreateHudSyncObj ( );
}

public event_new_round ( ) set_task ( 10.0, "print_hud_msg" );

public print_hud_msg ( ) {
    new players[ 32], num;
    get_players ( players, num );
    
    for ( new i = 0; i < num; i ++ ) {
        new player = players[ i ];
        
        set_hudmessage ( ( get_user_team ( player ) == 1 ) ? 255 : 0, 0, ( get_user_team ( player ) == 1 ) ? 0 : 255, -1.0, 0.0, 0, 6.0, 6.0 )
        ShowSyncHudMsg ( player, g_HudMsgSync, get_user_team ( player ) == 1 ? g_Messages[ 0 ] : g_Messages[ 1 ] );
    }
    
    return PLUGIN_CONTINUE;
}
        
        
         [/code]
compaq
Fost moderator
Fost moderator
Posts: 2598
Joined: 01 Dec 2008, 15:32
Detinator Steam: Da
Reputatie: Fost eXtream Mod
Fost contribuitor
Fost manager
Fost Scripter eXtreamCS
Has thanked: 15 times
Been thanked: 150 times

06 Sep 2010, 11:25

Rezolvarea (am vorbit cu el prin PM ):
| Afiseaza codul
[code]#include <amxmodx>
#include <cstrike>

#pragma semicolon 1

new const g_version[] = "0.1";

new const g_Messages[ 2 ][] =
{
    "T, plantati bomba!", // T
    "CT, paziti X" // CT
};

new g_MsgSayText;

public plugin_init()
{
    register_plugin( "Team messages", g_version, "compaq" );
    register_event("HLTV", "eNewRound", "a", "1=0", "2=0");

    g_MsgSayText = get_user_msgid( "SayText" );
}

public eNewRound()
{
    static iPlayers[ 32 ], iNum, i;
    get_players( iPlayers, iNum );

    for( i = 0; i < iNum; i++ )
    {
        switch( cs_get_user_team( iPlayers[ i ] ) )
        {
            case CS_TEAM_T:
            {
                message_begin( MSG_ONE, g_MsgSayText, _, iPlayers[ i ] );

                write_byte( iPlayers[ i ] );
                write_string( g_Messages[ 0 ] );

                message_end();
            }

            case CS_TEAM_CT:
            {
                message_begin( MSG_ONE, g_MsgSayText, _, iPlayers[ i ] );

                write_byte( iPlayers[ i ] );
                write_string( g_Messages[ 1 ] );

                message_end();
            }

            default: return PLUGIN_HANDLED;
        }
    }

    return PLUGIN_CONTINUE;
}[/code]
Last edited by Ciprian on 06 Sep 2010, 11:30, edited 1 time in total.
Reason: Foloseste sursa in loc de code/quote pt. texte lungi.
User avatar
Ciprian
Fost administrator
Fost administrator
Posts: 5172
Joined: 10 May 2008, 20:29
Detinator Steam: Da
CS Status: ^^
SteamID: crazycipry
Reputatie: Fost administrator
Fost Scripter eXtreamCS
Fost Supervizor CS.eXtreamCS.com
Fost Unbanner ZM.eXtreamCS.com
Fost Contribuitor
Nume anterior: crazy.cipry
Location: Baia Mare
Has thanked: 176 times
Been thanked: 401 times
Contact:

06 Sep 2010, 11:31

compaq wrote:Rezolvarea (am vorbit cu el prin PM ):
| Afiseaza codul
[code]#include <amxmodx>
#include <cstrike>

#pragma semicolon 1

new const g_version[] = "0.1";

new const g_Messages[ 2 ][] =
{
    "T, plantati bomba!", // T
    "CT, paziti X" // CT
};

new g_MsgSayText;

public plugin_init()
{
    register_plugin( "Team messages", g_version, "compaq" );
    register_event("HLTV", "eNewRound", "a", "1=0", "2=0");

    g_MsgSayText = get_user_msgid( "SayText" );
}

public eNewRound()
{
    static iPlayers[ 32 ], iNum, i;
    get_players( iPlayers, iNum );

    for( i = 0; i < iNum; i++ )
    {
        switch( cs_get_user_team( iPlayers[ i ] ) )
        {
            case CS_TEAM_T:
            {
                message_begin( MSG_ONE, g_MsgSayText, _, iPlayers[ i ] );

                write_byte( iPlayers[ i ] );
                write_string( g_Messages[ 0 ] );

                message_end();
            }

            case CS_TEAM_CT:
            {
                message_begin( MSG_ONE, g_MsgSayText, _, iPlayers[ i ] );

                write_byte( iPlayers[ i ] );
                write_string( g_Messages[ 1 ] );

                message_end();
            }

            default: return PLUGIN_HANDLED;
        }
    }

    return PLUGIN_CONTINUE;
}[/code]
Too late. E mai eficient al meu :P
compaq
Fost moderator
Fost moderator
Posts: 2598
Joined: 01 Dec 2008, 15:32
Detinator Steam: Da
Reputatie: Fost eXtream Mod
Fost contribuitor
Fost manager
Fost Scripter eXtreamCS
Has thanked: 15 times
Been thanked: 150 times

06 Sep 2010, 11:38

Ciprian wrote:
compaq wrote:Rezolvarea (am vorbit cu el prin PM ):
| Afiseaza codul
[code]#include <amxmodx>
#include <cstrike>

#pragma semicolon 1

new const g_version[] = "0.1";

new const g_Messages[ 2 ][] =
{
    "T, plantati bomba!", // T
    "CT, paziti X" // CT
};

new g_MsgSayText;

public plugin_init()
{
    register_plugin( "Team messages", g_version, "compaq" );
    register_event("HLTV", "eNewRound", "a", "1=0", "2=0");

    g_MsgSayText = get_user_msgid( "SayText" );
}

public eNewRound()
{
    static iPlayers[ 32 ], iNum, i;
    get_players( iPlayers, iNum );

    for( i = 0; i < iNum; i++ )
    {
        switch( cs_get_user_team( iPlayers[ i ] ) )
        {
            case CS_TEAM_T:
            {
                message_begin( MSG_ONE, g_MsgSayText, _, iPlayers[ i ] );

                write_byte( iPlayers[ i ] );
                write_string( g_Messages[ 0 ] );

                message_end();
            }

            case CS_TEAM_CT:
            {
                message_begin( MSG_ONE, g_MsgSayText, _, iPlayers[ i ] );

                write_byte( iPlayers[ i ] );
                write_string( g_Messages[ 1 ] );

                message_end();
            }

            default: return PLUGIN_HANDLED;
        }
    }

    return PLUGIN_CONTINUE;
}[/code]
Too late. E mai eficient al meu :P
A tau e in hud :)))
Post Reply

Return to “Cereri”

  • Information
  • Who is online

    Users browsing this forum: Google [Bot] and 28 guests