keybinds forNexgen add 3 keybinds : inventorynext , inventoryprevious , inventoryactivate

Discussions about Coding and Scripting
Letylove49
Adept
Posts: 291
Joined: Tue Feb 28, 2012 7:47 pm
Personal rank: admin Alicia Server
Location: suisse

keybinds forNexgen add 3 keybinds : inventorynext , inventoryprevious , inventoryactivate

Post by Letylove49 »

i need help please for add 3 keybind, i have try alone but that don't work and i don't understand why .

Code: Select all

 in class : NexgenCPKeyBind
 /***************************************************************************************************
 *
 *  $DESCRIPTION  Creates the contents of the panel.
 *  $OVERRIDE
 *
 **************************************************************************************************/
function setContent() {
	local int index;	
	
	// Create layout & add components.
	setAcceptsFocus();
	createPanelRootRegion();
	splitRegionH(30);
	
	addLabel(client.lng.keyBindsTxt, true, TA_Center);
	divideRegionV(2);
	divideRegionH(arrayCount(bindButton));
	divideRegionH(arrayCount(bindButton));
	
	addLabel(client.lng.balanceBindTxt);
	addLabel(client.lng.switchRedBindTxt);
	addLabel(client.lng.switchBlueBindTxt);
	addLabel(client.lng.switchGreenBindTxt);
	addLabel(client.lng.switchGoldBindTxt);
	addLabel(client.lng.suicideBindTxt);
	addLabel(client.lng.openMapVoteBindTxt);
	addLabel(client.lng.openCPBindTxt);
	addLabel(client.lng.pauseGameBindTxt);
	addLabel(client.lng.InventoryNextBindTxt);
	addLabel(client.lng.inventorypreviousBindTxt);
	addLabel(client.lng.inventoryactivateBindTxt);
	
	for (index = 0; index < arrayCount(bindButton); index++) {
		bindButton[index] = addRaisedButton();
		bindButton[index].align = TA_Center;
		bindButton[index].bAcceptsFocus = false;
		bindButton[index].bIgnoreLDoubleClick = true;
		bindButton[index].bIgnoreMDoubleClick = true;
		bindButton[index].bIgnoreRDoubleClick = true;
		bindButton[index].index = index;
		bindButton[index].register(self);
	}
	
	loadKeyBinds();
}

/***************************************************************************************************
 *
 *  $DESCRIPTION  Default properties block.
 *
 **************************************************************************************************/

defaultproperties
{
     bindCommand(0)="mutate nsc balanceteams"
     bindCommand(1)="mutate nsc setteam 0"
     bindCommand(2)="mutate nsc setteam 1"
     bindCommand(3)="mutate nsc setteam 2"
     bindCommand(4)="mutate nsc setteam 3"
     bindCommand(5)="suicide"
     bindCommand(6)="mutate nsc openvote,mutate hz010"
     bindCommand(7)="mutate nsc openrcp,mutate asc#get#window,mutate hz0090"
     bindCommand(8)="mutate nsc pause"
     bindCommand(9)="mutate nsc inventorynext"
     bindCommand(10)="mutate nsc inventoryprevious"
     bindCommand(11)="mutate nsc inventoryactivate"



}
In classs Nexgencontroller :

Code: Select all

// Nexgen commands.
const CMD_Prefix       = "NSC";
const CMD_SwitchTeam   = "SETTEAM";
const CMD_BalanceTeams = "BALANCETEAMS";
const CMD_Play         = "PLAY";
const CMD_Spectate     = "SPECTATE";
const CMD_StartGame    = "START";
const CMD_Exit         = "EXIT";
const CMD_Disconnect   = "DISCONNECT";
const CMD_Open         = "OPENRCP";
const CMD_OpenVote     = "OPENVOTE";
const CMD_Pause        = "PAUSE";
const CMD_InventoryNext    ="InventoryNext";
const CMD_InventoryPrevious ="InventoryPrevious";
const CMD_InventoryActivate ="InventoryActivate"; 
in class Nexgenclient

Code: Select all

 const InventoryNextCommand = " mutate NSC InventoryNext ";        // Console command for next inventory.
const InventoryPreviousCommand = " mutate NSC InventoryPrevious";    // Console command for previous inventory.
const InventoryActivateCommand = " mutate NSC InventoryActivate";  // Console command for Preview inventory.
Image

Letylove49 aka Alicia