SA-MP Forums Archive
URGENT HELP BAN CMD - 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: URGENT HELP BAN CMD (/showthread.php?tid=69105)



URGENT HELP BAN CMD - StrickenKid - 15.03.2009

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!


Re: URGENT HELP BAN CMD - MenaceX^ - 15.03.2009

Use ReturnUser function, to define the other player.


Re: URGENT HELP BAN CMD - StrickenKid - 15.03.2009

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


Re: URGENT HELP BAN CMD - [RP]Rav - 15.03.2009

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)



Re: URGENT HELP BAN CMD - ICECOLDKILLAK8 - 15.03.2009

Use strtok and ReturnUser


Re: URGENT HELP BAN CMD - Mikep - 16.03.2009

Use dcmd.


Re: URGENT HELP BAN CMD - Pyrokid - 16.03.2009

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