URGENT HELP BAN CMD
#1

i really need this fixed Fast, theres people on my server getting banned right and left
heres the code:
Код:
	if(strcmp("/ban", cmdtext, true, 4) == 0)
	{
		if(Level[playerid] == 0) return 0;
		if(IsLoggedIn[playerid] == 0) return 0;
		if(strlen(cmdtext[5]) == 0) return SendClientMessage(playerid, red, "You did not enter an ID");

		new cmdname[MAX_PLAYER_NAME];
		GetPlayerName(playerid, cmdname, sizeof(cmdname));
		GetPlayerName(strval(cmdtext[5]), cmdname, sizeof(cmdname));

		format(string, sizeof(string), "*** BAN: %s (%d) [ADMIN BAN] Banned From The Server By An Admin.", cmdname,strval(cmdtext[5]));
		SendClientMessageToAll(COLOR_PINK, string);

		Ban(strval(cmdtext[5]));
		return 1;
	}
if they type /bank (id) it just bans them

i need that fixed please and thx!
Reply
#2

Use ReturnUser function, to define the other player.
Reply
#3

how do i use return user? give me an example command PLEASE
Reply
#4

I think changing
pawn Код:
if(strcmp("/ban", cmdtext, true, 4) == 0)
to
pawn Код:
if(strcmp("/ban", cmdtext, true) == 0)
will fix it, or else try
pawn Код:
if(strcmp("/ban", cmdtext, true, strfind(cmdtext," ")) == 0)
Reply
#5

Use strtok and ReturnUser
Reply
#6

Use dcmd.
Reply
#7

Quote:
Originally Posted by Mikep
Use dcmd.
DCMD and sscanf. Together, they are powerful.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)