AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Prefix+GreenText (https://forums.alliedmods.net/showthread.php?t=252583)

Syturi0 12-05-2014 15:31

Prefix+GreenText
 
1 Attachment(s)
I made some changes in this plugin:
PHP Code:

#include <amxmodx>
#include <vip>

//#define ACCESS_FLAG

new channels[8][] = 
{
    
"#Cstrike_Chat_CT",
    
"#Cstrike_Chat_T",
    
"#Cstrike_Chat_CT_Dead",
    
"#Cstrike_Chat_T_Dead",
    
"#Cstrike_Chat_Spec",
    
"#Cstrike_Chat_All",
    
"#Cstrike_Chat_AllDead",
    
"#Cstrike_Chat_AllSpec"
}

new 
newChannels[8][] =
{
    
"(Equipa-Azul) [VIP] %s1: %s2",
    
"(Equipa-Vermelha) [VIP] %s1: %s2",
    
"*Morto* (Equipa-Azul) [VIP] %s1: %s2",
    
"*Morto* (Equipa-Vermelha) [VIP] %s1: %s2",
    
"(Espectador) [VIP] %s1: %s2",
    
"[VIP] %s1: %s2",
    
"*Morto* [VIP] %s1: %s2",
    
"*Espectador* [VIP] %s1: %s2"
}

//   = green
//   = yellow
//   = team color


new Trie:vipChannels

public plugin_init() 
{
    
register_plugin("VipPrefix""1.5""ZETA+Syturio");
    
    
vipChannels TrieCreate();
    
    for (new 
08i++)
    {
        
TrieSetString(vipChannelschannels[i], newChannels[i]);
    }
    
    
register_message(get_user_msgid("SayText"), "MessageSayText");
}

public 
MessageSayText(msgidmsgdestid)
{
    new 
channel[64];
    
get_msg_arg_string(2channelcharsmax(channel));
    
    if(!
TrieGetString(vipChannelschannelchannelcharsmax(channel)))
    {
        return;
    }

    new 
sender get_msg_arg_int(1);

    if(
sender && is_user_vip(id))
    {
        
set_msg_arg_string(2channel);
    }
}

public 
plugin_end()
{
    
TrieDestroy(vipChannels);


But it is not working properly.
I can see my tag+greentext but outhers cant, and i also see everyone with it too, even if they aren't 'is_user_vip'...

Can someone help me?

OnePL 12-05-2014 23:14

Re: Prefix+GreenText
 
Why complicates your life?

PHP Code:

#include <amxmodx>
#include <vip>

new szPrefix[] = "[VIP]"// VIP Prefix

public plugin_init() {
    
register_plugin("VIP Prefix""1.0""OnePL");

    
register_message(76"PrefixSay");
}

public 
PrefixSay(msgIdmsgDestmsgEnt) {
    new 
id get_msg_arg_int(1);
    if(!
is_user_connected(id) || !is_user_vip(id)) return 0;

    new 
szTmp[196], szTmp2[196];
    
get_msg_arg_string(2szTmp195);

    
formatex(szPrefix31"^x04%s"szPrefix);

    
/*^x01 - normal color
    ^x03 - team color
    ^x04 - green color*/

    
if(!equal(szTmp"#Cstrike_Chat_All")) {
        
add(szTmp2195szPrefix);
        
add(szTmp2195" ");
        
add(szTmp2195szTmp);
    } else {
        
add(szTmp2195szPrefix);
        
add(szTmp2195"^x03 %s1^x01 :  %s2");
    }
    
set_msg_arg_string(2szTmp2);
    return 
0;



Syturi0 12-05-2014 23:22

Re: Prefix+GreenText
 
Quote:

Originally Posted by OnePL (Post 2231642)
Why complicates your life?

PHP Code:

#include <amxmodx>
#include <vip>

new szPrefix[] = "[VIP]"// VIP Prefix

public plugin_init() {
    
register_plugin("VIP Prefix""1.0""OnePL");

    
register_message(76"PrefixSay");
}

public 
PrefixSay(msgIdmsgDestmsgEnt) {
    new 
id get_msg_arg_int(1);
    if(!
is_user_connected(id) || !is_user_vip(id)) return 0;

    new 
szTmp[196], szTmp2[196];
    
get_msg_arg_string(2szTmp195);

    
formatex(szPrefix31"^x04%s"szPrefix);

    
/*^x01 - normal color
    ^x03 - team color
    ^x04 - green color*/

    
if(!equal(szTmp"#Cstrike_Chat_All")) {
        
add(szTmp2195szPrefix);
        
add(szTmp2195" ");
        
add(szTmp2195szTmp);
    } else {
        
add(szTmp2195szPrefix);
        
add(szTmp2195"^x03 %s1^x01 :  %s2");
    }
    
set_msg_arg_string(2szTmp2);
    return 
0;



Doesnt work properly.

Syturi0 12-05-2014 23:26

Re: Prefix+GreenText
 
Quote:

Originally Posted by OnePL (Post 2231642)
Why complicates your life?

PHP Code:

#include <amxmodx>
#include <vip>

new szPrefix[] = "[VIP]"// VIP Prefix

public plugin_init() {
    
register_plugin("VIP Prefix""1.0""OnePL");

    
register_message(76"PrefixSay");
}

public 
PrefixSay(msgIdmsgDestmsgEnt) {
    new 
id get_msg_arg_int(1);
    if(!
is_user_connected(id) || !is_user_vip(id)) return 0;

    new 
szTmp[196], szTmp2[196];
    
get_msg_arg_string(2szTmp195);

    
formatex(szPrefix31"^x04%s"szPrefix);

    
/*^x01 - normal color
    ^x03 - team color
    ^x04 - green color*/

    
if(!equal(szTmp"#Cstrike_Chat_All")) {
        
add(szTmp2195szPrefix);
        
add(szTmp2195" ");
        
add(szTmp2195szTmp);
    } else {
        
add(szTmp2195szPrefix);
        
add(szTmp2195"^x03 %s1^x01 :  %s2");
    }
    
set_msg_arg_string(2szTmp2);
    return 
0;



The [VIP] tag doesnt shows.
And i want it to have this:
PHP Code:

new newChannels[8][] =
{
    
"(Equipa-Azul) [VIP] %s1: %s2",
    
"(Equipa-Vermelha) [VIP] %s1: %s2",
    
"*Morto* (Equipa-Azul) [VIP] %s1: %s2",
    
"*Morto* (Equipa-Vermelha) [VIP] %s1: %s2",
    
"(Espectador) [VIP] %s1: %s2",
    
"[VIP] %s1: %s2",
    
"*Morto* [VIP] %s1: %s2",
    
"*Espectador* [VIP] %s1: %s2"
}

//   = green
//   = yellow
//   = team color 


Natsheh 12-06-2014 13:21

Re: Prefix+GreenText
 
here any example..
PHP Code:

enum
{
Udead 0,
Ualive
}
New const 
user_prefix[][] = {
"*DEAD* [VIP]",
"[VIP]"
}

function(
id)
{
if(!
is_user_vip(id) && !is_user_connected(id)) return
New 
szprefix[64]
format(szprefix63"%s %s"user_prefix[is_user_alive(id) ? Ualive:Udead], args)



Natsheh 12-06-2014 13:34

Re: Prefix+GreenText
 
Quote:

Originally Posted by OnePL (Post 2231642)
Why complicates your life?

PHP Code:

public PrefixSay(msgIdmsgDestid)
{




Syturi0 12-11-2014 18:50

Re: Prefix+GreenText
 
Quote:

Originally Posted by Natsheh (Post 2231887)
here any example..
PHP Code:

enum
{
Udead 0,
Ualive
}
New const 
user_prefix[][] = {
"*DEAD* [VIP]",
"[VIP]"
}

function(
id)
{
if(!
is_user_vip(id) && !is_user_connected(id)) return
New 
szprefix[64]
format(szprefix63"%s %s"user_prefix[id][is_user_alive(id) ? Ualive:Udead], args)


not tested & written on the phone

Can you explain better please?

Freezo Begin 12-12-2014 13:29

Re: Prefix+GreenText
 
Quote:

Originally Posted by Natsheh (Post 2231887)
here any example..
PHP Code:

enum
{
Udead 0,
Ualive
}
New const 
user_prefix[][] = {
"*DEAD* [VIP]",
"[VIP]"
}

function(
id)
{
if(!
is_user_vip(id) && !is_user_connected(id)) return
New 
szprefix[64]
format(szprefix63"%s %s"user_prefix[id][is_user_alive(id) ? Ualive:Udead], args)


not tested & written on the phone

Your code is false this will not work
how did you check this
Code:
[is_user_alive(id) ? Ualive:Udead]

Natsheh 12-12-2014 17:10

Re: Prefix+GreenText
 
Quote:

Originally Posted by Freezo Begin (Post 2234464)
Your code is false this will not work
how did you check this
Code:
[is_user_alive(id) ? Ualive:Udead]

Btw i didnt check , what is false ? it will give y warrning i guess..
PHP Code:

user_prefix[is_user_alive(id) ? Ualive:Udead


Syturi0 12-13-2014 12:48

Re: Prefix+GreenText
 
So can somebody give me the full code working please


All times are GMT -4. The time now is 15:22.

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