Error 047
#1

pawn Код:
stock GetNameEx(playerid)
{
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
    name = strreplace("_", " ", name); // ERROR LINE!
    return name;
}
I get this error.
Код:
error 047: array sizes do not match, or destination array is too small
What i missed?
Reply
#2

pawn Код:
stock GetNameEx(playerid)
{
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
    strreplace("_", " ", name);
    return name;
}
Reply
#3

It's maybe something with the strreplace, you might used it wrong.
And try this:

pawn Код:
stock GetNameEx(playerid)
{
    new pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
    for(new i = 0, l = strlen(pName); i < l; i++)
        if(pName[i] == '_')
            pName[i] = ' ';
    return pName;
}
EDIT: Too late...
Reply
#4

Thanks for helping
Reply
#5

< Removed >
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)