09.07.2015, 18:40
This is a lot longer code, but if this doesn't work then it is your ProxDetector or something else because this thing worked for me.
pawn Code:
CMD:b(playerid, params[])
{
new textstr[130];
format(textstr, sizeof(textstr), "(( %s [%i]: %s ))", ReplaceString("_", " ", PlayerName(playerid)), playerid, params);
ProxDetector(5.0, playerid, textstr, COLOR_WHITE, COLOR_GRAD1, COLOR_GRAD2, COLOR_GRAD3, COLOR_GRAD4);
}
stock PlayerName(playerid)
{
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, MAX_PLAYER_NAME);
return name;
}
stock ReplaceString(search[], replace[], source[])
{
new string[256], length;
for(new i = 0; i < strlen(source); i ++)
{
if(strlen(search) > 1 && i != (strlen(source) - 1))
{
new bool:match = false, start = i;
for(new j = 0; j < strlen(search) && !match; j ++)
{
if(source[i] != search[j] && j == 0)
{
string[length] = source[i];
match = true;
}
else
{
if(source[i] == search[j]) i ++;
else match = true;
}
}
if(match == true)
{
while(start <= i)
{
string[length] = source[start];
length ++;
start ++;
}
}
else
{
for(new j; j < strlen(replace); j ++)
{
string[length] = replace[j];
length ++;
}
i = (start + (strlen(search) - 1));
}
}
else
{
if(strlen(search) == 1 && source[i] == search[0])
{
for(new j; j < strlen(replace); j ++)
{
string[length] = replace[j];
length ++;
}
}
else
{
string[length] = source[i];
length ++;
}
}
}
string[length] = EOS;
return string;
}