cerere plugin ghostchat exact cum l-am cerut

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
Cs-3r4z3r
Membru, skill +1
Membru, skill +1
Posts: 326
Joined: 28 Mar 2008, 01:12
Detinator Steam: Da
CS Status: mai putin cu cs-ul in ultimul timp
Detinator server CS: Cs.Samara.Ro
Location: Bucuresti
Has thanked: 8 times

29 Mar 2020, 15:14

Plugin Cerut: ghostchat
Descriere (adica ce face el mai exact): vb cei morti cu cei vi,si as vrea sa apara *VIU* si *MORT* in loc de alive si dead
Serverul impune conditii strict HLDS/REHLDS?:REHLDS
Ai cautat pluginul?(daca da, precizeaza cum):da
Necesita mod special?:nu
User avatar
Laurentiu P.
Fost moderator
Fost moderator
Posts: 2548
Joined: 10 Jul 2013, 21:26
Detinator Steam: Da
Reputatie: Fost super moderator
Fond eXtream: 100
Has thanked: 26 times
Been thanked: 61 times
Contact:

29 Mar 2020, 16:58

Posteaza sursa si nu ai postat unde trebuie
no...
User avatar
mariusexeqt
Utilizator neserios (tepar)
Utilizator neserios (tepar)
Posts: 199
Joined: 01 Jan 2020, 22:55
Detinator Steam: Da
Fond eXtream: 0
Has thanked: 4 times
Been thanked: 4 times
Contact:

29 Mar 2020, 17:21

| Afiseaza codul
#include <amxmisc>

// Ghostchat disabled by default
new ghostchat = 3; // Set to let HLTV see alive chat by default.
new gmsgSayText;
new logfilename[256];

// Return current setting or set new value
public handle_ghostchat(id,level,cid) {

    // No switches given
    if (read_argc() < 2) {
        new status[55];
        if (ghostchat == 1) {
            copy(status, 55, "Dead can read alive");
        }
        else if (ghostchat == 2) {
            copy(status, 55, "Dead and alive can read eachother");
        }
        else if (ghostchat == 3) {
            copy(status, 55, "HLTV can read chat of the living");
        }
        else {
            copy(status, 55, "Disabled");
        }
        client_print(id,print_console,"[AMX] Ghostchat status: %s (NOT TEAMSAY)", status);
        if (cmd_access(id,ADMIN_LEVEL_B,cid,0)) 
           client_print(id,print_console,"[AMX] Ghostchat usage: amx_ghostchat 0(disabled), 1(Dead can read alive), 2(Dead and alive can chat), 3(Only HLTV can read alive)");
        return PLUGIN_HANDLED;
    }

    // If you don't have enough rights, you can't change anything
    if (!cmd_access(id,ADMIN_LEVEL_B,cid,0))
        return PLUGIN_HANDLED;
    
    new arg[2];
    read_argv(1,arg,2);

    if (equal(arg,"0",1)) {
        ghostchat = 0;
        client_print(0,print_chat,"[AMX] Ghostchat - Plugin has been disabled");
    }
    else if (equal(arg,"1",1)) {
        ghostchat = 1;
        client_print(0,print_chat,"[AMX] Ghostchat - Dead people can read the chat of the living (NOT TEAMSAY)!");
    }
    else if (equal(arg,"2",1)) {
        ghostchat = 2;
        client_print(0,print_chat,"[AMX] Ghostchat - Dead and living people can talk to eachother (NOT TEAMSAY)!");
    }
    else if (equal(arg,"3",1)) {
        ghostchat = 3;
        client_print(0,print_chat,"[AMX] Ghostchat - HLTV can read chat of the living (NOT TEAMSAY)!");
    }

    new authid[16],name[32];
    get_user_authid(id,authid,16);
    get_user_name(id,name,32);

    log_to_file(logfilename,"Ghostchat: ^"%s<%d><%s><>^" amx_ghostchat %s",name,get_user_userid(id),authid,arg);
    return PLUGIN_HANDLED;
}

