21.06.2012, 17:24
strreplace won't replace it...anyone see anything wrong?
this will make it so when people try to put in their house name "admin" it will replace it with "dick"
pawn Код:
if(dialogid == HOUSEMENU+14)
{
if(response)
{
if(strfind(inputtext, "%", CASE_SENSETIVE) != -1 || strfind(inputtext, "~", CASE_SENSETIVE) != -1) return ShowInfoBoxEx(playerid, COLOUR_SYSTEM, E_INVALID_HNAME_CHARS);
if(strlen(inputtext) < MIN_HOUSE_NAME || strlen(inputtext) > MAX_HOUSE_NAME) return ShowInfoBoxEx(playerid, COLOUR_SYSTEM, E_INVALID_HNAME_LENGTH);
else
{
strreplace("admin","dick",inputtext);
format(hInfo[h][HouseName], MAX_HOUSE_NAME, "%s", inputtext);
file = INI_Open(filename);
INI_WriteString(file, "HouseName", inputtext);
INI_Close(file);
ShowInfoBox(playerid, I_HNAME_CHANGED, inputtext);
UpdateHouseText(h);
}
}
return 1;
}