Raised This Month: $ Target: $400
 0% 

Can't find string in buffer


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
eyal282
Veteran Member
Join Date: Aug 2011
Old 07-15-2017 , 06:44   Can't find string in buffer
Reply With Quote #1

PHP Code:

/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "FuckTheSchool ( Eyal282 )"


public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)

    
register_message(get_user_msgid("SayText"), "message_SayText");
}

public 
message_SayText(msgidsomethingid)
{    
    
// 1 = id, 2 = Contains Terrorist or Spectator if team chat, 3 = message sent.
    
new Message[256], PerhapsTeam[100];
    
    
get_msg_arg_string(2PerhapsTeam99);
    
get_msg_arg_string(4Messagecharsmax(Message));

    
    new 
bool:TeamChat;
    
    if(
containi(PerhapsTeam"Terr") != -1)
    {
        
TeamChat true;
        
        
client_print(idprint_chat"BOIII");
    }
    
    else
        
client_print(idprint_chatPerhapsTeam);

Output:

Code:
(Terrorist)  :

Last edited by eyal282; 07-15-2017 at 06:44.
eyal282 is offline
PRoSToTeM@
Veteran Member
Join Date: Jan 2010
Location: Russia, Ivanovo
Old 07-15-2017 , 07:05   Re: Can't find string in buffer
Reply With Quote #2

Because it is #Cstrike_Chat_T.
__________________
PRoSToTeM@ is offline
Send a message via ICQ to PRoSToTeM@ Send a message via Skype™ to PRoSToTeM@
eyal282
Veteran Member
Join Date: Aug 2011
Old 07-15-2017 , 08:11   Re: Can't find string in buffer
Reply With Quote #3

Quote:
Originally Posted by PRoSToTeM@ View Post
Because it is #Cstrike_Chat_T.
Thanks. Unrelated, I'm trying to remake the chat with a plugin.

How can I use ^2 when it also colors *DEAD* and (Terrorist) and it only works on the beginning of the ColorChat?
eyal282 is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 07-15-2017 , 09:15   Re: Can't find string in buffer
Reply With Quote #4

Quote:
Originally Posted by eyal282 View Post
Thanks. Unrelated, I'm trying to remake the chat with a plugin.

How can I use ^2 when it also colors *DEAD* and (Terrorist) and it only works on the beginning of the ColorChat?
there is no ^2

just ^1 is the default color chat. ( YELLOW )

& ^4 is green
& ^3 is team color
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !

Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
eyal282
Veteran Member
Join Date: Aug 2011
Old 07-15-2017 , 09:38   Re: Can't find string in buffer
Reply With Quote #5

Quote:
Originally Posted by Natsheh View Post
there is no ^2

just ^1 is the default color chat. ( YELLOW )

& ^4 is green
& ^3 is team color
The effects ^2 has disagree with your opinion. It changes color.
eyal282 is offline
PRoSToTeM@
Veteran Member
Join Date: Jan 2010
Location: Russia, Ivanovo
Old 07-15-2017 , 10:10   Re: Can't find string in buffer
Reply With Quote #6

STX works the same as in HL. https://github.com/ValveSoftware/hal....cpp#L202-L218
__________________
PRoSToTeM@ is offline
Send a message via ICQ to PRoSToTeM@ Send a message via Skype™ to PRoSToTeM@
eyal282
Veteran Member
Join Date: Aug 2011
Old 07-15-2017 , 10:17   Re: Can't find string in buffer
Reply With Quote #7

Quote:
Originally Posted by PRoSToTeM@ View Post
Uhh... That's not even AmxModX language.

Solved:

PHP Code:
public message_SayText(msgidsomethingid)
{
    new 
Message[256], MessageTags[40];
    
get_msg_arg_string(2MessageTagscharsmax(MessageTags));
    
get_msg_arg_string(4Messagecharsmax(Message));    

    
formatex(Formatcharsmax(Format), "%s %s"MessageTagsMessage);
        
    
ColorChat(iFormat);
}

stock ColorChat(const index, const string[], {FloatSqlResul,_}:...) 
{    
    if(!
index) return 1;
    
    if(
is_user_connected(index))
    {
        
        static 
SayText;
        
        if(!
SayText)
            
SayText get_user_msgid("SayText");
            
        
message_begin(MSG_ONE_UNRELIABLESayText,_index);
        
write_byte(index);
        
write_string(string);
        
message_end();
    }
    return 
1;


Last edited by eyal282; 07-16-2017 at 05:56.
eyal282 is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 07-16-2017 , 05:07   Re: Can't find string in buffer
Reply With Quote #8

Quote:
Originally Posted by eyal282 View Post
Uhh... That's not even AmxModX language.

Solved:

[php]
public message_SayText(msgid, something, id)
{
new Message[256], MessageTags[40];
get_msg_arg_string(2, MessageTags, charsmax(MessageTags));
get_msg_arg_string(4, Message, charsmax(Message));

formatex(Format, charsmax(Format), "%s %s", MessageTags, Message);

ColorChat(i, Format);
}

stock ColorChat(const index, const string[], {Float, Sql, Resul,_}:...)
{
if(!index) return 1;

if(is_user_connected(index))
{

static SayText;

if(!SayText)
SayText = get_user_msgid("SayText");

message_begin(MSG_ONE_UNRELIABLE, SayText,_, index);
write_byte(index);
write_string(string);
message_end();
}
return 1;
}
Theres no such a thing called amx modx language its called pawn and this is a module language which will be using C++ or else..
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !

Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
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 23:11.


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