Raised This Month: $ Target: $400
 0% 

Prefix+GreenText


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Syturi0
Veteran Member
Join Date: Aug 2014
Location: Your mom house -Portugal
Old 12-05-2014 , 15:31   Prefix+GreenText
Reply With Quote #1

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?
Attached Files
File Type: inc vip.inc (1.3 KB, 100 views)

Last edited by Syturi0; 12-05-2014 at 15:32.
Syturi0 is offline
OnePL
BANNED
Join Date: May 2012
Location: GB
Old 12-05-2014 , 23:14   Re: Prefix+GreenText
Reply With Quote #2

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;

OnePL is offline
Send a message via ICQ to OnePL Send a message via AIM to OnePL Send a message via Yahoo to OnePL Send a message via Skype™ to OnePL
Syturi0
Veteran Member
Join Date: Aug 2014
Location: Your mom house -Portugal
Old 12-05-2014 , 23:22   Re: Prefix+GreenText
Reply With Quote #3

Quote:
Originally Posted by OnePL View Post
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 is offline
Syturi0
Veteran Member
Join Date: Aug 2014
Location: Your mom house -Portugal
Old 12-05-2014 , 23:26   Re: Prefix+GreenText
Reply With Quote #4

Quote:
Originally Posted by OnePL View Post
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 
Syturi0 is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 12-06-2014 , 13:34   Re: Prefix+GreenText
Reply With Quote #5

Quote:
Originally Posted by OnePL View Post
Why complicates your life?

PHP Code:
public PrefixSay(msgIdmsgDestid)
{

Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
Natsheh
Veteran Member
Join Date: Sep 2012
Old 12-06-2014 , 13:21   Re: Prefix+GreenText
Reply With Quote #6

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)


Last edited by Natsheh; 12-12-2014 at 17:12.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
Syturi0
Veteran Member
Join Date: Aug 2014
Location: Your mom house -Portugal
Old 12-11-2014 , 18:50   Re: Prefix+GreenText
Reply With Quote #7

Quote:
Originally Posted by Natsheh View Post
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?
Syturi0 is offline
Freezo Begin
BANNED
Join Date: Mar 2014
Location: Morocco
Old 12-12-2014 , 13:29   Re: Prefix+GreenText
Reply With Quote #8

Quote:
Originally Posted by Natsheh View Post
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]
Freezo Begin is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 12-12-2014 , 17:10   Re: Prefix+GreenText
Reply With Quote #9

Quote:
Originally Posted by Freezo Begin View Post
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
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
Syturi0
Veteran Member
Join Date: Aug 2014
Location: Your mom house -Portugal
Old 12-13-2014 , 12:48   Re: Prefix+GreenText
Reply With Quote #10

So can somebody give me the full code working please
Syturi0 is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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