IsPlayerConnected <- Not working
#5

pawn Код:
if(GetPlayerID(inputtext) == -1) return SendClientMessage(playerid, -1, "Error, invalid name connected!");
new pID = GetPlayerID(inputtext);
pawn Код:
stock GetPlayerID(Name[])
{
    for(new i; i<MAX_PLAYERS; i++)
    {
      if(IsPlayerConnected(i))
      {
        new pName[MAX_PLAYER_NAME];
        GetPlayerName(i, pName, sizeof(pName));
        if(strcmp(Name, pName, true) == 0)
    {
    break;
    return i;
    }
      }
    }
    return -1;
}
I think it should work.

Sorry for the bad indentation, I'm on the phone.
Reply


Messages In This Thread
IsPlayerConnected <- Not working - by Riddy - 14.12.2012, 21:32
Re: IsPlayerConnected <- Not working - by mastermax7777 - 14.12.2012, 21:42
Re: IsPlayerConnected <- Not working - by DrTHE - 14.12.2012, 21:42
Re: IsPlayerConnected <- Not working - by Riddy - 14.12.2012, 21:48
Re: IsPlayerConnected <- Not working - by DrTHE - 15.12.2012, 11:09
Re: IsPlayerConnected <- Not working - by Konstantinos - 15.12.2012, 11:19
Re : Re: IsPlayerConnected <- Not working - by scott1 - 15.12.2012, 11:41
Re: Re : Re: IsPlayerConnected <- Not working - by Konstantinos - 15.12.2012, 11:46
Re: IsPlayerConnected <- Not working - by Riddy - 15.12.2012, 12:18

Forum Jump:


Users browsing this thread: 1 Guest(s)