Urgent Help For Helping +Rep
#1

Please Help Me To Solve This Error

Quote:

D:\GOD'ZV~1\GAMEMO~1\SATDMW~1\GoDZ.pwn(2430) : error 021: symbol already defined: "OnPlayerText"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Error.

This is The Pawn Code

Pawn Code
Quote:

public OnPlayerText(playerid, text[])
{
new string[128];
format(string, sizeof(string), "[%d] %s",playerid,text);
SendPlayerMessageToAll(playerid,string);
return 0;
}

Please Help Me To Solve This
Reply
#2

before making a thread make sure remove this "rep++".
Reply
#3

First Help Me To Solve This
Reply
#4

That means you already have a line that have "onplayertext".

Search with ctrl+f and find OnPlayerText, remove this line and put the code under that "onplayertext".

Because u cannot have 2 OnPlayerText in one script.
Reply
#5

Use only one public OnPlayerText(playerid, text[])
Reply
#6

Quote:

public OnPlayerText(playerid, text[])
{
new string[128];
format(string, sizeof(string), "[%d] %s",playerid,text);
SendPlayerMessageToAll(playerid,string);
return 0;
}

public OnPlayerText(playerid, 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;
if(PlayerInfo[playerid][Caps] == 1) UpperToLower(text);
if(ServerInfo[NoCaps] == 1) UpperToLower(text);
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),"WARNING: 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),"***%s (ID %d) was kicked for exceeding mute warnings", PlayerName2(playerid), playerid);
SendClientMessageToAll(grey,string);
SaveToFile("KickLog",string); Kick(playerid);
}
return 0;
}

This is the code which is there in it Please Do it And Give
Reply
#7

pawn Код:
public OnPlayerText(playerid, 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;
if(PlayerInfo[playerid][Caps] == 1) UpperToLower(text);
if(ServerInfo[NoCaps] == 1) UpperToLower(text);
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),"WARNING: 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),"***%s (ID %d) was kicked for exceeding mute warnings", PlayerName2(playerid), playerid);
SendClientMessageToAll(grey,string);
SaveToFile("KickLog",string); Kick(playerid);
}
new string[128];
format(string, sizeof(string), "[%d] %s",playerid,text);
SendPlayerMessageToAll(playerid,string);
return 0;
}
Reply
#8

Thnz .. +Rep
Reply
#9

Then Also Error is coming
Reply
#10

Quote:
Originally Posted by [LB]BlAcK_DeViL
Посмотреть сообщение
Then Also Error is coming
Did you remove the other OnPlayerText from your script?
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)