SA-MP Forums Archive
Possibly unintended argument - 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: Possibly unintended argument (/showthread.php?tid=79599)



Possibly unintended argument - Acoole - 29.05.2009

warning 211: possibly unintended assignment

Line: if (plname = "Sole")

Easy way to fix this?

Thanks,
~Andrew


Re: Possibly unintended argument - member - 29.05.2009

pawn Код:
if (plname == "Sole")



Re: Possibly unintended argument - yom - 29.05.2009

Use strcmp.


Re: Possibly unintended argument - Acoole - 29.05.2009

It's in OnPlayerConnect and making it == gives the error error 033: array must be indexed (variable "plname")


Re: Possibly unintended argument - yom - 29.05.2009

As i said, use strcmp, because it's the function for string comparison


Re: Possibly unintended argument - member - 29.05.2009

Quote:
Originally Posted by [LARP
Aimless ]
It's in OnPlayerConnect and making it == gives the error error 033: array must be indexed (variable "plname")
apologies , you need strcmp as 0rb rightly suggested.


Re: Possibly unintended argument - russiany - 29.05.2009

pawn Код:
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,sizeof(name));
if(!strcmp(name,"Sole",true))
{
  // your function
}