Raised This Month: $ Target: $400
 0% 

Prefix+GreenText


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
OnePL
BANNED
Join Date: May 2012
Location: GB
Old 12-15-2014 , 01:48   Re: Prefix+GreenText
Reply With Quote #1

Quote:
Originally Posted by Syturi0 View Post
So can somebody give me the full code working please
https://forums.alliedmods.net/showpo...42&postcount=2
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
Natsheh
Veteran Member
Join Date: Sep 2012
Old 12-15-2014 , 13:37   Re: Prefix+GreenText
Reply With Quote #2

Try This:.

PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
/*#include <vip>*/

#define PLUGIN "[VIP] Chat Prefix"
#define VERSION "1.0"
#define AUTHOR "Natsheh"



enum 

    
Udead 0,
    
Ualive 
}

new const 
prefix[] = "[VIP]"

new const stats_prefix[][] = { 
    
"*DEAD*"
    
"*ALIVE*"
}

new const 
team_prefix[][] = {
    
"(Spectator)",
    
"(Terrorist)",
    
"(Counter-Terrorist)"
}

new 
msgid_saytext

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
msgid_saytext get_user_msgid("SayText")
    
    
register_message(msgid_saytext"vip_cmd_saytext")
}

public 
vip_cmd_saytext(msgidmsgdestid)
{
    if(!
is_user_vip(id) && !is_user_connected(id)) return
    
    new 
sMsg[192], sBuffer[192], szArgs[64], szName[32], szChannel[32]
    
    
get_user_name(idszName32-1)
    
get_msg_arg_string(4szArgs64-1)
    
get_msg_arg_string(2szChannel32-1)
    
    if(
equal(szChannel"#Cstrike_Chat_All"16))
    {
        
format(sBuffer191"%s %c%s %c%s%c: %c%s"stats_prefix[is_user_alive(id) ? Ualive:Udead],
        
'^x04'prefix'^x01'szName'^x03''^x01'szArgs)
    }
    else
    {
        
format(sBuffer191"%s %c%s %c%s %c%s%c: %c%s"stats_prefix[is_user_alive(id) ? Ualive:Udead],
        
'^x03'team_prefix[get_user_team(id)], '^x04'prefix'^x01'szName'^x03''^x01'szArgs)
    }
    
    
add(sMsg191"^x01")
    
add(sMsg191sBuffer)
    
set_msg_arg_string(2sMsg)


Last edited by Natsheh; 12-18-2014 at 12:53.
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-28-2014 , 07:05   Re: Prefix+GreenText
Reply With Quote #3

Quote:
Originally Posted by Natsheh View Post
Try This:.

PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
/*#include <vip>*/

#define PLUGIN "[VIP] Chat Prefix"
#define VERSION "1.0"
#define AUTHOR "Natsheh"



enum 

    
Udead 0,
    
Ualive 
}

new const 
prefix[] = "[VIP]"

new const stats_prefix[][] = { 
    
"*DEAD*"
    
"*ALIVE*"
}

new const 
team_prefix[][] = {
    
"(Spectator)",
    
"(Terrorist)",
    
"(Counter-Terrorist)"
}

new 
msgid_saytext

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
msgid_saytext get_user_msgid("SayText")
    
    
register_message(msgid_saytext"vip_cmd_saytext")
}

public 
vip_cmd_saytext(msgidmsgdestid)
{
    if(!
is_user_vip(id) && !is_user_connected(id)) return
    
    new 
sMsg[192], sBuffer[192], szArgs[64], szName[32], szChannel[32]
    
    
get_user_name(idszName32-1)
    
get_msg_arg_string(4szArgs64-1)
    
get_msg_arg_string(2szChannel32-1)
    
    if(
equal(szChannel"#Cstrike_Chat_All"16))
    {
        
format(sBuffer191"%s %c%s %c%s%c: %c%s"stats_prefix[is_user_alive(id) ? Ualive:Udead],
        
'^x04'prefix'^x01'szName'^x03''^x01'szArgs)
    }
    else
    {
        
format(sBuffer191"%s %c%s %c%s %c%s%c: %c%s"stats_prefix[is_user_alive(id) ? Ualive:Udead],
        
'^x03'team_prefix[get_user_team(id)], '^x04'prefix'^x01'szName'^x03''^x01'szArgs)
    }
    
    
add(sMsg191"^x01")
    
add(sMsg191sBuffer)
    
set_msg_arg_string(2sMsg)

Its not working properly. Can you fix it please?
Syturi0 is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 01-01-2015 , 07:40   Re: Prefix+GreenText
Reply With Quote #4

Quote:
Originally Posted by Syturi0 View Post
Its not working properly. Can you fix it please?
https://forums.alliedmods.net/showthread.php?t=253252
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-15-2014 , 13:39   Re: Prefix+GreenText
Reply With Quote #5

Thanks for helping.
I managed to fix it by just:
PHP Code:
if(sender && is_user_vip(id)) 

PHP Code:
if(sender && is_user_vip(sender)) 
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