public handle_say(id) {
    // If plugin is disabled, skip the code
    if (ghostchat <= 0)
       return PLUGIN_CONTINUE;

    // Gather information
    new is_alive = is_user_alive(id);
    new message[129];
    read_argv(1,message,128);
    new name[33];
    get_user_name(id,name,32);
    new player_count = get_playersnum();
    new players[32];
    get_players(players, player_count, "c");

    // Clients sometimes send empty messages, or a message containig a '[', ignore those.
    if (equal(message,"")) return PLUGIN_CONTINUE;
    if (equal(message,"[")) return PLUGIN_CONTINUE;
 
    // Response to a specific query
    if (containi(message,"[G]") != -1)
        client_print(id,print_chat,"[AMX] Ghostchat - Type amx_ghostchat in console for current status");
    
    // Format the messages, the %c (2) adds the color. The client decides what color
    // it gets by looking at team.
    if (is_alive) format(message, 127, "%c[G]*VIU*%s :    %s^n", 2, name, message);
    else format(message, 127, "%c[G]*MORT*%s :    %s^n", 2, name, message);

    // Check all players wether they should receive the message or not
    for (new i = 0; i < player_count; i++) {

      if (is_alive && !is_user_alive(players)) {
         // Talking person alive, current receiver dead
         if ((ghostchat == 3 && is_user_hltv(players)) || ghostchat <= 2) {
             // Either HLTV mode is enabled and current player is HLTV
             // or one of the other modes is enabled...
             message_begin(MSG_ONE,gmsgSayText,{0,0,0},players);
             write_byte(id);
             write_string(message);
             message_end();
         }
      }
      else if (!is_alive && is_user_alive(players) && ghostchat == 2) {
         // Talking person is dead, current receiver alive
         message_begin(MSG_ONE,gmsgSayText,{0,0,0},players);
         write_byte(id);
         write_string(message);
         message_end();
      }
    }
    return PLUGIN_CONTINUE;
}

public plugin_init() {
    register_plugin("Ghostchat", "0.3", "NetRipper");
    register_clcmd("say", "handle_say");
    register_concmd("amx_ghostchat", "handle_ghostchat",-1,"<mode>");

    gmsgSayText = get_user_msgid("SayText");
    get_time("addons/amx/logs/admin%m%d.log",logfilename,255) 

    return PLUGIN_CONTINUE;
}
Mihuu.FREE
Membru, skill 0
Membru, skill 0
Posts: 68
Joined: 11 Aug 2019, 16:07
Detinator Steam: Da
CS Status: Pe Inferno cu băieții
Detinator server CS: FREE.LALEAGANE.RO
SteamID: PM.
Fond eXtream: 0
Has thanked: 2 times
Been thanked: 1 time

30 Mar 2020, 20:35

mariusexeqt wrote:
29 Mar 2020, 17:21
| Afiseaza codul
#include <amxmisc>

// Ghostchat disabled by default
new ghostchat = 3; // Set to let HLTV see alive chat by default.
new gmsgSayText;
new logfilename[256];

// Return current setting or set new value
public handle_ghostchat(id,level,cid) {

    // No switches given
    if (read_argc() < 2) {
        new status[55];
        if (ghostchat == 1) {
            copy(status, 55, "Dead can read alive");
        }
        else if (ghostchat == 2) {
            copy(status, 55, "Dead and alive can read eachother");
        }
        else if (ghostchat == 3) {
            copy(status, 55, "HLTV can read chat of the living");
        }
        else {
            copy(status, 55, "Disabled");
        }
        client_print(id,print_console,"[AMX] Ghostchat status: %s (NOT TEAMSAY)", status);
        if (cmd_access(id,ADMIN_LEVEL_B,cid,0)) 
           client_print(id,print_console,"[AMX] Ghostchat usage: amx_ghostchat 0(disabled), 1(Dead can read alive), 2(Dead and alive can chat), 3(Only HLTV can read alive)");
        return PLUGIN_HANDLED;
    }

    // If you don't have enough rights, you can't change anything
    if (!cmd_access(id,ADMIN_LEVEL_B,cid,0))
        return PLUGIN_HANDLED;
    
    new arg[2];
    read_argv(1,arg,2);

    if (equal(arg,"0",1)) {
        ghostchat = 0;
        client_print(0,print_chat,"[AMX] Ghostchat - Plugin has been disabled");
    }
    else if (equal(arg,"1",1)) {
        ghostchat = 1;
        client_print(0,print_chat,"[AMX] Ghostchat - Dead people can read the chat of the living (NOT TEAMSAY)!");
    }
    else if (equal(arg,"2",1)) {
        ghostchat = 2;
        client_print(0,print_chat,"[AMX] Ghostchat - Dead and living people can talk to eachother (NOT TEAMSAY)!");
    }
    else if (equal(arg,"3",1)) {
        ghostchat = 3;
        client_print(0,print_chat,"[AMX] Ghostchat - HLTV can read chat of the living (NOT TEAMSAY)!");
    }

    new authid[16],name[32];
    get_user_authid(id,authid,16);
    get_user_name(id,name,32);

    log_to_file(logfilename,"Ghostchat: ^"%s<%d><%s><>^" amx_ghostchat %s",name,get_user_userid(id),authid,arg);
    return PLUGIN_HANDLED;
}

