Jump to content
  • 0

how to prevent spamming @command


mirabell

Question


  • Group:  Members
  • Topic Count:  41
  • Topics Per Day:  0.01
  • Content Count:  197
  • Reputation:   19
  • Joined:  11/20/11
  • Last Seen:  

I took this from another post but i want to add to it.

-	script	refresh_pvp	-1,{
OnInit:
	bindatcmd "refresh",strnpcinfo(0) +"::OnRefresh";
	end;
OnRefresh:
	if( getmapflag( strcharinfo(3),mf_pvp ) )
		message strcharinfo(0),"@refresh is not allowed in pvp map.";
	end;
}

i would like to be able to limit the ability to use this @command once every 4 sec in any map. In addition to disabling it in pvp. Who would i be able to do that. Thanks

 

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  12
  • Topics Per Day:  0.00
  • Content Count:  155
  • Reputation:   51
  • Joined:  07/15/13
  • Last Seen:  

-	script	refresh_pvp	-1,{
OnInit:
	bindatcmd "refresh",strnpcinfo(0) +"::OnRefresh";
	end;
OnRefresh:
	if( getmapflag( strcharinfo(3),mf_pvp ) ) {
		message strcharinfo(0),"@refresh is not allowed in pvp map.";
	end;
	} else {
		message strcharinfo(0),"You must wait 4 seconds for re-use this command.";
		if (@refdelay) end;
		set @refdelay, 1;
		atcommand "@refresh";
		sleep2 4000; // 4sec Delay
		set @refdelay, 0;
		end;
	}
}

Tested and works fine

  • Upvote 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  41
  • Topics Per Day:  0.01
  • Content Count:  197
  • Reputation:   19
  • Joined:  11/20/11
  • Last Seen:  

thank you

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...