3 time one cmd
#1

how to make: if player write 3 times in a command / xyi, he wrote:
when introduced 1 time: / xyi else can enter 2 times
When introduced 2 times: / xyi else can enter 1 time
When introduced 3 times: can not write / xyi!

undertand?

Help me please.
kruts,Thanks.
Reply
#2

Top
Код:
new BlockCmd[MAX_PLAYERS];
connect/disconnect
Код:
BlockCmd[playerid] = 0;
Код:
if(strcmp("/mycommand", cmdtext, true) == 0)
{
	if(BlockCmd[playerid] < 3)
	{
		BlockCmd[playerid]++;
		// Do something here
	}else SendClientMessage(playerid, COLOR, "SERVER: Command blocked :D");
	return 1;
}
Reply
#3

Quote:
Originally Posted by Jefff
Top
Код:
new BlockCmd[MAX_PLAYERS];
connect/disconnect
Код:
BlockCmd[playerid] = 0;
Код:
if(strcmp("/mycommand", cmdtext, true) == 0)
{
	if(BlockCmd[playerid] < 3)
	{
		BlockCmd[playerid]++;
		// Do something here
	}else SendClientMessage(playerid, COLOR, "SERVER: Command blocked :D");
	return 1;
}
Excellent!
But still, how to write
how to make?
when introduced 1 time: / xyi else can enter 2 times
When introduced 2 times: / xyi else can enter 1 time
When introduced 3 times: can not write / xyi!
Reply
#4

Quote:
Originally Posted by Jefff
Top
Код:
new BlockCmd[MAX_PLAYERS];
connect/disconnect
Код:
BlockCmd[playerid] = 0;
Код:
if(strcmp("/mycommand", cmdtext, true) == 0)
{
	if(BlockCmd[playerid] < 3)
	{
		BlockCmd[playerid]++;
		// Do something here
        new string[30];
        format(string, 40, "/ xyi else can enter %d times " 3-BlockCmd[playerid]);
        SendClientMessage(playerid, COLOR, string);
	}else SendClientMessage(playerid, COLOR, "SERVER: Command blocked :D");
	return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)