Author Topic: Eggo's Simple Questions  (Read 788 times)

I can finally host so I'm going to try to get some simple scripts for my server, maybe try to get into scripting again. I'll update this thread with my questions.

1st set of questions: How can I add a client to a list, when the client uses a servercmd?
How can I remove that client from that list, when the client uses a different servercmd?
How can that list be viewed by other clients?

Well, you can add a global list variable using 1 of 2 methods


First method:
String
Pros: a little less complicated in cases
Cons: Ineffective in some abstract situations

I will avoid mentioning this as I dislike this method.


Second method:
Array
Pros: arrays are great
Cons: arrays are great

Code: [Select]
if(!$Thelist_count){
   $Thelist_count=0;
}
$TheList[$Thelist_count]=%client.getname();
$TheList_num[%client.getname()]=$Thelist_count;
$Thelist_count++;
For adding


Code: [Select]
%i=$TheList_num[%client.getname()];
while(%i < $Thelist_count){
$TheList[%i]=$TheList[%i + 1];
$TheList_num[$TheList[%i]] = %i;
%i++;
}
$TheList[$Thelist_count]=0;
$TheList_count--;
For subtracting




Code: [Select]
%i=0;
%msg = "The list:";
While(%i < $Thelist_count){
%msg = %msg @ $TheList[%i] @ " ";
%i++;
}
messageclient(%client,'',%msg);
For viewing



All of this untested and meant to be placed in the appropriate servercmds.
I'm a little iffy on the subtraction part, can anyone look over that and make sure I didn't screw up?

I have a problem. I've got the script all together, I packaged it up, plopped the .zip in my add-ons folder (Script_scriptname.zip), but when I go to enable it, it doesn't show up on the list.

Edit: Yes, I started blockland after ploppin' the script in the add-ons folder.
« Last Edit: June 09, 2009, 05:51:34 PM by LegoEggo »


Description?

You mean I have to have a description in the .zip?

You mean I have to have a description in the .zip?
Add-ons need a description.txt to prevent fail addons from their source.
Open up notepad or whatever and type in:
Code: [Select]
Title: ScriptNameHere
Author: YourNameHere
A short description of your addon

Add-ons need a description.txt to prevent fail addons from their source.
Open up notepad or whatever and type in:
Code: [Select]
Title: ScriptNameHere
Author: YourNameHere
A short description of your addon

Hmm that's new since I last scripted.

Will do.

Hmm that's new since I last scripted.

Will do.
As I said, it's to prevent noob add-ons from the source. It was added in V9.

It still won't show up.

You're sure you have a description.txt and a server.cs packaged up in a zip and they are not in any enclosing folders?
While I'm at it, what is the datablock name for the admin cam? I'm fairly sure it's just Camera, and how would I go about changing its emitter? Could I put:
Code: [Select]
Camera.setEmitter(burnEmitterA);For example?

This is happening with most of the add-ons I download D:

I fixed my problem... but I can't get Rky's code to work D: