SA-MP Forums Archive
Can someone help me with this? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Can someone help me with this? (/showthread.php?tid=77482)



Can someone help me with this? - Fj0rtizFredde - 11.05.2009

Hello.. I have a problem with one function in my GM so can you please help me?
Function:
pawn Код:
stock GetPlayerID(const 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)
        {
          return i;
            }
        }
    }
    return -1;
}
And my error:
Код:
error 035: argument type mismatch (argument 1)
On the line:
pawn Код:
if(strcmp(Name, pName, true)==0)
And sorry about the indentation :P


Re: Can someone help me with this? - Weirdosport - 11.05.2009

Try changing: (const Name[])

To: (Name[])


Re: Can someone help me with this? - Fj0rtizFredde - 11.05.2009

Quote:
Originally Posted by Weirdosport
Try changing: (const Name[])

To: (Name[])
It didnt work


Re: Can someone help me with this? - Weirdosport - 11.05.2009

Compiles fine for me, show me the line you use to "initiate" it.. like:

pawn Код:
//stuff
playerid = GetPlayerID("bob");
That bit..


Re: Can someone help me with this? - Fj0rtizFredde - 11.05.2009

Quote:
Originally Posted by Weirdosport
Compiles fine for me, show me the line you use to "initiate" it.. like:

pawn Код:
//stuff
playerid = GetPlayerID("bob");
That bit..
NVM I found the problem :P