Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Moosh

Pages: 1 2 3 4 5 6 [7] 8 9 10
91
Modification Help / Re: Basic ServerCmd and Messages
« on: March 27, 2016, 07:49:12 PM »
Here's an example of multiple words:
Code: server.cs (10 lines)
function serverCmdHi(%client, %msg0, %msg1, %msg2, %msg3, %msg4, %msg5, %msg6)
{
    for(%i = 0; %i <= 6; %i++) //There are 7 msg arguments, start from 0, go to 6.
        if(%msg[%i] !$= "") //If the current number has something in it, add it to the message variable
            %msg = %msg SPC %msg[%i]; //Each argument gets a space in between

    %client.chatMessage("\c6Hello. I have a message for you: \c3" @ %msg); //%client.chatMessage(string message);
    //\c0 to \c8 have different colors, you can do a /colorTest on your server for each of their colors.
    //Ex: <color:ffff00> is the same as \c3 (Yellow)

}

Thanks for the example; I was able to improve my code to something like this:
Code: [Select]
//Command "/messageall {message}"
function servercmdMessageAll(%client, %msg1, %msg2, %msg3, %msg4, %msg5, %msg6, %msg7, %msg8)
{
if (!%client.issuperadmin) return;
for (%i = 0; %i < 8; %i++)
if (%msg[%i] !$= "")
%msg = %msg SPC %msg[%i];
messageAll('', "[Announcement] \c6" @ %msg);
}

//Command "/messageuser {name} {message}"
function servercmdMessageUser(%client, %name, %msg1, %msg2, %msg3, %msg4, %msg5, %msg6, %msg7, %msg8)
{
%target = findClientByName(%name);
if(!isObject(%target))
messageClient(%client, '', "\c0Could not send message to user [\c3" @ %name @ "\c0]"); //1
return;
for (%i = 0; %i < 8; %i++)
if (%msg[%i] !$= "")
%msg = %msg SPC %msg[%i];
messageClient(%target, '', "\c0Message from [\c3" @ %client.name @ "\c0] \c6" @ %msg); //2
}
An error I seem to be having now is that if I have the line of code marked //1, then the code marked //2 stops functioning.

92
Modification Help / Re: Basic ServerCmd and Messages
« on: March 27, 2016, 07:03:02 PM »
messageAll('', %msg);
messageClient(%target, '', %msg);

you can also use if(isObject(%target)) instead of just checking for -1.
Ah, thanks for the heads up

Replace getclientbyid(%blid) with findClientByBL_ID(%blid) because getClientByID does not exist.
Replace if(%target == -1) to if(!isObject(%target)) because the command above returns a 0, not a -1 (I'm probably wrong but--) and it's better to use !isObject(object) in most situations.
Also, replace messageAll(%message); with messageAll('', %message);, the '' are not quotes. They are apostrophes. The above post explains the actual use, they are supposed to be tagged strings.
You have a syntax error at ");, just remove the quote.

Everything else looks fine to me, although, you're only going to be able to say 1 word to the player.
Greeat, thanks! I'll look into those mistakes I've made, and see what I can do about multiple words!

Thanks for the help, I'll get back to you later!

93
Modification Help / Basic ServerCmd and Messages
« on: March 27, 2016, 06:39:37 PM »
I am very new to TorqueScript (in fact, I just started learning today), and I'd like some help with this basic script I've been trying to make.
Pretty much I am trying to make it so that if the client types "/messageall {message}", a chat message is displayed to all users, and if the client types "/messageuser {user blid} {message}" then a message is sent to a specific user.
Code: [Select]
function servercmdMessageAll(%client, %message)
{
if (!%client.issuperadmin) return;
messageAll(%message);
}

function servercmdMessageUser(%client, %blid, %message)
{
%target = getclientbyid(%blid);
if (%target == -1) return;
messageClient(%target, "", "<color:FF0000>Message from [" @ %client @ "] <color:FFFFFF>" @ %message");
}
Unfortunately, this code does not run. Even when trying simple commands like talk(); it still does not display.
I'd greatly appreciate any help (even more so if well explained), even if this script is utter nonsense.
Thanks!

94
Help / Re: Shift Key
« on: March 21, 2016, 12:46:51 PM »
Sadly, no, this only occurs in Blockland - There are no yellow triangles nor do I have sticky keys enabled.
Thanks for your help though

95
Help / Re: Shift Key
« on: March 20, 2016, 09:47:10 AM »
Thanks, but this problem has been occurring for the past few days, with the issue still there when I restart Blockland.

96
Help / Shift Key
« on: March 20, 2016, 09:21:24 AM »
Whilst playing a game, I accidentally hit a/some keys and it seems to have changed what pressing the left and right arrows do when typing - Usually they would just change the place of the text marker, but now it highlights each key as I move. If I press shift then the problem does not occur (so it seems like it's reversed the function), but it's really quite annoying.

I've tried resetting the controls but it hasn't changed anything, so if you can please help!

97
I'd like to reserve a spot, but I don't know if I can guarantee my entry...

98
General Discussion / Re: What if? Topic.
« on: March 15, 2016, 12:40:33 PM »
What if someone creates a completely irrelevant what if?

99
General Discussion / Re: Join Dates and BLID
« on: March 12, 2016, 04:35:44 AM »
i bought the game in the '84 but i had the demo since the 60s.
ahh the moon landing was great
.

100
Off Topic / Re: How secure is your password?
« on: March 11, 2016, 10:36:48 AM »
And for the password I use for my day-to-day business:

101
General Discussion / Re: Join Dates and BLID
« on: March 11, 2016, 10:08:15 AM »
33750
September 10th, 2011
I think your ID is too low to be that early

102
General Discussion / Re: Join Dates and BLID
« on: March 09, 2016, 12:00:19 PM »
December 2010(?)

blid 18454
Wrong, I'm a 24k and I joined September 2010.
He's from December 2009 - I think

103
General Discussion / Re: Join Dates and BLID
« on: March 08, 2016, 12:42:47 PM »
-snip-
Wow. It must have been amazing to go through all those changes and see the game grow as it did.

104
General Discussion / Re: Join Dates and BLID
« on: March 08, 2016, 12:21:40 PM »
add this date on the graph too if you have the room
http://forum.blockland.us/index.php?topic=231599.0
Edited it, thanks!

105
General Discussion / Re: Join Dates and BLID
« on: March 08, 2016, 11:57:31 AM »
I think it's probably around 5000 actually.

Remurr has a 3.5k ID at the very end of 2007;So we can assume '08 started with 3.5-4k IDs.

I have 7482 in September, so roughly 4000 IDs in 9 months.
I think it's fair to assume in the last 3 months of '08 that we at least reached 8k IDs.
Unless I missed them, no 9k IDs have given an accurate date.
I guess they either came December or January. Leaving '08 with either 8 or 9k IDs.

So a fair guess is that 4500 to 5500 IDs were sold in 2008.
Which at the then price of $20, was worth $90,000 to $110,000.
I was basing my assumptions of this graph I was making:

Each pixel represents 500 IDs and 0.6months, and based on this it shows that roughly 6000 people joined between the end of 2007 and 2008.
It's still not very accurate, and there's no way to be certain of the ID shown to be the highest at that point of time, but I find the correlation quite interesting.

Pages: 1 2 3 4 5 6 [7] 8 9 10