[Include] Smart Chat
#1

Smart Chat

V1
Newer version


V1 Features:
SmartChatGeneral
SmartChatAnim
SmartChatBubble
SmartChatLog
/seat

Description:


SmartChatGeneral
pawn Код:
SmartChatGeneral(playerid,stringtext[],log,addition[],range1,range2,range3,range4,range5,color1,color2,color3,color4,color5)
___________________
pawn Код:
playerid        = Sender (f.e: playerid,3,toplayerid,etc)
stringtext[]    = The chat string (f.e: string,"This is the chat",chat,etc)
log             = 1 to save the log. 0 to do nothing with the log. (Chat log.ini is saved inside scriptfiles)
addition        = To put additional text inside the chat (f.e "Low",string,"Wishper",etc)
range1 - range5 = The chat range (In meter)
color1 - color5 = The chat color
___________________
There's 6 chat format:
pawn Код:
addition = string   My Name[string]: Testing.  
addition = 0        My Name: Testing.
addition = -1       *My Name Testing.*
addition = -2       Testing. ((My Name))
addition = -3       (([id]My Name: Testing.))
addition = -4       (([OOC]My Name: Testing.))
___________________
Example:
pawn Код:
SmartChatGeneral(playerid,text,1,"Low",2,4,6,8,10,White1,Chat1,Chat2,Chat3,Chat4);
Will show:
pawn Код:
My Name[Low]: (string of text)
pawn Код:
SmartChatGeneral(playerid,"Testing.",1,-1,2,4,6,8,10,White1,Chat1,Chat2,Chat3,Chat4);
Will show:
pawn Код:
*My Name Testing.*
You can change the range to whatever you want. Put 0 in it to disable certain range.
Put -1 in range1 to make global chat.

___________________
SmartChatAnim
pawn Код:
SmartChatAnim(playerid,stringtext[],length)
___________________
pawn Код:
playerid    = Player who do anim (f.e: playerid,3,toplayerid,etc)
stringtext[]= The chat string to get the string length (f.e: string,"This is the chat",chat,etc)
length      = The chat time (f.e 25,50,75,etc.)
___________________
1 character is counted as 1 ms.
Formula:
pawn Код:
stringtext[] * length
So if you have (I am handsome)13 character in your stringtext[] and you put 50 in your length, player will do anim in:
pawn Код:
13 * 50 = 650 ms
___________________
SmartChatBubble
pawn Код:
SmartChatBubble(playerid,string,1,1,Purple,Purple,10,5000);
___________________
pawn Код:
playerid        = The player (f.e: playerid,3,toplayerid,etc)
stringtext[]    = The bubble string (f.e: string,"This is the bubble",bubble,etc)
log             = 1 to save the log. 0 to do nothing with the log. (Chat log.ini is saved inside scriptfiles)
selftext        = 1 to send stringtext[] to playerid. 0 To do nothing with it
selftextcolor   = The color of selftext
range           = Draw distance of the bubble
time            = Time of the bubble to destroyed
___________________
SmartChatLog
pawn Код:
SmartChatLog(string[])
___________________
pawn Код:
string = The string that will be writed to log
You can add this anywhere you want it. It will saved in same file as the other log (Chat log.ini)

Extra:
NameUnder(playerid) to get player's name without "_"
TimeDate() to get time and date.

pawn Код:
public OnPlayerText(playerid,text[])
{
    if(IsPlayerInAnyVehicle(playerid)) VehicleChat(playerid,text);
    SmartChatGeneral(playerid,text,0,"0",5,7,10,15,17,White1,Chat1,Chat2,Chat3,Chat4);
    SmartChatAnim(playerid,text,at);
    SmartChatLog(text);
    return 0;
}
Note
  1. White1,Chat1,Chat2,Chat3 and Chat4 alreadi defined inside include.
  2. This will remove "_" in player's name.
  3. Block chat from different virtual world.
  4. The chat will be splitted to 2 lines.
  5. You can add /seat command to your script depend on what command processor you use. f.e:
    pawn Код:
    CMD:seat(playerid,params[])
    {
        if(PlayerSeat[playerid] == true) ApplyAnimation(playerid,"PED","SEAT_UP",4,0,0,0,0,0,1),PlayerSeat[playerid] = false;
        else ApplyAnimation(playerid,"PED","SEAT_DOWN",4,0,0,0,1,0,1),PlayerSeat[playerid] = true;
        return 1;
    }
    That's for zcmd. Seat also have unique chat anim.
