SA-MP Forums Archive
GetPlayerName - 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: GetPlayerName (/showthread.php?tid=139485)



GetPlayerName - juuleman - 05.04.2010

Hi GuyZ,

I made this (dont know if this is right):

pawn Код:
new name[MAX_PLAYER_NAME];
    if GetPlayerName(playerid, name, sizeof(name)) *then
    if (name == "//The name, wont show it here")
    {
      SendClientMessage(playerid,COLOR_RED,"//Text that will be shown i didnt wanted to show it here");
      return 1;
    }
But then i get this error:

Код:
(2424) : error 033: array must be indexed (variable "name")
Can someone help me?


Re: GetPlayerName - ¤Adas¤ - 05.04.2010

use: !strcmp(name, "something", true)


Re: GetPlayerName - ¤Adas¤ - 05.04.2010

As I said, he has to use STRCMP.

pawn Код:
if(!strcmp(name, "name here", true))
{
//code
}



Re: GetPlayerName - juuleman - 05.04.2010

Thanks for the help guys!


Re: GetPlayerName - ¤Adas¤ - 05.04.2010

No problem for me