#1

I got this code:
pawn Код:
stock GetName(playerid, const name[], len)
{
    GetPlayerName(playerid, name, len);
    name[strfind(name, "_")] = ' '; // LINE 26245
    return name;
}
I get this error:
Код:
C:\Users\Yuval\Desktop\SantosCityRolePlay\gamemodes\gf.pwn(26245) : error 022: must be lvalue (non-constant)
C:\Users\Yuval\Desktop\SantosCityRolePlay\gamemodes\gf.pwn(26245) : warning 215: expression has no effect
I am trying to make a command that will replce the GetPlayerName with GetName without changing ALL my GetPlayerNames and deleting the variables. (I am editing GF). Help.
Reply
#2

pawn Код:
stock GetName(playerid)
{
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
    for(new x = 0; x < sizeof(name); x++)
    {
        if(name[x] == '_') { name[x] = ' '; }
    }
    return name;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)