29.06.2011, 02:34
(
Последний раз редактировалось =WoR=Varth; 21.07.2011 в 03:11.
Причина: asd
)
Smart Chat
V1
Newer versionV1 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);
pawn Код:
My Name[Low]: (string of text)
pawn Код:
SmartChatGeneral(playerid,"Testing.",1,-1,2,4,6,8,10,White1,Chat1,Chat2,Chat3,Chat4);
pawn Код:
*My Name Testing.*
Put -1 in range1 to make global chat.
___________________
SmartChatAnimpawn Код:
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
pawn Код:
13 * 50 = 650 ms
___________________
SmartChatBubblepawn Код:
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
___________________
SmartChatLogpawn Код:
SmartChatLog(string[])
pawn Код:
string = The string that will be writed to log
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;
}
- White1,Chat1,Chat2,Chat3 and Chat4 alreadi defined inside include.
- This will remove "_" in player's name.
- Block chat from different virtual world.
- The chat will be splitted to 2 lines.
- 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;
}
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>
You must have foreach and YSI
You can disable anim for a while with put this anywhere you want it:
pawn Код:
AnimON[playerid] = false;
pawn Код:
AnimON[playerid] = true;
Please put any feedback.
Okay folks have fun.