Ide hogy birom megcsinálni hogy a /b vel írja? Amúgy Mike scriptje
#include <a_samp>
new Text:Textdraw[10];
public OnFilterScriptInit() {
print(\"SAMPFORUM.HU SCRIPTERLIGA - \'Custom chatbox\' - MIKE SCRIPTJE [ON]\");
for(new x; x < sizeof(Textdraw); x++) {
Textdraw
- = TextDrawCreate(284.000000, 352.000000+(x*, \" \");
TextDrawBackgroundColor(Textdraw
TextDrawFont(Textdraw
TextDrawLetterSize(Textdraw
TextDrawColor(Textdraw
TextDrawSetOutline(Textdraw
TextDrawSetProportional(Textdraw
TextDrawSetSelectable(Textdraw
}
ClearChat();
return 1;
}
public OnFilterScriptExit() {
print(\"SAMPFORUM.HU SCRIPTERLIGA - \'Custom chatbox\' - MIKE SCRIPTJE [OFF]\");
for(new x; x < sizeof(Textdraw); x++) {
TextDrawHideForAll(Textdraw
TextDrawDestroy(Textdraw
deleteproperty(x, \"\", 0);
}
return 1;
}
public OnPlayerSpawn(playerid) return ShowChat(playerid);
public OnPlayerDeath(playerid, killerid, reason) return HideChat(playerid);
public OnPlayerText(playerid, text[]) {
if(strlen(text) > 50) return SendClientMessage(playerid, 0xFF0000AA, \"Hiba, az üzeneted maximum 50 karakter lehet.\"), 0;
if(strfind(text, \"~\") != -1) return SendClientMessage(playerid, 0xFF0000AA, \"Hiba, az üzeneted nem tartalmazhat \'~\' karaktert.\"), 0;
new string[144], name[MAX_PLAYER_NAME]; GetPlayerName(playerid, name, MAX_PLAYER_NAME);
format(string, sizeof(string), \"~r~%s(%i): ~w~%s\", name, playerid, text);
SendMessage(FixGameString(string));
return 0;
}
public OnPlayerCommandText(playerid, cmdtext[]) {
if(!strcmp(cmdtext, \"/clearchat\")) {
GameTextForAll(FixGameString(\"~w~Chat megtisztítva.\"), 4000, 3);
ClearChat();
return 1;
}
return 0;
}
stock ShowChat(playerid) { for(new x; x < sizeof(Textdraw); x++) TextDrawShowForPlayer(playerid, Textdraw
stock HideChat(playerid) { for(new x; x < sizeof(Textdraw); x++) TextDrawHideForPlayer(playerid, Textdraw
stock SendMessage(text[]) {
for(new x; x < sizeof(Textdraw); x++) {
if(x == sizeof(Textdraw)-1) {
new data[144];
for(new i=1; i < sizeof(Textdraw); i++) {
getproperty(i, \"\", 0, data);
setproperty(i-1, \"\", 0, data);
}
setproperty(x, \"\", 0, text);
break;
}
if(!existproperty(x, \"\", 0)) { setproperty(x, \"\", 0, text); break; }
else continue;
}
UpdateChatbox();
}
stock UpdateChatbox() {
new data[144];
for(new x; x < sizeof(Textdraw); x++) {
getproperty(x, \"\", 0, data);
TextDrawSetString(Textdraw
}
}
stock ClearChat() for(new x; x < sizeof(Textdraw); x++) SendMessage(\" \");
//A függvény, és a tömb a fixchars include-ből van, amelyet GameStar készített. (Egy kicsit átalakítottam.)
static chlist[][0] = { \"¨\",\"\",\"ö\",\"Ö\",\"Ź\",\"\",\"ü\",\"Ü\",\"Ś\",\"\",\"ó\",\"Ó\",\"§\",\"\",\"ő\",\"Ő\",\"Ş\",\"\",\"ú\",\"Ú\",\"\",\"\",\"é\",\"É\",\"\",\"\",\"á\",\"Á\",\"Ť\",\"ˇ\",\"ű\",\"Ű\",\"˘\",\"\",\"í\",\"Í\" };
stock FixGameString(const fstring[]) {
new index, dest[256];
strmid(dest, fstring, 0, strlen(fstring), sizeof(dest));
for(index = 0; index < strlen(dest); index++)
for(new idx = 0; idx < sizeof(chlist); idx++)
if(dest[index] == chlist[idx][0]) dest[index] = chlist[idx-2][0];
return dest;
}