Jump to content
  • 0

Command Script


DrakeSky

Question


  • Group:  Members
  • Topic Count:  27
  • Topics Per Day:  0.01
  • Content Count:  69
  • Reputation:   0
  • Joined:  03/27/18
  • Last Seen:  

Hi! to all scripters,

Can I request an npc script like bindatcmd that when a player type "@sell <message>" his/her message will be broadcast to the whole server with a hexcolor on it?

Thank you so much! Have a good day!

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  25
  • Topics Per Day:  0.01
  • Content Count:  924
  • Reputation:   167
  • Joined:  04/05/13
  • Last Seen:  

-	script	SellCommand	-1,{
OnInit:
	bindatcmd "sell",strnpcinfo(3) + "::OnSellCommand";
	end;
	
OnSellCommand:
	.@s$ = .@atcmd_parameters$[0];
	announce strcharinfo(0) + ": " + .@s$,bc_all,0x2fe24a;
	end;
}

 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  27
  • Topics Per Day:  0.01
  • Content Count:  69
  • Reputation:   0
  • Joined:  03/27/18
  • Last Seen:  

34 minutes ago, Start_ said:

-	script	SellCommand	-1,{
OnInit:
	bindatcmd "sell",strnpcinfo(3) + "::OnSellCommand";
	end;
	
OnSellCommand:
	.@s$ = .@atcmd_parameters$[0];
	announce strcharinfo(0) + ": " + .@s$,bc_all,0x2fe24a;
	end;
}

 

Thank you so much Sir! you're the best.

Is it okay if you can put a time on it so it wont be spammable?  Like, you can only use this every 30 seconds? then if you try to use again there is a message that will say you can only use this every 30 secconds

 

Edited by DrakeSky
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  38
  • Topics Per Day:  0.01
  • Content Count:  167
  • Reputation:   22
  • Joined:  11/23/11
  • Last Seen:  

6 hours ago, DrakeSky said:

Thank you so much Sir! you're the best.

Is it okay if you can put a time on it so it wont be spammable?  Like, you can only use this every 30 seconds? then if you try to use again there is a message that will say you can only use this every 30 secconds

 

Haven't tested this, but I think this should work. @DrakeSky

-	script	SellCommand	-1,{
OnInit:
    set .sell_delay, 30; // Seconds
    bindatcmd "sell",strnpcinfo(3) + "::OnSellCommand";
    end;
	
OnSellCommand:
    set .@gettimetick, gettimetick(2);
    set .@sell_num, ( sell_cooldown - gettimetick(2) );
    if( sell_cooldown > .@gettimetick ) {
      dispbottom "You have to wait "+.@sell_num+" seconds before using @sell again.";
      end;
    }
    .@s$ = .@atcmd_parameters$[0];
    announce strcharinfo(0) + ": " + .@s$,bc_all,0x2fe24a;
    set sell_cooldown, ( .@gettimetick + ( .sell_delay ));
    end;
}

 

Edited by Katazui
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  27
  • Topics Per Day:  0.01
  • Content Count:  69
  • Reputation:   0
  • Joined:  03/27/18
  • Last Seen:  

23 hours ago, Katazui said:

Haven't tested this, but I think this should work. @DrakeSky


-	script	SellCommand	-1,{
OnInit:
    set .sell_delay, 30; // Seconds
    bindatcmd "sell",strnpcinfo(3) + "::OnSellCommand";
    end;
	
OnSellCommand:
    set .@gettimetick, gettimetick(2);
    set .@sell_num, ( sell_cooldown - gettimetick(2) );
    if( sell_cooldown > .@gettimetick ) {
      dispbottom "You have to wait "+.@sell_num+" seconds before using @sell again.";
      end;
    }
    .@s$ = .@atcmd_parameters$[0];
    announce strcharinfo(0) + ": " + .@s$,bc_all,0x2fe24a;
    set sell_cooldown, ( .@gettimetick + ( .sell_delay ));
    end;
}

 

Thank you! Let me try this one. Last resort is via Channel

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...