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

print_chat color help


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
svas
Junior Member
Join Date: Aug 2016
Location: Turkey
Old 02-16-2020 , 18:35   print_chat color help
Reply With Quote #1

Hello, friends, I have a very simple logic, nick encryption plug in my hand.
I want this plugin to make the say commands green. is there anyone to help me?

Succeeded reg. command send
Nick: and Pw:

I want to differ from between everyone of that. Like that in say chat color.
Nick: asd Pw: 123

Thank you from now.

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

#include <amxmodx>
#include <amxmisc>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"

new const USER_FILE[] = "addons/amxmodx/configs/custom_users.ini";

new 
bool:MessageModeByServer;

public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    if(!
file_exists(USER_FILE)) {
        new 
fopen(USER_FILE,"wt");
        
fclose(f)
    }
    
    
register_clcmd("say /nickpw","PasswordRequest")
    
register_clcmd("Sifrenizi Giriniz","PasswordReceive")
    
}
public 
client_connect(id) {
    new 
UserPW[32],UserName[32];
    
get_user_info(id,"_pw",UserPW,31)
    
get_user_name(id,UserName,31)
    
    new 
maxlines file_size(USER_FILE,1);
    new 
szLineText[148],LineName[32],LinePW[32];
    new 
txtlen;
    for(new 
line;line<maxlines;line++) {
        
read_file(USER_FILE,line,szLineText,147,txtlen)
        
parse(szLineText,LineName,31,LinePW,31)
        if(
equali(UserName,LineName)) {
            if(!
equal(UserPW,LinePW)) {
                
server_cmd("kick #%d ^"Server'a Giris Hakkiniz Yok Cunku PW Yanlis Girdiniz^"",get_user_userid(id))
                return PLUGIN_HANDLED
            }
        }
    }
    return PLUGIN_CONTINUE
    
}
public PasswordRequest(id) {
    if(is_user_registered(id)) {
        client_print(id,print_chat,"Zaten Nickiniz Sifreli")
        return PLUGIN_HANDLED
    }
    
    MessageModeByServer = true;
    client_cmd(id,"messagemode ^"Sifrenizi Giriniz^"")
    return PLUGIN_HANDLED
}
public PasswordReceive(id) {
    if(!MessageModeByServer) {
        console_print(id,"Gecersiz Istek")
        return PLUGIN_HANDLED
    }
    new szText[32];
    read_args(szText,31)
    remove_quotes(szText)
    new cmd[10],szPW[32],others[32];
    parse(szText,cmd,9,szPW,31,others,31)
    remove_quotes(szPW)
    new szName[32];
    get_user_name(id,szName,31)
    MessageModeByServer = false;
    
    if(szPW[0] == 0) {
        client_print(id,print_chat,"Sifre Kismi Bos Birakilamaz")
        client_cmd(id,"messagemode ^"Sifrenizi Giriniz^"")
        return PLUGIN_HANDLED
    }
    
    register_user(szName,szPW)
    client_print(id,print_chat,"Nickiniz Basariyla Sifrelendi. Nick: %s PW: %s",szName,szPW)
    client_cmd(id,"setinfo _pw ^"%s^"",szPW)
    return PLUGIN_HANDLED
}
stock is_user_registered(id) {
    new name[32];
    get_user_name(id,name,31)
    
    new szLineText[128],txtlen;
    new LineName[64],LinePW[64];
    new maxlines;
    maxlines = file_size(USER_FILE,1);
    for(new line;line<maxlines;line++) {
        read_file(USER_FILE,line,szLineText,127,txtlen)
        parse(szLineText,LineName,63,LinePW,63)
        if(equali(name,LineName)) {
            return true;
        }
    }
    return false;
}
stock register_user(const szName[],const szPW[]) {
    new LineText[148];
    formatex(LineText,147,"^"%s^" ^"%s^"",szName,szPW)
    write_file(USER_FILE,LineText)
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1055\\ f0\\ fs16 \n\\ par }
*/ 

Last edited by svas; 02-16-2020 at 18:42.
svas is offline
 



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 17:38.


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