Jump to content
  • 0

pomoc Kde mám chybu....?


Mivčo

Dotaz

public OnPlayerText(playerid, text[]){
new placeholder;
if(PlayerInfo[playerid][Muted] == 1){
SendClientMessage(playerid, Red, "[Server] Nemôžeš písat...");
return 0;
}
if(text[0] == '!' && PlayerInfo[playerid][Admin] >= 1){
new string[256];
format(string,sizeof(string),"Admin Chat: %s: %s",pName(playerid),text[1]);
MessageToAdmins(COLOR_GREEN,string);
return 0;
}
if(ServerInfo[AntiSpam] == 1){
if(PlayerInfo[playerid][Admin] == 0){
if(PlayerInfo[playerid][SpamCount] == 0) PlayerInfo[playerid][SpamTime] = TimeStamp();
PlayerInfo[playerid][SpamCount]++;
if(TimeStamp() - PlayerInfo[playerid][SpamTime] > SPAM_TIMELIMIT){
PlayerInfo[playerid][SpamCount] = 0;
PlayerInfo[playerid][SpamTime] = TimeStamp();
}
else if(PlayerInfo[playerid][SpamCount] == MAX_SPAM_MSGS)
{
KickPlayer(playerid,"Spam Protection");
}
else if(PlayerInfo[playerid][SpamCount] == MAX_SPAM_MSGS-1)
{
SendClientMessage(playerid,Red,"Anti Spam Warning!");
return 0;
}
}
for(new i = 0; i < sizeof BadWords; i++){
placeholder = strfind(text, BadWords[i], true);
if(placeholder != -1){
for(new x = placeholder; x < placeholder + strlen(BadWords[i]); x ++){
text[x] = '*';
}}}
new pText[144];
format(pText, sizeof (pText), "(%d) %s", playerid, text);
SendPlayerMessageToAll(playerid, pText);
return 0;
}

Nechce mi to dat do AMX ale ked dam OnPlayerText preč tak mi to dá 1 error :d

možná bude chyba zo zatvorkama.....?

Link to comment
Share on other sites

2 odpovědí na tuto otázku

Recommended Posts

  • 0

 

public OnPlayerText(playerid, text[])
{
	new placeholder;
	if(PlayerInfo[playerid][Muted] == 1)
	{
		SendClientMessage(playerid, Red, "[Server] Nemôžeš písat...");
		return 0;
	}
	if(text[0] == '!' && PlayerInfo[playerid][Admin] >= 1)
	{
		new string[256];
		format(string,sizeof(string),"Admin Chat: %s: %s",pName(playerid),text[1]);
		MessageToAdmins(COLOR_GREEN,string);
		return 0;
	}
	if(ServerInfo[AntiSpam] == 1)
	{
		if(PlayerInfo[playerid][Admin] == 0)
		{
			if(PlayerInfo[playerid][SpamCount] == 0) PlayerInfo[playerid][SpamTime] = TimeStamp();
			PlayerInfo[playerid][SpamCount]++;
			if(TimeStamp() - PlayerInfo[playerid][SpamTime] > SPAM_TIMELIMIT)
			{
				PlayerInfo[playerid][SpamCount] = 0;
				PlayerInfo[playerid][SpamTime] = TimeStamp();
			}
			else if(PlayerInfo[playerid][SpamCount] == MAX_SPAM_MSGS)
			{
				KickPlayer(playerid,"Spam Protection");
			}
			else if(PlayerInfo[playerid][SpamCount] == MAX_SPAM_MSGS-1)
			{
				SendClientMessage(playerid,Red,"Anti Spam Warning!");
				return 0;
			}
		}
	}
	for(new i = 0; i < sizeof BadWords; i++)
	{
		placeholder = strfind(text, BadWords[i], true);
		if(placeholder != -1)
		{
			for(new x = placeholder; x < placeholder + strlen(BadWords[i]); x ++)
			{
				text[x] = '*';
			}
		}
	}
	new pText[144];
	format(pText, sizeof (pText), "(%d) %s", playerid, text);
	SendPlayerMessageToAll(playerid, pText);
	return 0;
}

 

 

Keby si dával normálne zátvorky tak by si na to prišiel že ti jedna chýba

  • Líbí se mi to! (+1) 1
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...