Author Topic: how would i tell someone who joins a server that dosnt have my gui how to DL  (Read 697 times)

Basicly i want it to check if the player who joined the server has client_SCGUI.zip. and if they dont have it say "Missing file "Client_SCGUI.zip" you may download here" in the chat when they join the server (not when they spawn) if they dont have the GUI thanks

Heres an example on how to do it

Client
Code: [Select]
function clientCmdClTestHandshake()
{
   commandToServer('TestHandshake');
}
Server
Code: [Select]
function doTestHandshake(%client)
{
   commandToClient(%client,'ClTestHandshake');
}
function serverCmdTestHandshake(%client,%num)
{
   echo("Client has add-on");
}



Duplicate question. Try searching before you post ;)
Just make doTestHandshake be called in packaged GameConnection::AutoAdminCheck
« Last Edit: February 22, 2014, 02:53:40 AM by RarwMuffinz »

What Muffinz said.
The only bad thing is that if you have other GUI things all the client would have to do is delete everything but the
handshake. their loss though! Not sure if their is any way to protect that.

Complete solution:

SERVER



function myHandshakeCheck(%client)
{
   if(!%client.hasShakedMyHand)
   {
      %client.delete("You cannot play without downloading <a:www.mySiteLinkWithoutHTTPColo nSlashSlash.com>this add-on</a>");
   }
}

function serverCmdmyHandshakeReceive(%c)
{
   %client.hasShakedMyHand = true;
}

package myPackageName
{
    function GameConnection::AutoAdminCheck(%client)
   {
      commandToClient(%client, 'myHandshakePP');
      schedule(2500, 0, "myHandshakeCheck", %client);
      %client.hasShakedMyHand = false;
      return parent::AutoAdminCheck(%client);
   }
};
activatePackage(myPackageName);



CLIENT


function clientCmdmyHandshakePP()
{
   commandToServer('myHandshakeReceive');
}

-spoonfeeding-

We don't look too kindly on spoonfeeding here in Coding Help. It's Coding Help, not Suggestions and Requests.

We don't look too kindly on spoonfeeding here in Coding Help. It's Coding Help, not Suggestions and Requests.
i forgot to search it was like 1 a.m when i made this

What Muffinz said.
The only bad thing is that if you have other GUI things all the client would have to do is delete everything but the
handshake. their loss though! Not sure if their is any way to protect that.
Someone on the Garage Games forums made a TGE Compiler. You could integrate that if its THAT important


What Muffinz said.
The only bad thing is that if you have other GUI things all the client would have to do is delete everything but the
handshake. their loss though! Not sure if their is any way to protect that.
There is no way to prevent that. Even if you compile your script as a dso - guess what, then someone is going to decompile it!

However, it doesn't matter as long as you follow rule 1: never trust the client. The GUI should represent the data sent by the server and send input to the server and nothing else. If the client removes the gui, it's his own problem!

There is no way to prevent that. Even if you compile your script as a dso - guess what, then someone is going to decompile it!

However, it doesn't matter as long as you follow rule 1: never trust the client. The GUI should represent the data sent by the server and send input to the server and nothing else. If the client removes the gui, it's his own problem!
This man knows what he is doing   :cookie: