strcmp playername? - 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: strcmp playername? (
/showthread.php?tid=176046)
strcmp playername? -
thomas.. - 11.09.2010
hey..
ive seen some functions with playernames..
wheres that function? i cant find it?
something like
if(!strlem,"playernamehere" something something
Re: strcmp playername? -
randomkid88 - 11.09.2010
You need to create a player name variable and then you can use it to compare. For example:
pawn Код:
new pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, sizeof(pName));
//Then you can do this:
if(!strcmp(pName, "John_Doe", false))
{
return 1;
}
// or whatever you want.
Hope this helps.
Re: strcmp playername? -
thomas.. - 12.09.2010
Quote:
Originally Posted by randomkid88
You need to create a player name variable and then you can use it to compare. For example:
pawn Код:
new pName[MAX_PLAYER_NAME]; GetPlayerName(playerid, pName, sizeof(pName));
//Then you can do this:
if(!strcmp(pName, "John_Doe", false)) { return 1; } // or whatever you want.
Hope this helps.
|
thanks!!!