Messagemode : 2 arguments[solved]
Hello evryone,
Im using message mode to execute a command with a name and a reason. Code:
client_cmd(id, "messagemode ^"amx_warn %s ^"",name)The command will be : Player Warned : Im Cool , Reason : Cool I tried many things but none worked out. Hope you guys can help me. Greets Grim. |
Re: Messagemode : 2 arguments
replace_all(name, sizeof(name) - 1, " ", "%");
|
Re: Messagemode : 2 arguments
As you already know the id + name of the warned player, you could just store it in memory, then use a simple messagemode, like "messagemode warnreason".
|
Re: Messagemode : 2 arguments
@minimiller
First of all ty for helping me, Second : When my name is "Im Cool", you will change it to "Im%Cool". Im using cmd target so it will search for players with the name "Im%Cool" What i can do is in the cmd itself you replace the "%" back to " ". Im going to try that. Dont let this stop others to come with a better solution. @Connor : Can you give a small example, I think if I do it your way, I would need to make 2 different functions for the same effect. Not? EDIT : Minimiller way is working with the add I have done. Tough I think there might be a cleaner solution. |
Re: Messagemode : 2 arguments
i thought %'s were switched with spaces when they are printed in chat
|
Re: Messagemode : 2 arguments
Dont know about that, but I use messagemode to activate a command.
Amx_warn "PlayerName" "Reason" You change the name from "Im Cool" to "Im%Cool" So cmd_target will search for a player named "Im%Cool", And you will get a message in console "Player cant be found" |
Re: Messagemode : 2 arguments
hmmm
im not entirely sure what ur trying to do can i see more code? |
Re: Messagemode : 2 arguments
People can open a menu, with all playernames. When they press a name, messagemode will be used to call "amx_warn playername" and then they got to add a reason.
|
Re: Messagemode : 2 arguments
Just save the selected players id and then you will only need the message mode for the reason. After they hit enter then you retrieve the selected id and the message and use them to do what you want. You don't need to insert the name into the message mode (afaik you can't submit two arguments in messagemode unless you parse them manually which would probably be a pain in the butt).
|
Re: Messagemode : 2 arguments
Well that way minimiller told me about is working, maybe yours would be better. Ill see what im about to do.
Thx all. |
| All times are GMT -4. The time now is 22:34. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.