Quote from: MEGAMIND on Oct 30, 2024, 04:58 PMQuote from: GasanZ07 on Oct 30, 2024, 04:53 PMhttps://github.com/sfwidde/vcmp-custom-class-selectorQuote from: umar4911 on Oct 30, 2024, 03:53 PMYou cannot remove that afaik. You would need to make a custom class selector.How to ?
Quote from: GasanZ07 on Oct 30, 2024, 04:53 PMhttps://github.com/sfwidde/vcmp-custom-class-selectorQuote from: umar4911 on Oct 30, 2024, 03:53 PMYou cannot remove that afaik. You would need to make a custom class selector.How to ?
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 ?
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?
Quote from: habi2 on Oct 30, 2024, 04:41 PMHi @MEGAMIND, i did not quite understand what you are trying to achieve.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 driftQuotem <- BindKey(true,0x4D,0,0); //gamemodesHere you are binding key M (virtual key code 0x4d=77, https://asawicki.info/nosense/doc/devices/keyboard/key_codes.html ).
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", "");
}
}
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?
Quotem <- BindKey(true,0x4D,0,0); //gamemodesHere you are binding key M (virtual key code 0x4d=77, https://asawicki.info/nosense/doc/devices/keyboard/key_codes.html ).
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", "");
}
}
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", "");
}
}
function onKeyDown(player,key)
{
if( key == m )
{
if(player.World == 1)
{
Stream.StartWrite();
Stream.WriteInt(302);
Stream.SendStream(player);
}
}
}
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