stock - GetNames
#9

Quote:
Originally Posted by _V1rTu4L_
created by me
pawn Код:
stock GetNames(...) {
  new names[29], pnames[MAX_PLAYER_NAME], num;
  for(new i; i<numargs(); ++i) if(IsPlayerConnected(getarg(i))) {
    GetPlayerName(getarg(i), pnames, MAX_PLAYER_NAME);
    num++;
    format(names, sizeof(names), "%s%d. %s\n", names, num, pnames);
  }
  return names;
}
Israel SA-MP Team
Quote:
Originally Posted by _V1rTu4L_
Infact, you wrong.

IsPlayerConnected, yes in the loop. look good:
for(new i; i<numargs(); ++i) if(IsPlayerConnected(i))

the function just sending names on using, example:
pawn Код:
format(bla, sizeof(bla), "%d%d",GetNames(1, 20));
SendClientMessage(id, color, bla);
so playerid does not need to be here.

and ++i or i++ is the same thing!

and.. he will return all the names! i used \n, look good damn
the function without wrong!

sorry if i have spelling mistakes.
... Just test before posting.
Reply


Messages In This Thread
stock - GetNames - by _V1rTu4L_ - 17.11.2009, 12:56
Re: stock - GetNames - by DokerJr - 18.11.2009, 15:04
Re: stock - GetNames - by DSK_Vyorel - 18.11.2009, 15:22
Re: stock - GetNames - by DokerJr - 18.11.2009, 15:51
Re: stock - GetNames - by _V1rTu4L_ - 18.11.2009, 17:17
Re: stock - GetNames - by MJ! - 18.11.2009, 17:34
Re: stock - GetNames - by _V1rTu4L_ - 19.11.2009, 04:50
Re: stock - GetNames - by MJ! - 19.11.2009, 18:51
Re: stock - GetNames - by yom - 19.11.2009, 19:06
Re: stock - GetNames - by _V1rTu4L_ - 20.11.2009, 09:08

Forum Jump:


Users browsing this thread: 1 Guest(s)