SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Filterscripts > Includes

Reply
 
Thread Tools Display Modes
Old 29/06/2011, 03:34 AM   #1
=WoR=Varth
High-roller
 
=WoR=Varth's Avatar
 
Join Date: Apr 2011
Location: Indonesia
Posts: 2,010
Reputation: 133
Post Smart Chat V1

Smart Chat

V1

Newer version


V1 Features:
SmartChatGeneral
SmartChatAnim
SmartChatBubble
SmartChatLog
/seat

Description:


SmartChatGeneral
pawn Code:
SmartChatGeneral(playerid,stringtext[],log,addition[],range1,range2,range3,range4,range5,color1,color2,color3,color4,color5)
___________________
pawn Code:
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 Code:
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 Code:
SmartChatGeneral(playerid,text,1,"Low",2,4,6,8,10,White1,Chat1,Chat2,Chat3,Chat4);
Will show:
pawn Code:
My Name[Low]: (string of text)

pawn Code:
SmartChatGeneral(playerid,"Testing.",1,-1,2,4,6,8,10,White1,Chat1,Chat2,Chat3,Chat4);
Will show:
pawn Code:
*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 Code:
SmartChatAnim(playerid,stringtext[],length)
___________________
pawn Code:
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 Code:
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 Code:
13 * 50 = 650 ms

___________________
SmartChatBubble
pawn Code:
SmartChatBubble(playerid,string,1,1,Purple,Purple,10,5000);
___________________
pawn Code:
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 Code:
SmartChatLog(string[])
___________________
pawn Code:
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 Code:
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 Code:
    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 Code:
#include <SmartChat>

Important!
You must have foreach and YSI
You can disable anim for a while with put this anywhere you want it:
pawn Code:
AnimON[playerid] = false;
But remember you have to put this to enable it again.
pawn Code:
AnimON[playerid] = true;

You have any question/suggestion/bug? Put them here!!!
Please put any feedback.

Okay folks have fun.
__________________
(RETIRED)

Last edited by =WoR=Varth; 21/07/2011 at 04:11 AM. Reason: asd
=WoR=Varth is offline   Reply With Quote
Old 29/06/2011, 03:47 AM   #2
coole210
High-roller
 
Join Date: Jul 2008
Location: Canada
Posts: 1,013
Reputation: 84
Default Re: Smart Chat

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

Code:
...,This is chat 4-
-chat 4,...
coole210 is offline   Reply With Quote
Old 29/06/2011, 03:49 AM   #3
=WoR=Varth
High-roller
 
=WoR=Varth's Avatar
 
Join Date: Apr 2011
Location: Indonesia
Posts: 2,010
Reputation: 133
Default Re: Smart Chat

Quote:
Originally Posted by coole210 View Post
Meh, looks good enough :P Why does it say..

Code:
...,This is chat 4-
-chat 4,...
To make it easier for player to read.
__________________
(RETIRED)
=WoR=Varth is offline   Reply With Quote
Old 29/06/2011, 03:54 AM   #4
dr.pepper
Huge Clucker
 
dr.pepper's Avatar
 
Join Date: Jul 2009
Posts: 317
Reputation: 38
Default Re: Smart Chat

lol, you could just skip a line, anyways, great job. Great for RP'ers
dr.pepper is offline   Reply With Quote
Old 29/06/2011, 04:03 AM   #5
=WoR=Varth
High-roller
 
=WoR=Varth's Avatar
 
Join Date: Apr 2011
Location: Indonesia
Posts: 2,010
Reputation: 133
Default Re: Smart Chat

Quote:
Originally Posted by dr.pepper View Post
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.
__________________
(RETIRED)
=WoR=Varth is offline   Reply With Quote
Old 29/06/2011, 04:09 AM   #6
Tachibana
Huge Clucker
 
Tachibana's Avatar
 
Join Date: May 2011
Posts: 450
Reputation: 14
Default Re: Smart Chat

Finally new version
Gonna test it out on my server now ;]
__________________
Tokyo! Because we all love Japan. Coming soon!
Tachibana is offline   Reply With Quote
Old 29/06/2011, 02:33 PM   #7
Rickye
Little Clucker
 
Join Date: Jun 2011
Posts: 25
Reputation: 0
Default Re: Smart Chat

working perfectly...
thanks, varthshenon.
Rickye is offline   Reply With Quote
Old 29/06/2011, 02:37 PM   #8
Tachibana
Huge Clucker
 
Tachibana's Avatar
 
Join Date: May 2011
Posts: 450
Reputation: 14
Default Re: Smart Chat

Quote:
Originally Posted by Rickye View Post
working perfectly...
thanks, varthshenon.
Mhm not for me sine his y_ini has a conflict with my one...
__________________
Tokyo! Because we all love Japan. Coming soon!
Tachibana is offline   Reply With Quote
Old 29/06/2011, 02:46 PM   #9
Sasino97
High-roller
 
Sasino97's Avatar
 
Join Date: Dec 2010
Location: Italy
Posts: 1,416
Reputation: 117
Default Re: Smart Chat V1

Quote:
Originally Posted by varthshenon View Post
Impotant!
o.O Impotant
__________________
Desktop, Web, Mobile and Game Developer
  • SA-MP Game Modes and Filter Scripts (PAWN, SQL) (8 years experience)
  • Windows .NET Applications (WPF, UWP)
  • Android Applications (Java Android SDK, Xamarin)
  • Web Design and Development (Wordpress, ASP.NET MVC, PHP, SQL)
  • Game Development (Unity3D, GameMaker Studio, LibGDX)
sasinosoft@gmail.com
Use this email - don't PM
Sasino97 is offline   Reply With Quote
Old 29/06/2011, 04:30 PM   #10
steki.
High-roller
 
steki.'s Avatar
 
Join Date: Nov 2010
Location: São Paulo, Brasil
Posts: 2,570
Reputation: 315
Default Re: Smart Chat

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

Very good for a newbie scripter (;

Good luck in next scripts.
__________________
Rio
steki. is offline   Reply With Quote
Reply

Thread Tools
Display Modes

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to remove 'Smart Engine' MrND Everything and Nothing 1 02/01/2011 09:33 AM
Need help with Smart vehicle locking graetz Help Archive 3 07/03/2010 11:56 AM
need help from smart scripters DJDUST_OWNER Help Archive 3 26/01/2010 11:02 PM


All times are GMT. The time now is 09:32 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.