public handle_say(id) {
    // If plugin is disabled, skip the code
    if (ghostchat <= 0)
       return PLUGIN_CONTINUE;

    // Gather information
    new is_alive = is_user_alive(id);
    new message[129];
    read_argv(1,message,128);
    new name[33];
    get_user_name(id,name,32);
    new player_count = get_playersnum();
    new players[32];
    get_players(players, player_count, "c");

    // Clients sometimes send empty messages, or a message containig a '[', ignore those.
    if (equal(message,"")) return PLUGIN_CONTINUE;
    if (equal(message,"[")) return PLUGIN_CONTINUE;
 
    // Response to a specific query
    if (containi(message,"[G]") != -1)
        client_print(id,print_chat,"[AMX] Ghostchat - Type amx_ghostchat in console for current status");
    
    // Format the messages, the %c (2) adds the color. The client decides what color
    // it gets by looking at team.
    if (is_alive) format(message, 127, "%c[G]*VIU*%s :    %s^n", 2, name, message);
    else format(message, 127, "%c[G]*MORT*%s :    %s^n", 2, name, message);

    // Check all players wether they should receive the message or not
    for (new i = 0; i < player_count; i++) {

      if (is_alive && !is_user_alive(players)) {
         // Talking person alive, current receiver dead
         if ((ghostchat == 3 && is_user_hltv(players)) || ghostchat <= 2) {
             // Either HLTV mode is enabled and current player is HLTV
             // or one of the other modes is enabled...
             message_begin(MSG_ONE,gmsgSayText,{0,0,0},players);
             write_byte(id);
             write_string(message);
             message_end();
         }
      }
      else if (!is_alive && is_user_alive(players) && ghostchat == 2) {
         // Talking person is dead, current receiver alive
         message_begin(MSG_ONE,gmsgSayText,{0,0,0},players);
         write_byte(id);
         write_string(message);
         message_end();
      }
    }
    return PLUGIN_CONTINUE;
}

public plugin_init() {
    register_plugin("Ghostchat", "0.3", "NetRipper");
    register_clcmd("say", "handle_say");
    register_concmd("amx_ghostchat", "handle_ghostchat",-1,"<mode>");

    gmsgSayText = get_user_msgid("SayText");
    get_time("addons/amx/logs/admin%m%d.log",logfilename,255) 

    return PLUGIN_CONTINUE;
}


N-are absolut nicio treabă cu ce a cerut el. Fix ce nu a vrut să fie e pus în plugin-ul ăsta =)))
Last edited by levin on 31 Mar 2020, 15:17, edited 1 time in total.
Reason: e exact ce a cerut
User avatar
Laurentiu P.
Fost moderator
Fost moderator
Posts: 2548
Joined: 10 Jul 2013, 21:26
Detinator Steam: Da
Reputatie: Fost super moderator
Fond eXtream: 100
Has thanked: 26 times
Been thanked: 61 times
Contact:

30 Mar 2020, 20:53

Code: Select all

#include <amxmodx>
#include <amxmisc>

// Ghostchat disabled by default
new ghostchat = 3; // Set to let HLTV see alive chat by default.
new gmsgSayText;
new logfilename[256];

