Question about a /fakeban command
#1

I'm making a /fakeban command, where you type /fakeban and then it'll make it look like they got banned to other players.

Код:
	if(strcmp("/fakeban", cmdtext, true) == 0 )
	{
        new
                strs[100],
                xname[24],
                pname[24],
		reason[100];

        format(strs,sizeof(strs),"{AA3333}AdmCmd{FFFF00}: %s was banned by %s, reason %s",pname, xname, reason);
        SendClientMessageToAll(playerid, strs);
        return 1;
	}
I don't get how I could make a way to input the reason. Can anyone offer me some help? I may have wrote this entirely wrong from the get-go, but I don't know. Thanks in advance.
Reply
#2

Just copy your ban command and remove
pawn Код:
Ban(playerid);
or
pawn Код:
Kick(playerid);
Reply
#3

Quote:
Originally Posted by (*|Flake|*)
Посмотреть сообщение
Just copy your ban command and remove
pawn Код:
Ban(playerid);
or
pawn Код:
Kick(playerid);
Oh yeah I suppose that would work. Thanks haha!
Reply
#4

Get sscanf or use strtok.
Quote:

new idx;
new cmd[32];
cmd = strtok(cmd);

//Here comes ur strcmp but with cmd as the text variable

//in your fakeban command adding this will give you the reason
reason = strtok(text);

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)