error 080: unknown symbol, or not a constant symbol (symbol "i")
stock strreplace(string[], find, replace)
{
for(new i=0; i < sizeof(string[i]); i++)
{
if(string[i] == find)
{
string[i] = replace;
}
}
stock strreplace(string[], find, replace)
{
for(new i=0; i < sizeof(string); i++)
{
if(string[i] == find)
{
string[i] = replace;
}
}
}
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.
}
Thanks no errors on the stock now but.
PHP код:
unknown symbol, or not a constant symbol (symbol "i") |
stock strreplace(string[], find[], replace)
{
for(new i=0; i < sizeof(sizeof(string)); i++)
{
if(string[i] == find)
{
string[i] = replace;
}
}
}
stock strreplace(string[], find, replace) { for(new i=0; i < sizeof(string); i++) { if(string[i] == find) { string[i] = replace; } }
stock strreplace(string[], find, replace)
{
for(new i=0; i < strlen(string); i++)
{
if(string[i] == find) string[i] = replace;
}
}