DrakeSky Posted June 22, 2020 Posted June 22, 2020 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! Quote
0 Start_ Posted June 22, 2020 Posted June 22, 2020 - script SellCommand -1,{ OnInit: bindatcmd "sell",strnpcinfo(3) + "::OnSellCommand"; end; OnSellCommand: .@s$ = .@atcmd_parameters$[0]; announce strcharinfo(0) + ": " + .@s$,bc_all,0x2fe24a; end; } Quote
0 DrakeSky Posted June 22, 2020 Author Posted June 22, 2020 (edited) 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 June 22, 2020 by DrakeSky Quote
0 Katazui Posted June 22, 2020 Posted June 22, 2020 (edited) 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 June 22, 2020 by Katazui Quote
0 DrakeSky Posted June 23, 2020 Author Posted June 23, 2020 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 Quote
Question
DrakeSky
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!
4 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.