argument type mismatch (argument 1)
#10

Quote:
Originally Posted by oMa37
Посмотреть сообщение
You doubt in the 'SA-MP Lead Scripter' code? How dare you?!


OT: Just use the specifier in the sscanf check, You can use both ID and player name in the sscanf's specifier 'u'. That if you are trying for example kick a player by his name.




Why all that? Just use this;

PHP код:
GetID(name[])
{
    for(new 
iGetPlayerPoolSize(); <= ji++) // or foreach(new i : Player)
    
{
        if(!
strcmp(GetName(i), nametrue)) return i;
    }
    return 
INVALID_PLAYER_ID;
}
GetName(playerid)
{
    new 
pName[MAX_PLAYER_NAME];
    
GetPlayerName(playeridpNameMAX_PLAYER_NAME);
    return 
pName;

Quote:
Originally Posted by AroseKhanNiazi
Посмотреть сообщение
Yep using 'u' makes lot more sense or 'r' if you don't wanna include NPC's in it.
thanks bro's!, fix.

PHP код:
stock GetPlayerID(playername[])
{
  for(new 
i=GetPlayerPoolSize(); != -1i--)
  {
      if(
strcmp(GetPlayerName(i), playernametruestrlen(playername)) == 0) return i;
  }
  return 
INVALID_PLAYER_ID;

Reply


Messages In This Thread
argument type mismatch (argument 1) - by Cerealguy - 08.12.2016, 18:12
Re: argument type mismatch (argument 1) - by AroseKhanNiazi - 08.12.2016, 18:23
Re: argument type mismatch (argument 1) - by iLearner - 08.12.2016, 18:31
Respuesta: argument type mismatch (argument 1) - by Cerealguy - 08.12.2016, 19:15
Re: argument type mismatch (argument 1) - by iamjems - 08.12.2016, 19:20
Re: Respuesta: argument type mismatch (argument 1) - by Yaa - 08.12.2016, 19:21
Re: Respuesta: argument type mismatch (argument 1) - by AroseKhanNiazi - 08.12.2016, 19:30
Re: Respuesta: argument type mismatch (argument 1) - by oMa37 - 08.12.2016, 19:32
Re: argument type mismatch (argument 1) - by AroseKhanNiazi - 08.12.2016, 19:42
Respuesta: Re: argument type mismatch (argument 1) - by Cerealguy - 08.12.2016, 22:32

Forum Jump:


Users browsing this thread: 1 Guest(s)