Author Topic: Need help with input!  (Read 1769 times)

Why is there a semicolon between the 4 #s?

The semicolon is the error, it should be deleted.

The semicolon is the error, it should be deleted.
Ah, so I should delete it and put my BL_ID in the # area?

Ah, so I should delete it and put my BL_ID in the # area?

No, just delete any red you see

hm, noticed that when I tried to make it work with bricks, it doesn't load them on. Is there anyway to fix this?

I really think there must be a command to update the brick list or something...?

if there is a new datablock added, then people usually must leave and rejoin to see the change.

also people will usually crash if they don't have an addon that uses sounds, models, music, or images

Well my friend gave me something that updates the data blocks at my server, but it only worked for him! He got slanted bricks when I ran the function but I did not, this probably means hosts don't get it, but players do:

Code: [Select]
function updateclientdatablocks()
{
for (%i = 0; %i < ClientGroup.getCount(); %i++)
{
%client = ClientGroup.getObject(%i);
%client.reloadDatablocks = true;
%client.transmitDataBlocks($missionSequence);
}
}

IN ADDITION TO:

Code: [Select]
function ServerCmdEnableAddon(%Client,%Addon)
{
//Return; means to exit so were exiting the command
       //"GetNumKeyID" means the host ID so we are comparing it to the clients id
     if(%Client.bl_id != getNumKeyID())
     return;
       //This checks if the Server.cs exists
     if(!isFile("add-ons/"@%Addon@"/server.cs"))
     return;
       //This enables the Server.cs
     announce("\c0Host is enabling\c3" SPC %Addon);
     exec("add-ons/"@%Addon@"/server.cs");
       //This announces it
if(!copmile("add-ons/Script_EnableAddon/server.cs"))
{
warn("Contains syntax errors!");
}
announce("\c0Updating datablocks for" SPC %Addon);
exec("add-ons/Script_updateClientDatablocks/server.cs");
}

Any  help please?
« Last Edit: January 27, 2012, 11:57:00 PM by I-have-not »


function ServerCmdEnableAddon(%Client,%Addon)
{
//Return; means to exit so were exiting the command
       //"GetNumKeyID" means the host ID so we are comparing it to the clients id
     if(%Client.bl_id != getNumKeyID())
     return;
       //This checks if the Server.cs exists
     if(!isFile("add-ons/"@%Addon@"/server.cs"))
     return;
//Move the Compile to check for syntax errors before we execute it and make it return the function if it has syntax errors
     if(!copmile("add-ons/@%Addon@/server.cs"))
     {
     return warn("Contains syntax errors!");
     }
       //This enables the Server.cs
     announce("\c0Host is enabling\c3" SPC %Addon);
     exec("add-ons/"@%Addon@"/server.cs");
//We don't want to check for syntax errors AFTER we have enabled it
     if(!copmile("add-ons/@%Addon@/server.cs"))
     {
     warn("Contains syntax errors!");
     }

//This should call the update client function
     updateclientdatablocks();
//We're not going to execute the Server.cs a second time
     announce("\c0Updating datablocks for" SPC %Addon);
     exec("add-ons/Script_updateClientDatablocks/server.cs");
     }
     
     function updateclientdatablocks()
     {
          for (%i = 0; %i < ClientGroup.getCount(); %i++)
          {
          %client = ClientGroup.getObject(%i);
          %client.reloadDatablocks = true;
          %client.transmitDataBlocks($missionSequence);
          }
     }