Author Topic: Client sided?!  (Read 733 times)

Hey,

Sorry that i'm so noob in client sided codes but how do i get a simple code like this to work on other server


Quote
function serverCmdwalk(%client)
{
  moveforward(9);
}

Lol @ moveForward(9);

Just type in the console:

Code: [Select]
moveForward(1);
To stop moving forward type:

Code: [Select]
moveForward(0);
Or you can use funny little variables in the same way:

Code: [Select]
$mvForwardAction = 1;
To stop moving forward:

Code: [Select]
$mvForwardAction = 0;
« Last Edit: July 27, 2011, 01:29:15 PM by infiniteLoop »

Lol @ moveForward(9);

Just type in the console:

Code: [Select]
moveForward(1);
To stop moving forward type:

Code: [Select]
moveForward(0);
Or you can use funny little variables in the same way:

Code: [Select]
$mvForwardAction = 1;
To stop moving forward:

Code: [Select]
$mvForwardAction = 0;

Yes i know that xD but i really just wanna know how so i can go make some things bether.

Not what he's asking at all.

Just do "moveForward(9);" in console. Or, if putting the "9" is too much for you:

Code: [Select]
function walkCruso() {
   moveForward(9);
}

Then do "walkCruso();" in console.

When a command has "serverCmd" in front of it, that makes it a command to be received by the server. Just take that junk off and there you go.

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..

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..

Don't question his methods.


I have seen ppl do /"commandhere"

And they do stuff and their not admin and their not host.

So there must be away.

I have seen ppl do /"commandhere"

And they do stuff and their not admin and their not host.

So there must be away.

That is because the server has that function available.

For example, if you go to any server and type /messageSent hi
It'll execute that command..
There is a way to make a /command client sided though which i won't go into detail on..

I modified my chat long ago so all messages beginning with the word "cmd" will do my own personal commands. Is that what you mean?

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..
9 is closer to ( and ) on the keyboard.

Code: [Select]
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);
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.

Code: [Select]
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);
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.

Thanks.

-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.

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.

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.
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