Raised This Month: $51 Target: $400
 12% 

Prefix [Vip]


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Ducik
Junior Member
Join Date: Aug 2014
Old 09-13-2014 , 20:04   Prefix [Vip]
Reply With Quote #1

Hi, how do prefix [Vip] before nick ??
Ducik is offline
floube
SourceMod Donor
Join Date: Jan 2013
Location: Austria
Old 09-14-2014 , 08:04   Re: Prefix [Vip]
Reply With Quote #2

PHP Code:
new bool:g_bPrefixedName[MAXPLAYERS 1];

public 
OnPluginStart() {
    
HookUserMessage(GetUserMessageId("SayText2"), SayText2true);
}

public 
Action:SayText2(UserMsg:iMessageIDHandle:hBufferiPlayers[], iPlayerNumbool:bReliablebool:bInit) {
    new 
String:sBuffer[25];

    if (
GetUserMessageType() != UM_Protobuf) {
        
BfReadChar(hBuffer);
        
BfReadChar(hBuffer);
        
BfReadString(hBuffersBuffersizeof(sBuffer));

        if (
StrContains(sBuffer"Name_Change") != -1) {
            for (new 
0iPlayerNumi++) {
                if (
g_bPrefixedName[iPlayers[i]]) {
                    
g_bPrefixedName[iPlayers[i]] = false;

                    return 
Plugin_Handled;
                }
            }
        }
    }

    return 
Plugin_Continue;
}

stock PrefixClientName(iClient, const String:sPrefix[]) {
    
decl String:sName[MAX_NAME_LENGTH];
    
Format(sNamesizeof(sName), "%s %N"sPrefixiClient);
    
SetClientInfo(iClient"name"sName);

    
g_bPrefixedName[iClient] = true;

Call wherever you need it:
PHP Code:
PrefixClientName(iClient"[Vip]"); 
__________________
floube is offline
Ducik
Junior Member
Join Date: Aug 2014
Old 09-14-2014 , 10:26   Re: Prefix [Vip]
Reply With Quote #3

Where do I add the "PrefixClientName(iClient, "[Vip]"); "?
When connected player ??
Ducik is offline
floube
SourceMod Donor
Join Date: Jan 2013
Location: Austria
Old 09-14-2014 , 10:30   Re: Prefix [Vip]
Reply With Quote #4

You can do it in the player_active or player_spawn event.
__________________

Last edited by floube; 09-14-2014 at 10:30.
floube is offline
Ducik
Junior Member
Join Date: Aug 2014
Old 09-14-2014 , 16:59   Re: Prefix [Vip]
Reply With Quote #5

I added this:

Code:
public OnClientPutInServer(client)
{
    g_bPrefixedName[client] = false;
    
    GetClientAuthString(client, steamid, sizeof(steamid));
    if(!IsFakeClient(client) && GetUserFlagBits(client) & ADMFLAG_CUSTOM1)
    {
        PrefixClientName(client, "[VIP]");  
    }
}
I did not work.

Last edited by Ducik; 09-14-2014 at 17:00.
Ducik is offline
Ducik
Junior Member
Join Date: Aug 2014
Old 09-15-2014 , 17:11   Re: Prefix [Vip]
Reply With Quote #6

REF.
Ducik is offline
KissLick
Veteran Member
Join Date: Nov 2012
Location: void
Old 09-15-2014 , 18:53   Re: Prefix [Vip]
Reply With Quote #7

I must suggest Simple Chat Processor (OnChatMessage) and if you don't want to create your own plugin -> Simple Chat Colors
KissLick is offline
Ducik
Junior Member
Join Date: Aug 2014
Old 09-16-2014 , 02:53   Re: Prefix [Vip]
Reply With Quote #8

I upload these 2 plugins, noi what next? Where do I add this TAG?
Ducik is offline
KissLick
Veteran Member
Join Date: Nov 2012
Location: void
Old 09-16-2014 , 08:06   Re: Prefix [Vip]
Reply With Quote #9

look in /sourcemod/configs/simple-chatcolors.cfg and use word please ;-)
KissLick is offline
Ducik
Junior Member
Join Date: Aug 2014
Old 09-17-2014 , 05:03   Re: Prefix [Vip]
Reply With Quote #10

[SM] Unable to load plugin "simple-chatcolors.smx": Native "BfWriteByte" was not found
??
Ducik 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 11:33.


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