| Blockland Forums > Modification Help |
| Variables in Chat Commands |
| << < (2/2) |
| Mapster:
Sorry I should have elaborated, the VCE variables. For Example: OnActivate-->Client-->VCE_modVariable-->bla[Set]2 OnActivate-->Client-->CenterPrint-->Bla: <var:cl:bla> It would say in centerprint, Bla: 2. I need to make it so when you type /bla it says Bla: 2. (Asuming you have 2 Bla Variables.) |
| Headcrab Zombie:
So you want the /bla command to show the value of the VCE variable named bla? VCE variables are handled completely differently that normal variables, I can dig it up for you --- Code: ---function serverCmdbla(%client) { messageclient(%client,'',"Bla: " @ %client.brickgroup.vargroup.getVariable("Client","bla",%client)); } --- End code --- Don't use VCE vars unless you absolutely need it to also be accessible by VCE. If you don't, do something like this --- Code: ---function serverCmdSetbla(%client,%bla) { %client.bla = %bla; } function serverCmdBla(%client) { messageclient(%client,'',"Bla: " @ %client.bla); } --- End code --- |
| Mapster:
Thank you this will work. |
| phflack:
i think all he wanted to know was how to add on to a string? i think if you use SPC instead of @ it puts a space between them too |
| jes00:
--- Quote from: phflack on January 22, 2012, 10:52:18 PM ---i think all he wanted to know was how to add on to a string? i think if you use SPC instead of @ it puts a space between them too --- End quote --- All he wanted to know was how to make a code that displays a VCE variable in the chat when you type a server command. You are correct, SPC can be used instead of @ and it will put a space. |
| Navigation |
| Message Index |
| Previous page |