Plugin GhostChat [rezolvat!]

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 .
[LeNT]Bogdan
Membru, skill +1
Membru, skill +1
Posts: 186
Joined: 08 Aug 2013, 18:05
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Detinator server CS: hd.cs16.ro
Has thanked: 12 times
Been thanked: 4 times
Contact:

28 Oct 2013, 14:40

Salut , doresc si eu sa se scoata tagul [G] din ghostchat . este ceva de genu " [G]*DEAD* Nume : mesaj , [G]*ALIVE* Nume : mesaj " vreau sa fie fara [g] " *DEAD* Nume : msg , *ALIVE* Nume : msg , la spectator am uitat cum este .. dar cred ca ati inteles vreau sa se scoata de tot tagul [G] nu mai vreau nimic in locul lui !

Daca se poate sa va uitati si peste cod , sa nu aiba ceva nesigur prin el .. un bug ceva am mai auzit vorbind pe cineva !

Multumesc , o zi buna va doresc !
GhostChat | Afiseaza codul
#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]*ALIVE*%s :    %s^n", 2, name, message);
    else format(message, 127, "%c[G]*DEAD*%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;
}
Last edited by Raul on 29 Oct 2013, 16:38, edited 1 time in total.
Reason: [rezolvat!]
Servicii Profesionale Hosting btstelecom
RoyalServer
Cosmin
Fost moderator
Fost moderator
Posts: 9362
Joined: 06 Jul 2013, 22:08
Detinator Steam: Da
Detinator server CS: Nu
Reputatie: Fost eXtream Mod
Fost Scripter eXtreamCS
Nume anterior: scosmynnnn
Has thanked: 492 times
Been thanked: 547 times

28 Oct 2013, 14:44

Ia asta de aici Scoate ghostchat ca e plin de buguri + ca la cateva zile iti poate da crash server-ul baga ce ti-am dat eu si numai ai treaba.
[LeNT]Bogdan
Membru, skill +1
Membru, skill +1
Posts: 186
Joined: 08 Aug 2013, 18:05
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Detinator server CS: hd.cs16.ro
Has thanked: 12 times
Been thanked: 4 times
Contact:

28 Oct 2013, 14:56

scosmynnnn wrote:Ia asta de aici Scoate ghostchat ca e plin de buguri + ca la cateva zile iti poate da crash server-ul baga ce ti-am dat eu si numai ai treaba.

o sa incerc , dar inca vreau sa mi se modifice ghostchat .. din cate vad ghostchat este pe multe servere care nu prea pica ..
Servicii Profesionale Hosting btstelecom
User avatar
DaNe
Membru, skill 0
Membru, skill 0
Posts: 71
Joined: 22 Sep 2013, 18:29
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Has thanked: 7 times
Been thanked: 2 times
Contact:

28 Oct 2013, 17:14

Scoate tu ca-s pe telefon:

Code: Select all

    // 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]*ALIVE*%s :    %s^n", 2, name,
message);
    else format(message, 127, "%c[G]*DEAD*
%s :    %s^n", 2, name, message);
[ New Damage Effect ] - [ 100 % ] [ Public ] [ Click Aici ]
User avatar
Gabriel963
Fost moderator
Fost moderator
Posts: 1658
Joined: 03 Feb 2013, 13:03
Detinator Steam: Da
CS Status: Retried
Reputatie: Membru Club eXtreamCS (1 luna)
Fost Moderator
Location: Bucharest, Romania.
Has thanked: 20 times
Been thanked: 85 times

28 Oct 2013, 17:20

GhostChat are un bug in care pici serverul daca vrei :)).
Nu recomand.
Image
User avatar
DaNe
Membru, skill 0
Membru, skill 0
Posts: 71
Joined: 22 Sep 2013, 18:29
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Has thanked: 7 times
Been thanked: 2 times
Contact:

28 Oct 2013, 17:36

