need help with ban command which ban's the account of the player not the ip.
#1

with sscanf+zcmd plz.
Reply
#2

We have a topic for requesting scripts/snippets.

https://sampforum.blast.hk/showthread.php?tid=187229
Reply
#3

Well, banning an account is simple. You have to create a new variable, called (for example) 'PlayerBanned' and then, when you ban someone, set that variable to either 1 or true (if you use a bool). Now, when a player connects, check if the variable is 1 or true, meaning he's banned. If yes, kick that player.

Of course, in the ban command, don't use the function Ban. Just set the variable to true and kick player.

I might be able to create you the command but I have no idea how you save variables, so you'll have to save the banned variable yourself in the player file.
Reply
#4

can someone help me plz.i can't do the thing which u told sorry.
Reply
#5

Код:
COMMAND:ban(playerid,params[])
{
	new id, grund[144];
	if(sscanf(params,"ds",id,grund)) return NoSuccess(playerid,"Usage: /ban id reason");

	format(str,144,"» Admin %s banned %s, reason: %s",pname[playerid],pname[id],grund);
	SendClientMessageToAll(RED,str);
	Ban(id);
	return 1;
}
Reply
#6

C:\Users\intel\Desktop\New Folder\Roleplay Base Script\gamemodes\lfgr.pwn(954) : error 017: undefined symbol "NoSuccess"
C:\Users\intel\Desktop\New Folder\Roleplay Base Script\gamemodes\lfgr.pwn(956) : error 017: undefined symbol "str"
C:\Users\intel\Desktop\New Folder\Roleplay Base Script\gamemodes\lfgr.pwn(956) : warning 215: expression has no effect
C:\Users\intel\Desktop\New Folder\Roleplay Base Script\gamemodes\lfgr.pwn(956) : error 001: expected token: ";", but found "]"
C:\Users\intel\Desktop\New Folder\Roleplay Base Script\gamemodes\lfgr.pwn(956) : error 029: invalid expression, assumed zero
C:\Users\intel\Desktop\New Folder\Roleplay Base Script\gamemodes\lfgr.pwn(956) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


5 Errors.

plz help me guys.
Reply
#7

Код:
new str[256];
Код:
COMMAND:ban(playerid,params[])
{
new id, grund[144];
if(sscanf(params,"ds",id,grund)) return SendClientMessage(playerid,"Usage: /ban id reason");

format(str,144,"» Admin %s banned %s, reason: %s",pname[playerid],pname[id],grund);
SendClientMessageToAll(RED,str);
Ban(id);
return 1;
}
Try now.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)