Installation
Download Smart Chat V1.inc (Click skip on top right of your screen)
Copy SmartChat.inc to your server folder /pawno/include
Put this on top of your script:
pawn Код:
#include <SmartChat>
Important!
You must have foreach and YSI
You can disable anim for a while with put this anywhere you want it:
pawn Код:
AnimON[playerid] = false;
But remember you have to put this to enable it again.
pawn Код:
AnimON[playerid] = true;
You have any question/suggestion/bug? Put them here!!!
Please put any feedback.

Okay folks have fun.
Reply
#2

Meh, looks good enough :P Why does it say..

Код:
...,This is chat 4-
-chat 4,...
Reply
#3

Quote:
Originally Posted by coole210
Посмотреть сообщение
Meh, looks good enough :P Why does it say..

Код:
...,This is chat 4-
-chat 4,...
To make it easier for player to read.
Reply
#4

lol, you could just skip a line, anyways, great job. Great for RP'ers
Reply
#5

Quote:
Originally Posted by dr.pepper
Посмотреть сообщение
lol, you could just skip a line, anyways, great job. Great for RP'ers
If people ask me to do this then I'll change that.
Thanks.
Reply
#6

Finally new version
Gonna test it out on my server now ;]
Reply
#7

working perfectly...
thanks, varthshenon.
Reply
#8

Quote:
Originally Posted by Rickye
Посмотреть сообщение
working perfectly...
thanks, varthshenon.
Mhm not for me sine his y_ini has a conflict with my one...
Reply
#9

Quote:
Originally Posted by varthshenon
Посмотреть сообщение
Impotant!
o.O Impotant
Reply
#10

I see you're a LS-RP player developing its systems.

Very good for a newbie scripter (;

Good luck in next scripts.
Reply
#11

Quote:
Originally Posted by Rickye
Посмотреть сообщение
working perfectly...
thanks, varthshenon.
You're welcome

Quote:
Originally Posted by Tachibana
Посмотреть сообщение
Mhm not for me sine his y_ini has a conflict with my one...
That's not my y_ini. That's ******'s y_ini and always be.

Quote:
Originally Posted by [GF]Sasino97
Посмотреть сообщение
o.O Impotant
edited

Quote:
Originally Posted by Luнs Miki
Посмотреть сообщение
I see you're a LS-RP player developing its systems.

Very good for a newbie scripter (;

Good luck in next scripts.
Yes I am but too bad I'm banned for doing something stupid
But thanks to LS-RP, if they didn't ban me I would never learn scripting sa-mp.
And this isn't their system


Btw, If you have any suggestion don't be shame to post it here.
Reply
#12

Quote:
Originally Posted by varthshenon
Посмотреть сообщение
You're welcome



That's not my y_ini. That's ******'s y_ini and always be.



edited



Yes I am but too bad I'm banned for doing something stupid
But thanks to LS-RP, if they didn't ban me I would never learn scripting sa-mp.
And this isn't their system


Btw, If you have any suggestion don't be shame to post it here.
It was ment to be used as a metaphor...
Anyways you gonna try to get that stuff fixed?
Reply
#13

Quote:
Originally Posted by Tachibana
Посмотреть сообщение
It was ment to be used as a metaphor...
Anyways you gonna try to get that stuff fixed?
I see no problem when I compile it with blank script.
Post your error message.
Reply
#14

Quote:
Originally Posted by varthshenon
Посмотреть сообщение
I see no problem when I compile it with blank script.
Post your error message.
All of them are y_ini errors:




((addes as a picture, too much errors to copy around)) these are all errors, happens even when I ONLY add
pawn Код:
#include        <SmartChat>
and when removed script works perfectly fine.
Reply
#15

Where is the error happen?
Inside SmartChat include or y_ini include?
Reply
#16

Quote:
Originally Posted by varthshenon
Посмотреть сообщение
Where is the error happen?
Inside SmartChat include or y_ini include?
Error happens on my y_ini GM when I add include <smartchat>
Reply
#17

Quote:
Originally Posted by Tachibana
Посмотреть сообщение
Error happens on my y_ini GM when I add include <smartchat>
Try to make a blank script and compile it with Smart Chat. I guess your GM is messed with Smart Chat (You make a new global variable or IDK something I don't understand (yet)).
I didn't see any problem in it.
Reply
#18

Quote:
Originally Posted by varthshenon
Посмотреть сообщение
Try to make a blank script and compile it with Smart Chat. I guess your GM is messed with Smart Chat (You make a new global variable or IDK something I don't understand (yet)).
I didn't see any problem in it.
Works on a blank GM...

My guts are telling me its a conflict between y_ini's...

((Blank GM that SmartChat works DOES NOT use y_ini))
Reply
#19

Forgot to tell this, put -1 in range1 to make global chat.
Reply
#20

Cool!!
I love this.
Reply


Forum Jump:


Users browsing this thread: 5 Guest(s)