Blockland Forums > Modification Help
Client sided?!
<< < (3/3)
Jasa1:

--- Quote from: infiniteLoop on July 27, 2011, 01:36:20 PM ---Lol but why use 9, since the argument is a boolean, that doesn't make sense.. maybe i'm just too used to proper languages..

--- End quote ---
9 is closer to ( and ) on the keyboard.
Placid:

--- Code: ---package clCmd {
function NMH_Type::send(%chat) {
%msg=%chat.getValue();
%wrd=firstWord(%msg);
%cmd="clCmd"@getSubStr(%wrd,1,strLen(%wrd));
if(getSubStr(%msg,0,1)$="/"&&isFunction(%cmd)) {
call(%cmd,getWord(%msg,1),getWord(%msg,2),getWord(%msg,3),getWord(%msg,4),getWord(%msg,5));
commandToServer('stopTalking');
canvas.popdialog(newMessageHud);
%chat.setValue("");
}
Parent::send(%chat);
}
};
activatePackage(clCmd);
--- End code ---
all credit goes to Truce

put it in a client.cs inside a folder named "Support_clCmd"

then, with your command, use function clientCmd and add your commandname after that just like you would for a servercmd. just remember that you can't use like, %client and stuff.
xcruso:

--- Quote from: Placid on July 27, 2011, 05:09:50 PM ---
--- Code: ---package clCmd {
function NMH_Type::send(%chat) {
%msg=%chat.getValue();
%wrd=firstWord(%msg);
%cmd="clCmd"@getSubStr(%wrd,1,strLen(%wrd));
if(getSubStr(%msg,0,1)$="/"&&isFunction(%cmd)) {
call(%cmd,getWord(%msg,1),getWord(%msg,2),getWord(%msg,3),getWord(%msg,4),getWord(%msg,5));
commandToServer('stopTalking');
canvas.popdialog(newMessageHud);
%chat.setValue("");
}
Parent::send(%chat);
}
};
activatePackage(clCmd);
--- End code ---
all credit goes to Truce

put it in a client.cs inside a folder named "Support_clCmd"

then, with your command, use function clientCmd and add your commandname after that just like you would for a servercmd. just remember that you can't use like, %client and stuff.

--- End quote ---

Thanks.
MegaScientifical:

--- Quote from: Placid on July 27, 2011, 05:09:50 PM ----snip-
all credit goes to Truce

put it in a client.cs inside a folder named "Support_clCmd"

then, with your command, use function clientCmd and add your commandname after that just like you would for a servercmd. just remember that you can't use like, %client and stuff.

--- End quote ---

Looks a bit more efficient than my way, but I'd rather not have individual commands for some of the things I do. Having them activate within that helps me when they're only like one line.
Placid:

--- Quote from: MegaScientifical on July 28, 2011, 01:00:16 AM ---Looks a bit more efficient than my way, but I'd rather not have individual commands for some of the things I do. Having them activate within that helps me when they're only like one line.

--- End quote ---
yeah, personally i don't use clientCmd anymore besides like, clientCmdChatMessage. i'd much rather use console than have to use /cmds, but that's just my preference i guess
Navigation
Message Index
Previous page

Go to full version