Posts: 188
Threads: 61
Joined: Nov 2012
PHP код:
error 080: unknown symbol, or not a constant symbol (symbol "i")
PHP код:
stock strreplace(string[], find, replace)
{
for(new i=0; i < sizeof(string[i]); i++)
{
if(string[i] == find)
{
string[i] = replace;
}
}
what is the problem?
Posts: 2,187
Threads: 81
Joined: Aug 2011
Reputation:
0
I don't know about others, but you are missing a bracket ' } ' on the last line.
Posts: 188
Threads: 61
Joined: Nov 2012
Thanks no errors on the stock now but.
PHP код:
public OnPlayerText(playerid, text[])
{
new pname[MAX_PLAYER_NAME], str[128];//reduce it if you want
GetPlayerName(playerid, pname, sizeof(pname));
strreplace(pname, '_', ' ');
format(str, sizeof(str), "%s says: %s", pname, text);//Appearance of the text submitted by a nearby player.
/*
* The first parameter states the radius of the area where the text will be submitted and if a player is inside the radius, the person will receive it.
* The second parameter is the player that is submitting the text.
* The third parameter will specify what exactly the text is, in this case %speaker says: %text.
* The rest of the parameters are the fading colors, where how far the receiver is far from the talker.
*/
ProxDetector(30.0, playerid, str, COLOR_FADE1, COLOR_FADE2, COLOR_FADE3, COLOR_FADE4, COLOR_FADE5);
return 0;//So that the text is not submitted regularly.
}
What is wrong here? Please help now i getting the error here.
unknown symbol, or not a constant symbol (symbol "i")
Posts: 188
Threads: 61
Joined: Nov 2012
getting more errors now, please post a code i can use, + rep :/