can help i cant see the chat what players write and no player can see what i write why pls help whit this chat
tell me what you want to show you the chat didnt work i cant waht players write
I don't understand you, you're from America and you're speaking like that. I'm sure it'd be OnPlayerText you'd need to show!
no whene we play in server we what chat press t and type and enter that have to show to all players but that didnt ??
Код:
public OnPlayerText(playerid, text[])
{
if(text[0] == '.' && PlayerInfo[playerid][Level] >= 1) {
new string[128]; GetPlayerName(playerid,string,sizeof(string));
format(string,sizeof(string),"[A.Chat]: %s: %s",string,text[1]);
MessageToAdmins(0xFD01FDAA,string);
return 0;
}
if(text[0] == '@' && PlayerInfo[playerid][Level] >= 5) {
new string[128]; GetPlayerName(playerid,string,sizeof(string));
format(string,sizeof(string),"[L5.Chat]: %s: %s",string,text[1]);
MessageTo5(0x710C7EC8,string);
return 0;
}
if(text[0] == '$' && PlayerInfo[playerid][Level] >= 6) {
new string[128]; GetPlayerName(playerid,string,sizeof(string));
format(string,sizeof(string),"[HR.Chat]: %s: %s",string,text[1]); MessageTo6(0x99FF00AA,string);
return 0;
}
if(ServerInfo[DisableChat] == 1) {
SendClientMessage(playerid,red,"Chat has been disabled");
return 0;
}
if(PlayerInfo[playerid][Muted] == 1)
{
PlayerInfo[playerid][MuteWarnings]++;
new string[128];
if(PlayerInfo[playerid][MuteWarnings] < ServerInfo[MaxMuteWarnings]) {
format(string, sizeof(string),"Server: You are muted, if you continue to speak you will be kicked. (%d / %d)", PlayerInfo[playerid][MuteWarnings], ServerInfo[MaxMuteWarnings] );
SendClientMessage(playerid,red,string);
} else {
SendClientMessage(playerid,red,"You have been warned ! Now you have been kicked");
format(string, sizeof(string),"Server has kicked %s (ID %d) (Exceed Mute Warnings)", PlayerName2(playerid), playerid);
SendClientMessageToAll(grey,string);
SaveToFile("KickLog",string); Kick(playerid);
} return 0;
}
if(ServerInfo[AntiSpam] == 1 && (PlayerInfo[playerid][Level] == 0 && !IsPlayerAdmin(playerid)) )
{
if(PlayerInfo[playerid][SpamCount] == 0) PlayerInfo[playerid][SpamTime] = TimeStamp();
PlayerInfo[playerid][SpamCount]++;
if(TimeStamp() - PlayerInfo[playerid][SpamTime] > SPAM_TIMELIMIT) { // Its OK your messages were far enough apart
PlayerInfo[playerid][SpamCount] = 0;
PlayerInfo[playerid][SpamTime] = TimeStamp();
}
else if(PlayerInfo[playerid][SpamCount] == SPAM_MAX_MSGS) {
new string[64]; format(string,sizeof(string),"Server has kicked %s (Flood/Spam Protection)", PlayerName2(playerid));
SendClientMessageToAll(red,string); print(string);
SaveToFile("KickLog",string);
Kick(playerid);
}
else if(PlayerInfo[playerid][SpamCount] == SPAM_MAX_MSGS-1) {
SendClientMessage(playerid,red,"Server: Anti Spam Warning! Next is a kick.");
return 0;
}
}
if(ServerInfo[AntiSwear] == 1 && PlayerInfo[playerid][Level] < ServerInfo[MaxAdminLevel])
for(new s = 0; s < ForbiddenWordCount; s++)
{
new pos;
while((pos = strfind(text,ForbiddenWords[s],true)) != -1) for(new i = pos, j = pos + strlen(ForbiddenWords[s]); i < j; i++) text[i] = '*';
}
if(PlayerInfo[playerid][Caps] == 1) UpperToLower(text);
if(ServerInfo[NoCaps] == 1) UpperToLower(text);
for(new i = 1; i < MAX_CHAT_LINES-1; i++) Chat[i] = Chat[i+1];
new ChatSTR[128]; GetPlayerName(playerid,ChatSTR,sizeof(ChatSTR)); format(ChatSTR,128,"[lchat]%s: %s",ChatSTR, text[0] );
Chat[MAX_CHAT_LINES-1] = ChatSTR;
switch (PlayerInfo[playerid][OnDuty])
{
case 0:
{
new string[128];
format(string,sizeof(string),"%s [%i]: {FFFFFF}%s",PlayerName2(playerid),playerid,text);
SetPlayerChatBubble(playerid, text, 0xFFFFFFFF, 100.0, 10000);
printf("%s [%i]: %s", PlayerName2(playerid),playerid,text);
SendClientMessageToAll(GetPlayerColor(playerid),string);
return 0;
}
case 1:
{
new aName[MAX_PLAYER_NAME], string2[128];
GetPlayerName(playerid, aName,sizeof(aName));
format(string2,sizeof(string2),"Admin %s: %s",aName,text);
printf(string2);
SendClientMessageToAll(COLOR_PINK,string2);
return 0;
}
}
return 1;
}
Thats the CMD for it. And change ur location. It feels awkward!
Код:
CMD:t(playerid,params[]) {
#pragma unused params
if(isnull(params)) return SendClientMessage(playerid, red, "To Chat With Your Team: /T [Text]");
new Name[MAX_PLAYER_NAME]; GetPlayerName(playerid, Name, sizeof(Name));
new string[128];
format(string, sizeof(string), "[/T][TEAM CHAT] %s: %s", Name, params[0]);
printf("%s", string);
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) && gTeam[i] == gTeam[playerid]) SendClientMessage(i, , string);
}
return 1;
}
No I mean that players in my server can't use chat the player write but no body see what he write (chat doesn't work in my server )
pawn Код:
public OnPlayerText(playerid, text[])
{
new text[128], [MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
format(text, sizeof(text), "%s[%d]: {FFFFFF}%s", name, playerid, text);
SendClientMessageToAll(GetPlayerColor(playerid), text)
return 0;
}