ban playerid
#7

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.
Reply


Messages In This Thread
ban playerid - by BP13 - 04.09.2009, 22:53
Re: ban playerid - by Correlli - 04.09.2009, 22:55
Re: ban playerid - by BP13 - 04.09.2009, 23:02
Re: ban playerid - by Zezombia - 04.09.2009, 23:18
Re: ban playerid - by BP13 - 04.09.2009, 23:37
Re: ban playerid - by DMSOrg - 04.09.2009, 23:43
Re: ban playerid - by JaTochNietDan - 04.09.2009, 23:49
Re: ban playerid - by BP13 - 04.09.2009, 23:59

Forum Jump:


Users browsing this thread: 1 Guest(s)