Gabriel963 wrote:GhostChat are un bug in care pici serverul daca vrei :)).
Nu recomand.
La asta te referi ? " % "
[ New Damage Effect ] - [ 100 % ] [ Public ] [ Click Aici ]
[LeNT]Bogdan
Membru, skill +1
Membru, skill +1
Posts: 186
Joined: 08 Aug 2013, 18:05
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Detinator server CS: hd.cs16.ro
Has thanked: 12 times
Been thanked: 4 times
Contact:

28 Oct 2013, 18:10

Gabriel963 wrote:GhostChat are un bug in care pici serverul daca vrei :)).
Nu recomand.

Cum scap de acel bug ?

DaNe wrote:Scoate tu ca-s pe telefon:

Code: Select all

    // 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]*ALIVE*%s :    %s^n", 2, name,
message);
    else format(message, 127, "%c[G]*DEAD*
%s :    %s^n", 2, name, message);
Nu ma bag la modificari pentru ca habar nu am .. poate porma gresesc codul mai bine astept pe cineva cu experienta sa ma ajute ! o seara buna va doresc !
Servicii Profesionale Hosting btstelecom
User avatar
DaNe
Membru, skill 0
Membru, skill 0
Posts: 71
Joined: 22 Sep 2013, 18:29
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Has thanked: 7 times
Been thanked: 2 times
Contact:

28 Oct 2013, 18:25

O sa ti-l fac cand ma pun la PC ! :D
[ New Damage Effect ] - [ 100 % ] [ Public ] [ Click Aici ]
User avatar
Rap^
Membru, skill +2
Membru, skill +2
Posts: 621
Joined: 01 Oct 2011, 00:25
Detinator Steam: Da
Reputatie: Fost Scripter eXtreamCS
Fost Super moderator
Location: Bucuresti
Has thanked: 16 times
Been thanked: 156 times

28 Oct 2013, 19:28

| Afiseaza codul
#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*ALIVE*%s :    %s^n", 2, name, message);
    else format(message, 127, "%c*DEAD*%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;
}
Imagination is more important than knowledge.
Knowledge is limited - Imagination encircles the world.
[LeNT]Bogdan
Membru, skill +1
Membru, skill +1
Posts: 186
Joined: 08 Aug 2013, 18:05
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Detinator server CS: hd.cs16.ro
Has thanked: 12 times
Been thanked: 4 times
Contact:

28 Oct 2013, 19:35

Rap^ wrote:
| Afiseaza codul
#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*ALIVE*%s :    %s^n", 2, name, message);
    else format(message, 127, "%c*DEAD*%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;
}



Acum am vazut ca mai este un [g] prin plugin la ce foloseste ?

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*ALIVE*%s : %s^n", 2, name, message);
else format(message, 127, "%c*DEAD*%s : %s^n", 2, name, message);


si daca vreau sa modific denumirea cum fac gen alive = viu dead = mort asta stiu dar la spectator de unde modific ;)

Multumesc !
Servicii Profesionale Hosting btstelecom
User avatar
DaNe
Membru, skill 0
Membru, skill 0
Posts: 71
Joined: 22 Sep 2013, 18:29
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Has thanked: 7 times
Been thanked: 2 times
Contact:

28 Oct 2013, 21:12

Nu mai folosi acel plugin ! .
[ New Damage Effect ] - [ 100 % ] [ Public ] [ Click Aici ]
[LeNT]Bogdan
Membru, skill +1
Membru, skill +1
Posts: 186
Joined: 08 Aug 2013, 18:05
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Detinator server CS: hd.cs16.ro
Has thanked: 12 times
Been thanked: 4 times
Contact:

28 Oct 2013, 21:33

DaNe wrote:Nu mai folosi acel plugin ! .

Sincer nu inteleg 99,9% imi ziceti cai bun pluginul si 99,9% ziceti ca nu ii bun .. eu il folosesc de mult nu am probleme cu el .. vreau doar unele modificari !
Servicii Profesionale Hosting btstelecom
Post Reply

Return to “Cereri”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 42 guests