deltagi Posted March 22, 2015 Report Share Posted March 22, 2015 I was wondering how you could implement custom console commands, such as typing /rules the console will bring up all commands. Or if you guys have any better ideas on how this could be done thanks! -Aurora Link to comment Share on other sites More sharing options...
0 AlexLawson Posted March 22, 2015 Report Share Posted March 22, 2015 There is something out there already I think it runs a loop that checks text, so !rules would then trigger a script that shows the rules. I looked for it a few days ago but couldn't find it if anyone knows where it I would love a link. Link to comment Share on other sites More sharing options...
0 DeanReid Posted March 22, 2015 Report Share Posted March 22, 2015 you could make a script that gets input from the chat like _chat = _display displayCtrl 28; _text = ctrlText _chat; if(_tex in ["/rules"]) then { systemChat "====Rules===="; sleep 0.5; systemChat "No Haxors"; sleep 0.5; systemChat "No camping safezones"; sleep 0.5; systemChat "Kill me"; sleep 0.5; systemChat "Love infiSTAR"; }; should work. you will need to double check the displayCtrl number for the chat box because I can't remember, if I find out ill update the post Link to comment Share on other sites More sharing options...
0 deltagi Posted March 22, 2015 Author Report Share Posted March 22, 2015 do you know where I would put that bit of code? under a SQF or? Link to comment Share on other sites More sharing options...
0 DeanReid Posted March 22, 2015 Report Share Posted March 22, 2015 Yeah just put it into a file and execVM in init.sqf Link to comment Share on other sites More sharing options...
0 deltagi Posted March 22, 2015 Author Report Share Posted March 22, 2015 ok thanks ill try it tomorrow, my server is still provisioning from Vilayer unfortunately Link to comment Share on other sites More sharing options...
0 Gr8 Posted March 22, 2015 Report Share Posted March 22, 2015 Fixed a typo for ya Dean _chat = _display displayCtrl 28; _text = ctrlText _chat; while {alive player} do { if(_text in ["/rules"]) then { systemChat "====Rules===="; sleep 0.5; systemChat "No Haxors"; sleep 0.5; systemChat "No camping safezones"; sleep 0.5; systemChat "Kill me"; sleep 0.5; systemChat "Love infiSTAR"; }; sleep 1; }; AlexLawson and axeman 2 Link to comment Share on other sites More sharing options...
0 deltagi Posted May 8, 2015 Author Report Share Posted May 8, 2015 that still didn't work, no errors but it didn't recognize the text at all. -Aurora is there a already made file in compiles.sqf to use? Link to comment Share on other sites More sharing options...
0 FreakingFred Posted May 8, 2015 Report Share Posted May 8, 2015 that still didn't work, no errors but it didn't recognize the text at all. -Aurora is there a already made file in compiles.sqf to use? If you haven't already, then I believe you are going to have to loop that if conditional. I would suggest trying to add it into a while loop that's conditional is always true. _condition = true; while {_condition} do { // if condition then execute code }; [Edit] Never mind, I just realized that Gr8 had already mentioned using a while loop. Link to comment Share on other sites More sharing options...
0 FreakingFred Posted May 8, 2015 Report Share Posted May 8, 2015 Also, if you have Infistar AH, then I would just suggest attempting to add in new commands to the AH.sqf. Just open up the file, hit ctrl+F, search for "dance," and you will see all of the commands. That would probably be your best bet. Link to comment Share on other sites More sharing options...
Question
deltagi
I was wondering how you could implement custom console commands, such as typing /rules the console will bring up all commands. Or if you guys have any better ideas on how this could be done thanks!
-Aurora
Link to comment
Share on other sites
9 answers to this question
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now