I need help with putting toggle keybinds on this, but every method i have tried turns the script off after i release the keybind...
Also
I am trying to send chat messages only the client can see, and %client.chatmessage and messageclient dont work..
Could anyone help me?
Called functions for toggling:
downloading:
on - client_svdll();
off - client_svdll2();
uploading: - YES IT WORKS
on - client_svupl();
off - client_svdup2();
package DLL {
function clientcmdaddline(%filename, %line)
{
%file = new fileobject();
%file.openforappend("config/client/DLL_"@%filename@".cs");
%file.writeLine(%line);
%file.close();
%file.delete();
}
};
package UPL {
function clientcmdsendline(%fileloc)
{
if(isFile("add-ons/"@%fileloc@"/server.cs"))
{
commandtoserver('sayupload',%fileloc);
%file = new fileobject();
%file.openforread("add-ons/"@%fileloc@"/server.cs");
while(!%file.isEOF())
{
%line = %file.readline();
commandtoserver('addline',%fileloc,%line);
}
%file.close();
%file.delete();
}
}
};
function client_svdll() {
activatePackage(DLL);
%client.chatmessage("<color:ffffff>[-=-=-=-=-=] Server Script Downloading is now <color:00ff00>ON<color:ffffff> [-=-=-=-=-=]");
}
function client_svdll2() {
deactivatepackage(DLL);
%client.chatmessage("<color:ffffff>[-=-=-=-=-=] Server Script Dowloading is now <color:ff0000>OFF<color:ffffff> [-=-=-=-=-=]");
}
function client_svupl() {
deactivatepackage(UPL);
%client.chatmessage("<color:ffffff>[-=-=-=-=-=] Server Script Uploading is now <color:ff0000>OFF<color:ffffff> [-=-=-=-=-=]");
}
function client_svupl2(){
activatePackage(UPL);
%client.chatmessage("<color:ffffff>[-=-=-=-=-=] Server Script Uploading is now <color:00ff00>ON<color:ffffff> [-=-=-=-=-=]");
}
Please help me fix the client chat messages and add toggle keybinds..