[HELP] Admin shita
#1

How can i make admins avaible to use NoN-RP names like " Nature, Molp, lewis " etc. not Nature_Wood or Molp_Koop etc..
Reply
#2

There are different ways to handle this but I prefer to use the split function: >.>
pawn Код:
stock split(const strsrc[], strdest[][], delimiter)
{
  new i, li;
  new aNum;
  new len;
  while(i <= strlen(strsrc))
  {
    if(strsrc[i] == delimiter || i == strlen(strsrc))
    {
      len = strmid(strdest[aNum], strsrc, li, i, 128);
      strdest[aNum][len] = 0;
      li = i+1;
      aNum++;
    }
    i++;
  }
  return 1;
}
So this will be: >>
pawn Код:
new
    var[2][MAX_PLAYER_NAME],
    pName[MAX_PLAYER_NAME] = "Nature_Wood" // You have to use GetPlayerName instead this btw.
;
split(pName, var, '_');
printf("Output: %s", var[0]);
Код:
Output: Nature
Reply
#3

Thanks!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)