Recent posts

#92
Support / Re: sending command via client...
Last post by MEGAMIND - Oct 30, 2024, 05:22 PM
solved thanks to @umar4911
#93
Scripting and Server Management / Re: Remove Flags
Last post by MEGAMIND - Oct 30, 2024, 04:58 PM
#94
Scripting and Server Management / Re: Remove Flags
Last post by GasanZ07 - Oct 30, 2024, 04:53 PM
Quote from: umar4911 on Oct 30, 2024, 03:53 PMYou cannot remove that afaik. You would need to make a custom class selector.
How to ?
#95
Scripting and Server Management / Re: Remove Flags
Last post by GasanZ07 - Oct 30, 2024, 04:52 PM
Quote from: habi2 on Oct 30, 2024, 10:28 AMIt is built-in. Only way to remove is manually creating a duplicate screen.
Camera will be set, arrow keys be checked, freezing player, changing skin when arrow is pressed.
Do you understand what i am saying?

Got it, dude, thank you
#96
Support / Re: sending command via client...
Last post by MEGAMIND - Oct 30, 2024, 04:43 PM
Quote from: habi2 on Oct 30, 2024, 04:41 PMHi @MEGAMIND, i did not quite understand what you are trying to achieve.
Quotem <- BindKey(true,0x4D,0,0); //gamemodes

function onClientScriptData(player) {
     local type = Stream.ReadInt();
if (type == 302) {
        Stream.StartWrite();
        Stream.WriteInt(302);
        Stream.SendStream(player);
    }
if (type == 303) {
     Stream.ReadInt(303);
    MessagePlayer("u r in drift", player);
    onPlayerCommand(player , "drift", "");
  }
}
Here you are binding key M (virtual key code 0x4d=77, https://asawicki.info/nosense/doc/devices/keyboard/key_codes.html ).
Then you are checking the integer passed from client equals 302 or 303. If it is 303, /drift is processed and message is send to player You are in drift.
So I think the client press M and drift starts. Is that it?
actually what i a mdoing is pressing m then a sprite apears with which on sprite click i can execcute a command such as drift, yes that is what it is as u said, but its still not executing the cmd, the client presses m a sprite apears the client presses the sprite adn then the sprite is disappeared and the client goes to drift
#97
Support / Re: sending command via client...
Last post by habi2 - Oct 30, 2024, 04:41 PM
Hi @MEGAMIND, i did not quite understand what you are trying to achieve.
Quotem <- BindKey(true,0x4D,0,0); //gamemodes

function onClientScriptData(player) {
     local type = Stream.ReadInt();
if (type == 302) {
        Stream.StartWrite();
        Stream.WriteInt(302);
        Stream.SendStream(player);
    }
if (type == 303) {
     Stream.ReadInt(303);
    MessagePlayer("u r in drift", player);
    onPlayerCommand(player , "drift", "");
  }
}
Here you are binding key M (virtual key code 0x4d=77, https://asawicki.info/nosense/doc/devices/keyboard/key_codes.html ).
Then you are checking the integer passed from client equals 302 or 303. If it is 303, /drift is processed and message is send to player You are in drift.
So I think the client press M and drift starts. Is that it?
#98
Scripting and Server Management / Re: Remove Flags
Last post by umar4911 - Oct 30, 2024, 03:53 PM
You cannot remove that afaik. You would need to make a custom class selector.
#99
Support / sending command via client sid...
Last post by MEGAMIND - Oct 30, 2024, 12:07 PM
Sup everyone actually i am trying to achive send command from client side scripting

what ive tried so far

server side
m <- BindKey(true,0x4D,0,0); //gamemodes

function onClientScriptData(player) {
     local type = Stream.ReadInt();
if (type == 302) {
        Stream.StartWrite();
        Stream.WriteInt(302);
        Stream.SendStream(player);
    }
if (type == 303) {
     Stream.ReadInt(303);
    MessagePlayer("u r in drift", player);
    onPlayerCommand(player , "drift", "");
  }
}

functions
function onKeyDown(player,key)
{
if( key == m )
{
if(player.World == 1)
      {
       Stream.StartWrite();
        Stream.WriteInt(302);
        Stream.SendStream(player);
}
}
}

client side
function Server::ServerData(stream) {
    local StreamReadInt = stream.ReadInt();
    local StreamReadString = stream.ReadString();

    switch (StreamReadInt.tointeger()) {
             case 302:
            GUI.SetMouseEnabled(true);
            ::spritedrift <- GUIButton(VectorScreen(400,380), VectorScreen(200, 22), Colour(75,75,75), "drift", GUI_FLAG_BORDER | GUI_FLAG_VISIBLE);
            //::spritedrift <- GUISprite("drift.png", VectorScreen(1000, 600));
            //::spritedrift.Size = VectorScreen(50, 50);
            break;
           
           
    }
}



function GUI::ElementClick(element, mousex, mousey)
{
  GUI_ServerLogs.ElementClick( element );
  if (element == spritedrift) {
   Console.Print("Hello. welcome to VCMP")
    local message = Stream();
    message.WriteInt(303);
    Server.SendData(message);
    GUI.SetMouseEnabled(false);
    ::spritedrift <- null;

  }
}
aim is to click a sprite that executes drift command

@habi2 @vito
#100
Community Plugins / Re: Remote Exec - An alternati...
Last post by habi2 - Oct 30, 2024, 10:49 AM
Hi PSL, it is a great idea to get values from another client.
I will check if there is any standard way of doing it and modify code.