ReturnUser.
#7

Does that mean every player who joins gets a new ID pressed against a constant prefix as their name?

Like -

Player_1
Player_2
Player_3

Is that it?

If you want to do that -

pawn Код:
#define CONST_PREFIX    "Inconnu_"

ReturnUserBySuffix( suffix )
{
    new name[MAX_PLAYER_NAME] = CONST_PREFIX,
           suff[7];

    valstr(suff, suffix);
    strcat(name, suff);

    new pName[MAX_PLAYER_NAME];
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
          GetPlayerName(i, pName, MAX_PLAYER_NAME);
          if(!strcmp(pName, name)) return i;
     }

     return INVALID_PLAYER_ID;
}
EDIT: I am really sorry, I realise there are better ways of doing this, but I am really tired and I'll edit this and post some better code when I can
Reply


Messages In This Thread
ReturnUser. - by TheSy - 23.05.2014, 21:14
Re: ReturnUser. - by Jefff - 24.05.2014, 00:12
Re: ReturnUser. - by DerickClark - 24.05.2014, 00:35
Re: ReturnUser. - by TheSy - 24.05.2014, 11:49
Re: ReturnUser. - by SKAzini - 24.05.2014, 13:14
Re: ReturnUser. - by TheSy - 24.05.2014, 13:34
Re: ReturnUser. - by RajatPawar - 24.05.2014, 13:36
Re: ReturnUser. - by TheSy - 24.05.2014, 13:39
Re: ReturnUser. - by SKAzini - 24.05.2014, 13:44
Re: ReturnUser. - by TheSy - 24.05.2014, 14:03

Forum Jump:


Users browsing this thread: 2 Guest(s)