Quote:
Originally Posted by Seif_ [adream-rp.com
]
Quote:
Originally Posted by [SU
BP13 ]
Quote:
Originally Posted by Don Correlli
Use strcmp.
|
umm like
public OnPlayerConnect(playerid)
{
if(playername, playerid = KimSinSeN
ban(playerid);
}
something like that. but thats probly not right but im not sure how to make it right.
|
strcmp is a function to compare 2 strings. It returns 0 if they're the same and 1 if not. So basically you'd do this:
pawn Код:
public OnPlayerConnect(playerid) { new pname[MAX_PLAYER_NAME]; GetPlayerName(playerid, pname, sizeof pname); if (!strcmp(pname, "KimSinSeN", true)) return Ban(playerid); return 1; }
|
It doesn't return 1, it returns the amount of characters that are not equal in the other string, so comparing "" and "hi" and it returning 0 is not a bug, since there are 0 characters to compare.