3 time one 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: 3 time one cmd (
/showthread.php?tid=88791)
3 time one cmd -
user226 - 28.07.2009
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.
Re: 3 time one cmd -
Jefff - 28.07.2009
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;
}
Re: 3 time one cmd -
user226 - 28.07.2009
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!
Re: 3 time one cmd -
arnutisz - 28.07.2009
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;
}
|