15.04.2015, 14:31
(
Последний раз редактировалось ATGOggy; 15.04.2015 в 15:36.
)
PHP код:
public OnPlayerText(playerid, text[])
{
new count=0, lastpos=0;
while(strfind(text, "\n", true, lastpos)!=-1)
{
lastpos=strfind(text, "\n", true, lastpos);
count++;
}
if(count>0)
{
new messages[16][256];
lastpos=0;
count=0;
while(strfind(text, "\n", true, lastpos)!=-1)
{
format(messages[count], sizeof(messages[]), "%s", text[lastpos]);
lastpos=strfind(text, "\n", true, lastpos);
strdel(messages[count], lastpos, sizeof(messages[]));
count++;
}
for(new i=0; i<sizeof (messages[]); i++)
{
new string[256], playername[MAX_PLAYER_NAME];
GetPlayerName(playerid, playername, sizeof(playername));
format(string, sizeof(string), "%s[%d]: %s", playername, playerid, messages[i]);
SendClientMessageToAll(GetPlayerColor(playerid), string);
return 0;
}
}
return 1;
}