SA-MP Forums Archive
Name with dots - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Name with dots (/showthread.php?tid=392459)



Name with dots - Whizion - 14.11.2012

I want this function to return something like this:

MyName ..........

But it doesn't work, it just returns my normal name without the dots.

What's wrong:

pawn Код:
stock GetNameWithDots(playerid)
{
    new name[MAX_PLAYER_NAME];

    if(IsPlayerConnectedAndLoggedIn(playerid))
    {
        GetPlayerName(playerid, name, sizeof(name));
       
        new start = strlen(name) + 1;
       
        for(new i = start; i < MAX_PLAYER_NAME; i++)
        {
            name[i] = '.';
        }
    }
   
    return name;
}
Please help, thank you...


Re: Name with dots - SuperViper - 14.11.2012

pawn Код:
GetNameWithDots(playerid)
{
    new playersName[MAX_PLAYER_NAME + 6];
    GetPlayerName(playerid, playersName, MAX_PLAYER_NAME);
    strcat(playersName, ".....");
    return playersName;
}



Re: Name with dots - Whizion - 14.11.2012

Thank you!