Author Topic: My questions thread  (Read 9622 times)

servercmdForgetCoding(%client, %server)
   {##
##   talk("I must have forgeted up big time");
   };


I know its obvious; I just forgot how to package things
« Last Edit: October 21, 2013, 07:36:50 PM by Johnny Blockhead »

function servercmdName(%client,%whatever)
{
}

function servercmdKitty(%client, %server)
{
   talk("Prrr");
};##


function servercmdKitty(%client, %server)
{
   messageClient("prr");
}

In game result:

Johnny Blockhead: /kitty
-silence-


yes I don't know how to do this

messageClient(%client, '', "prr");

messageClient(%client, ' ', "prr");

Also note that what's bolded are two single quotation marks, it isn't one whole quotation mark.

Hello friends, family, child enthusiasts, rapists, druggies, and most importantly coders. Today a problem has arisen; I have a coding problem. I am asking you, Block land Forums, to help me. I have strode along the streets and alleys of my poor town and found many cats astray in the street. I feel bad for these cats, so I reference to the almighty internet. I found many people very (loveually) interested in cats. They call themselves 'furries'. I thought to my self how honorable these people where, giving poor animals homes in their hearts. I decided to make a mod called the 'Cat Mod', where you can adopt, name, and talk to a cat that exists in the chat of your local blockland program. One of my first problems is that I have no idea how to name the cat. I softly thought to myself that if the cat is represented by a said variable, such as $kitty, you could do something along the dear lines of $kitty = 'Georges' so the kitty is named Georges. I then think differently about this, because there are a lot of dear, heroic furries out there. This solution would only work for one cat! I don't know how to go about this, please help. Also, I have no idea how to represent $kitty in chat. If someone said /namecat Georges, what would I put in response? messageClient(%client, '', "Your cat is named $kitty"); Would this solution do it? I don't think so, because variables aren't automagically replaced by what they are. That was my second problem. My third, probably harder and less needed problem, is how would I save said kitty when the handsome furry disconnects? I know this is very complex, so it may not end up happening.

Read all of it.



Because none of us understand..
Questions -

1 : Is that supposed to be client-sided or server sided?
2 : Are you going to have premade responses a cat can say?


Because none of us understand..
Questions -

1 : Is that supposed to be client-sided or server sided?
2 : Are you going to have premade responses a cat can say?
1. Server sided
2. Yes

Also note that what's bolded are two single quotation marks, it isn't one whole quotation mark.

And inside of those two single quotes you can specify a message callback. For example, say you wanted to play the admin chime when someone types "/helloworld", you would use 'MsgAdminForce' as your message callback.

Code: [Select]
function serverCmdHelloWorld(%client)
{
        messageClient(%client, 'MsgAdminForce', "\c3Goodbye, cruel world!");
}

That is not the only message callback you could use, there are plenty of other choices and you can get a list printed to your console by evaluating this code:

Code: [Select]
while(getTaggedString(%i++) !$= "") { echo(getTaggedString(%i)); }

Please take note that the above code is best run while you aren't hosting a server, otherwise the messages that show when you for example, hammer someone to death or run them over, will also be printed because they are tagged strings.

You can also add a message callback using the addMessageCallback function.

Code: [Select]
function doExample()
{
        messageAll('MsgAdminForce', "Hello, World!");
}

addMessageCallback('msgExample', "doExample");

If you were to use the 'msgExample' callback it would send the message "Hello, World!" and play the admin chime to everyone in the server.




I'm not quite sure what to think of this but I have a feeling you're just joking. If you aren't, and have a serious question please ask it again be a little more specific.

I'm not quite sure what to think of this but I have a feeling you're just joking. If you aren't, and have a serious question please ask it again be a little more specific.

This is serious
seriously you could just read it

Quote
One of my first problems is that I have no idea how to name the cat. I softly thought to myself that if the cat is represented by a said variable, such as $kitty, you could do something along the dear lines of $kitty = 'Georges' so the kitty is named Georges. I then think differently about this, because there are a lot of dear, heroic furries out there. This solution would only work for one cat! I don't know how to go about this, please help. Also, I have no idea how to represent $kitty in chat. If someone said /namecat Georges, what would I put in response? messageClient(%client, '', "Your cat is named $kitty"); Would this solution do it? I don't think so, because variables aren't automagically replaced by what they are. That was my second problem. My third, probably harder and less needed problem, is how would I save said kitty when the handsome furry disconnects? I know this is very complex, so it may not end up happening.