Home
Register
FAQ
Search
Login




Reply to topic  [ 3 posts ] 
SMS chat plugin - Green text? 
Author Message
Membru

User avatar
Grup: Membru
Joined: Mon Nov 16, 2009 10:34
Posts: 11
A multumit de : 0 ori
Multumiri primite : 0
Timp Conectat: 5m 56s
Post SMS chat plugin - Green text?
Hello, i have plugin, that takes last message form sql database and prints it to chat. But how to i make it green,blue or red?

resultado[1] is the message.
Code:
client_print(0, print_chat, "[SMS CHAT] %s", resultado[1])


Thu Jan 28, 2010 12:10
Profile E-mail
Membru

User avatar
Grup: Membru
Joined: Sun Sep 13, 2009 10:32
Posts: 2
A multumit de : 0 ori
Multumiri primite : 0
Timp Conectat: 5m 50s
Post Re: SMS chat plugin - Green text?
Tanel if u want I can help you, but could you provide a little bit more of the code?


Fri Jan 29, 2010 12:39
Profile E-mail
Membru

User avatar
Grup: Membru
Joined: Mon Nov 16, 2009 10:34
Posts: 11
A multumit de : 0 ori
Multumiri primite : 0
Timp Conectat: 5m 56s
Post Re: SMS chat plugin - Green text?
You just want the whole code, dont you :D ?
Actually, to help me, you dont need more.

But anyway, I solved the problem.

I added this code(found it in this forum):
Code:
stock client_print_green(index, const message[], {Float, Sql, Result,_}:...) { //color by me (Alka)
   
   new Buffer[512], Buffer2[512], id, msg_type;
   formatex(Buffer2, sizeof Buffer2 - 1, "^x04%s", message);
   vformat(Buffer, sizeof Buffer - 1, Buffer2, 3);
   
   if(index) {
      id = index;
      msg_type = MSG_ONE;
   }
   else {
      id = FindPlayer();
      msg_type = MSG_ALL;
   }
   message_begin(msg_type, get_user_msgid("SayText"), _, id);
   write_byte(id);
   write_string(Buffer);
   message_end();
}

public FindPlayer()
{   
   new players[32], num;
   get_players(players, num);
   
   new i = -1;
   
   while(i < num)
   {
      if(is_user_connected(++i))
      {
         return i;
      }
   }
   return -1;
}


And then just
Code:
client_print_green(0, "[SMS CHAT] %s", resultado[1])


Thank you alka :)


Fri Jan 29, 2010 5:52
Profile E-mail
Display posts from previous:  Sort by  
Reply to topic   [ 3 posts ] 


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Structura temei creată de Happy si modificată de Jay
Propulsat de phpBB © 2000, 2002, 2005, 2007 phpBB Group
cs-utilz.net & rLz.ro © 2007 - 2010



phpBB SEO