Getplayerid
#1

I have This stock:
Код:
//==============================================================================
stock GetPlayerIdFromName(playername[])
{
  for(new i = 0; i <= MAX_PLAYERS; i++)
  {
    if(IsPlayerConnected(i))
    {
      new playername2[MAX_PLAYER_NAME];
      GetPlayerName(i, playername2, sizeof(playername2));
      if(strcmp(playername2, playername, true, strlen(playername)) == 0)
      {
        return i;
      }
    }
  }
  return INVALID_PLAYER_ID;
}
and i have this cmd:
Код:
CMD:myid(playerid, params[])
{
	new str3[80], GPID, name[MAX_PLAYER_NAME];
	GPID=GetPlayerIdFromName(name);
	format(str3, sizeof(str3), "Your Id Is:%i", GPID);
	SCM(playerid, -1, str3);

}
There is no errors but when I type /myid from 2 accounts
both accounts give me id 0.. help please.
Reply


Messages In This Thread
Getplayerid - by Osamakurdi - 04.01.2018, 13:36
Re: Getplayerid - by pollo97 - 04.01.2018, 13:43
Re: Getplayerid - by RogueDrifter - 04.01.2018, 13:47
Re: Getplayerid - by Osamakurdi - 04.01.2018, 13:50
Re: Getplayerid - by SyS - 04.01.2018, 15:04
Re: Getplayerid - by Infra - 04.01.2018, 15:16

Forum Jump:


Users browsing this thread: 1 Guest(s)