My Server chat works only for Admins And PM's -
arafa001 - 26.09.2011
i have a proplem makes me crazy
my server works for Admins chat like that
Arafa(admin):hello !!
and pm's
a pm From Arafa(1) : i can't speak in chat !!
but the regular chat sutck for players
can some one help me ??
Re: My Server chat works only for Admins And PM's -
[HiC]TheKiller - 26.09.2011
What gamemode are you using? Make sure that you are returning 1 instead of 0 on OnPlayerText.
Re: My Server chat works only for Admins And PM's -
Kingunit - 26.09.2011
How about - dropping your code here. Otherwise we can't really help.
Re: My Server chat works only for Admins And PM's -
arafa001 - 26.09.2011
pawn Код:
public OnPlayerText(playerid, text[])
{
return 1;
}
public OnPlayerPrivmsg(playerid, recieverid, text[])
{
return 1;
}
can some one tell me what is wrong
Re: My Server chat works only for Admins And PM's -
arafa001 - 26.09.2011
my game mode is stunts/races/DMs
Re: My Server chat works only for Admins And PM's -
Wesley221 - 26.09.2011
Check any other filterscript for the callback 'OnPlayerText', and post them here if you didnt solve the problem. And next time try not to double-post, but just edit your post.
Re: My Server chat works only for Admins And PM's -
arafa001 - 26.09.2011
sorry about repost
here is LuxAdmin
pawn Код:
//==============================================================================
//-------------------------------------------------
// Player Text
//-------------------------------------------------
//==============================================================================
public OnPlayerText(playerid, text[])
{
//==============================================================================
// Vip Chat
//==============================================================================
if(text[0] == '*' && AccInfo[playerid][pVip] >= 1)
{
new string[128]; GetPlayerName(playerid,string,sizeof(string));
format(string,sizeof(string),"|ChatVip| %s: %s",string,text[1]);
MessageToPlayerVIP(0xDC686BAA,string);
SaveIn("ChatVipLog",string);
return 0;
}
//==============================================================================
// Administration Chat
//==============================================================================
if(text[0] == '#' && AccInfo[playerid][Level] >= 1)
{
new string[128]; GetPlayerName(playerid,string,sizeof(string));
format(string,sizeof(string),"Admin Chat: %s: %s",string,text[1]);
MessageToAdmins(green,string);
#if ADM_CHAT_LOG == true
SaveIn("AdmChatLog",string);
#endif
return 0;
}
//==============================================================================
// Chat Disabled
//==============================================================================
if(ServerInfo[DisableChat] == 1)
{
SendClientMessage(playerid,red,"|- Chat has been Disabled! -|");
return 0;
}
//==============================================================================
// Player Muted
//==============================================================================
if(AccInfo[playerid][Muted] == 1)
{
AccInfo[playerid][MuteWarnings]++;
new string[128];
if(AccInfo[playerid][MuteWarnings] < ServerInfo[MaxMuteWarnings])
{
format(string, sizeof(string),"|- ATTENTION: You are Muted! Cannot talk (Warnings: %d/%d) -|",AccInfo[playerid][MuteWarnings],ServerInfo[MaxMuteWarnings]);
SendClientMessage(playerid,red,string);
}
else
{
SendClientMessage(playerid,red,"|- You have been Automatically Kicked. | Reason: Exceeding Mute Warnings -|");
format(string, sizeof(string),"|- Player %s (Id:%d) has been Automatically Kicked. | Reason: Exceeding Mute Warnings -|",PlayerName2(playerid),playerid);
SendClientMessageToAll(grey,string);
SaveIn("KickLog",string); Kick(playerid);
} return 0;
}
//==============================================================================
// Flood/Spam Protection
//==============================================================================
if(ServerInfo[AntiSpam] == 1 && (AccInfo[playerid][Level] == 0 && !IsPlayerAdmin(playerid)))
{
if(AccInfo[playerid][SpamCount] == 0) AccInfo[playerid][SpamTime] = TimeStamp();
AccInfo[playerid][SpamCount]++;
if(TimeStamp() - AccInfo[playerid][SpamTime] > SPAM_TIMELIMIT) { // Its OK your messages were far enough apart
AccInfo[playerid][SpamCount] = 0;
AccInfo[playerid][SpamTime] = TimeStamp();
}
else if(AccInfo[playerid][SpamCount] == SPAM_MAX_MSGS) {
new string[64]; format(string,sizeof(string),"|- Player %s (Id:%d) has been Automatically Kicked. | Reason: Flood/Spam Protection", PlayerName2(playerid),playerid);
SendClientMessageToAll(grey,string); print(string);
SaveIn("KickLog",string);
Kick(playerid);
}
else if(AccInfo[playerid][SpamCount] == SPAM_MAX_MSGS-1) {
SendClientMessage(playerid,red,"ATTENTION: Anti Spam Warning! Next is a Kick!");
return 0;
}
}
//==============================================================================
// Send Admin in front of name
//==============================================================================
#if ADM_InMSG == true
if (AccInfo[playerid][Hide] == 0)
{
if(AccInfo[playerid][Level] > 0)
{
new str3[256];
format(str3, 256, "(Admin): %s", text);
for(new gz=0;gz<200;gz++)
if(IsPlayerConnected(gz))
SendPlayerMessageToPlayer(gz, playerid, str3);
else SendPlayerMessageToPlayer(gz, playerid, text);
}
return 0;
}
#endif
//==============================================================================
// Forbidden Words
//==============================================================================
if(ServerInfo[AntiSwear] == 1 && AccInfo[playerid][Level] < ServerInfo[MaxAdminLevel])
for(new s = 0; s < BadWordsCount; s++)
{
new pos;
while((pos = strfind(text,BadWords[s],true)) != -1)
for(new i = pos, j = pos + strlen(BadWords[s]); i < j; i++) text[i] = '*';
}
//==============================================================================
// Anti Advertisements
//==============================================================================
if(ServerInfo[AntiAds] == 1)
{
if(AdvertisementCheck(text) && AccInfo[playerid][Level] < 3)
{
AccInfo[playerid][MaxAdv]++;
new string[128];
format(string,sizeof(string),"|- Warning! Suspected ads in your message! (Warnings: %d/%d)",AccInfo[playerid][MaxAdv], MAX_ADV_WARNINGS);
SendClientMessage(playerid, grey,string);
if(AccInfo[playerid][MaxAdv] == MAX_ADV_WARNINGS)
{
format(string,sizeof(string),"|- You is Automatically Kicked. | Reason: Many ads in your Messages (%d/%d) -|",AccInfo[playerid][MaxAdv], MAX_ADV_WARNINGS);
SendClientMessage(playerid, lightred,string);
format(string,sizeof(string),"|- Player %s (Id:%d) has beenAutomatically Kicked. | Reason: Many Advertisements! (%d) -|",PlayerName2(playerid),playerid, MAX_ADV_WARNINGS);
SaveIn("KickLog",string); Kick(playerid);
SendClientMessageToAll(lightred, string);
print(string);
}
return 0;
}
}
//==============================================================================
// Block CapsLock
//==============================================================================
if(AccInfo[playerid][Caps] == 1)
UpperToLower(text);
if(ServerInfo[NoCaps] == 1)
UpperToLower(text);
//==============================================================================
// Chat Lines (Console)
//==============================================================================
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,"[CHAT]%s: %s",ChatSTR, text[0]);
Chat[MAX_CHAT_LINES-1] = ChatSTR;
return 1;
}
Re: My Server chat works only for Admins And PM's -
Wesley221 - 26.09.2011
Ask the other player if he gets any message like your chat is disabled or something.
Re: My Server chat works only for Admins And PM's -
arafa001 - 26.09.2011
no ,, i did a new name to see the errors
you press T the chat box then you appear ,, you write what ever you want
press ENTER the box disappear but nothing in chat show up
but in "samp-server.exe" console i see the chat what ever they type !!
Re: My Server chat works only for Admins And PM's -
Wesley221 - 26.09.2011
pawn Код:
public OnPlayerText(playerid, text[])
{
new string[128], name[24];
GetPlayerName(playerid, name, sizeof name);
format( string, sizeof string, "%s(%i): %s", name, playerid, text );
SendClientMessage(playerid, GetPlayerColor(playerid), string);
return 1;
}
Try this, and see if it sends the message