"-string end-", but found "-identifier-" HELP
#1

public OnPlayerText(playerid, text[])
{
if(isenable && text[0] && answer == strval(text))
{
new CName[24], string[128];
GetPlayerName(playerid, CName, 24);
isenable = false;
format(string,sizeof(string),"%s answered the right answer of math quiz which was "COL_GREEN"%d
"COL_WHITE"and wons 3 Scores, 1000$ Cash",CName,answer);ERROR! LINE !!!!!!!!!!!!!!!!!
SendClientMessageToAll(-1, string);
SetPlayerScore(playerid, GetPlayerScore(playerid)+3);
GivePlayerMoney(playerid, 1000);
KillTimer(MathquizTimer);
return 0;
}
//================================================== ============================
// Vip Chat
//================================================== ============================
if(text[0] == '*' && PlayerInfo[playerid][pVip] >= 1)
{
new string[128]; GetPlayerName(playerid,string,sizeof(string));
format(string,sizeof(string),"|ChatVip| %s: %s",string,text[1]);
MessageToPlayerVIP(0xDC686BAA,string);
#if CHAT_VIP_LOG == true
SaveToFile("ChatVipLog",string);
#endif
return 0;
}
//================================================== ============================
new string2[128];
format(string2, sizeof(string2), ":[%d]%s",playerid,text);
SendPlayerMessageToAll(playerid,string2);
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;
}

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),"%s has been kicked (Flood/Spam Protection)", PlayerName2(playerid));
SendClientMessageToAll(grey,string); print(string);
SaveToFile("KickLog",string);
Kick(playerid);
}
else if(PlayerInfo[playerid][SpamCount] == SPAM_MAX_MSGS-1) {
SendClientMessage(playerid,red,"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 (Calling[playerid] > -1 && Answered[playerid] == 1)
{
new string[128];
new sendername[MAX_PLAYER_NAME];
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "{FF0000}%s: %s", sendername, text);
SendClientMessage(Calling[playerid], COLOR_YELLOW, string);
format(string, sizeof(string), "{FF0000}%s: %s", sendername, text);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "{FF0000}%s: %s", sendername, text);
print(string);
format(string, sizeof(string), "{FF0000}%s: %s", sendername, text);
print(string);
return 0;
}
else
{
new to_others[MAX_CHATBUBBLE_LENGTH+1];
format(to_others,MAX_CHATBUBBLE_LENGTH,"Says: %s",text);
SetPlayerChatBubble(playerid,to_others,MESSAGE_COL OR,35.0,10000);
}
return 0;
}







(2586) : error 001: expected token: "-string end-", but found "-identifier-"
(2586) : warning 215: expression has no effect
(2586) : error 001: expected token: ";", but found "-string-"
(2586) : warning 215: expression has no effect
(2586) : warning 215: expression has no effect
(2586) : warning 215: expression has no effect
(2586) : error 001: expected token: ";", but found ")"
(2586) : fatal error 107: too many error messages on one line
Reply
#2

Why do you send the whole code? why not just the error line?
Reply
#3

Quote:
Originally Posted by Kasichok
Посмотреть сообщение
Why do you send the whole code? why not just the error line?

what marks the error as ERROR LINE
Reply
#4

Line 2586.
Reply
#5

Remove the " #endif ".
Reply
#6

1. You probably defined the colors wrong
PHP код:
#define COL_WHITE "{FFFFFF}"
#define COL_GREEN "{00FF00}" 
2. Here is the fix
PHP код:
format(string,sizeof(string),"%s answered the right answer of math quiz which was "COL_GREEN"%d"COL_WHITE"and wons 3 Scores, 1000$"Cash,CName,answer); 
Reply
#7

Quote:
Originally Posted by Kasichok
Посмотреть сообщение
1. You probably defined the colors wrong
PHP код:
#define COL_WHITE "{FFFFFF}"
#define COL_GREEN "{00FF00}" 
2. Here is the fix
PHP код:
format(string,sizeof(string),"%s answered the right answer of math quiz which was "COL_GREEN"%d"COL_WHITE"and wons 3 Scores, 1000$"Cash,CName,answer); 
yes new defineds fix problem thanks boys
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)