register_clcmd with parameter? [SOLVED]
Hello, can I somehow add parameter to register_clcmd command? I want one function (with parameter), which will be called by more register_clcmds.. Like change map...
Now I must copy 2 same function (with different mapname) register_clcmd("say /cbble", "cmd_cbble", 0, "- changelevel de_cbble") register_clcmd("say /cpl_mill", "cmd_cpl_mill", 0, "- changelevel de_cpl_mill") I would like something like this: register_clcmd("say /cbble", "cmd_changemap('cbble')", 0, "- changelevel de_cbble") register_clcmd("say /cpl_mill", "cmd_changemap('mill')", 0, "- changelevel de_cpl_mill") cmd_changemap(id,name[]) { ... } Much cleaner code.. Any help please? |
Re: register_clcmd with parameter?
for say command you can use the say event here an code example
Code:
|
Re: register_clcmd with parameter?
Interesting, I will try it!
|
Re: register_clcmd with parameter?
Try this:
Code:
|
Re: register_clcmd with parameter?
I see only way is controll every say text in the game :/ Dont know if it is good solution (many say texts in PUB servers) ... I trying keep CPU usage lowest as possible
|
Re: register_clcmd with parameter?
then use this;
for admin_kick only, Code:
|
Re: register_clcmd with parameter?
Quote:
Code:
But it is the same to sort it in the say function or in register_clmd. |
Re: register_clcmd with parameter?
Yeah.. Sometimes I think I am stupid :)
Problem solved, code is cleaner, ADMIN acces, say /command, and then controll say by handle_say.. Thanks a Lot! Karma + |
Re: register_clcmd with parameter? [SOLVED]
Quote:
|
| All times are GMT -4. The time now is 06:57. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.