// Return current setting or set new value
public handle_ghostchat(id,level,cid) {

    // No switches given
    if (read_argc() < 2) {
        new status[55];
        if (ghostchat == 1) {
            copy(status, 55, "Dead can read alive");
        }
        else if (ghostchat == 2) {
            copy(status, 55, "Dead and alive can read eachother");
        }
        else if (ghostchat == 3) {
            copy(status, 55, "HLTV can read chat of the living");
        }
        else {
            copy(status, 55, "Disabled");
        }
        client_print(id,print_console,"[AMX] Ghostchat status: %s (NOT TEAMSAY)", status);
        if (cmd_access(id,ADMIN_LEVEL_B,cid,0)) 
           client_print(id,print_console,"[AMX] Ghostchat usage: amx_ghostchat 0(disabled), 1(Dead can read alive), 2(Dead and alive can chat), 3(Only HLTV can read alive)");
        return PLUGIN_HANDLED;
    }

    // If you don't have enough rights, you can't change anything
    if (!cmd_access(id,ADMIN_LEVEL_B,cid,0))
        return PLUGIN_HANDLED;
    
    new arg[2];
    read_argv(1,arg,2);

    if (equal(arg,"0",1)) {
        ghostchat = 0;
        client_print(0,print_chat,"[AMX] Ghostchat - Plugin has been disabled");
    }
    else if (equal(arg,"1",1)) {
        ghostchat = 1;
        client_print(0,print_chat,"[AMX] Ghostchat - Dead people can read the chat of the living (NOT TEAMSAY)!");
    }
    else if (equal(arg,"2",1)) {
        ghostchat = 2;
        client_print(0,print_chat,"[AMX] Ghostchat - Dead and living people can talk to eachother (NOT TEAMSAY)!");
    }
    else if (equal(arg,"3",1)) {
        ghostchat = 3;
        client_print(0,print_chat,"[AMX] Ghostchat - HLTV can read chat of the living (NOT TEAMSAY)!");
    }

    new authid[16],name[32];
    get_user_authid(id,authid,16);
    get_user_name(id,name,32);

    log_to_file(logfilename,"Ghostchat: ^"%s<%d><%s><>^" amx_ghostchat %s",name,get_user_userid(id),authid,arg);
    return PLUGIN_HANDLED;
}

public handle_say(id) {
    // If plugin is disabled, skip the code
    if (ghostchat <= 0)
       return PLUGIN_CONTINUE;

    // Gather information
    new is_alive = is_user_alive(id);
    new message[129];
    read_argv(1,message,128);
    new name[33];
    get_user_name(id,name,32);
    new player_count = get_playersnum();
    new players[32];
    get_players(players, player_count, "c");

    // Clients sometimes send empty messages, or a message containig a '[', ignore those.
    if (equal(message,"")) return PLUGIN_CONTINUE;
    if (equal(message,"[")) return PLUGIN_CONTINUE;
 
    // Response to a specific query
    if (containi(message,"[G]") != -1)
        client_print(id,print_chat,"[AMX] Ghostchat - Type amx_ghostchat in console for current status");
    
    // Format the messages, the %c (2) adds the color. The client decides what color
    // it gets by looking at team.
    if (is_alive) format(message, 127, "%c[G]*VIU*%s :    %s^n", 2, name, message);
    else format(message, 127, "%c[G]*MORT*%s :    %s^n", 2, name, message);

    // Check all players wether they should receive the message or not
    for (new i = 0; i < player_count; i++) {

      if (is_alive && !is_user_alive(players[i])) {
         // Talking person alive, current receiver dead
         if ((ghostchat == 3 && is_user_hltv(players[i])) || ghostchat <= 2) {
             // Either HLTV mode is enabled and current player is HLTV
             // or one of the other modes is enabled...
             message_begin(MSG_ONE,gmsgSayText,{0,0,0},players[i]);
             write_byte(id);
             write_string(message);
             message_end();
         }
      }
      else if (!is_alive && is_user_alive(players[i]) && ghostchat == 2) {
         // Talking person is dead, current receiver alive
         message_begin(MSG_ONE,gmsgSayText,{0,0,0},players[i]);
         write_byte(id);
         write_string(message);
         message_end();
      }
    }
    return PLUGIN_CONTINUE;
}

public plugin_init() {
    register_plugin("Ghostchat", "0.3", "NetRipper");
    register_clcmd("say", "handle_say");
    register_concmd("amx_ghostchat", "handle_ghostchat",-1,"<mode>");

    gmsgSayText = get_user_msgid("SayText");
    get_time("addons/amx/logs/admin%m%d.log",logfilename,255) 

    return PLUGIN_CONTINUE;
}

Code: Select all

amx_ghostchat setat pe valoarea 2
no...
Post Reply

Return to “Cereri”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 27 guests