Using a custom bind to give a player a inventory item?

Discuss all aspects related to modding Zandronum here.
Post Reply
User avatar
Lord_of_D:
Posts a lot
Posts: 691
Joined: Sun Aug 26, 2012 5:31 am
Location: Mexico
Contact:

Using a custom bind to give a player a inventory item?

#1

Post by Lord_of_D: » Mon Feb 01, 2016 8:29 pm

I just started a new project that i hope everyone likes and it is going pretty well, except for one thing: i need it to move by getting an "inventory item" which is supposed to be given via the common movement binds with acs, however by some reason the client always tells me that "ACS: i dont know what "x" is" and i have no idea why this happens(im using stuff from another wad as a base, and yes, im giving credit), so can somebody explain me why it happens? or give me an example of a custom bind for it:

Code: Select all

#library "BIKECONTROL"
#include "zcommon.acs"


script 522 OPEN
{
ConsoleCommand("compat_clientssendfullbuttoninfo 1");
}


//FORWARD
script 421 ENTER
{
 int buttons;

 while (TRUE)
 {
   buttons = GetPlayerInput(-1, INPUT_BUTTONS);
   
if (buttons & BT_FORWARD)
{
   GiveInventory("Accelerate", 1);
}
   delay(1);
 }
}


//BACKPEDAL
script 422 ENTER
{
 int buttons;

 while (TRUE)
 {
   buttons = GetPlayerInput(-1, INPUT_BUTTONS);
   
if (buttons & BT_BACK)
{
    GiveInventory("BackPedal", 1);
	delay(2);
	TakeInventory("BackPedal", 1);
}

   delay(2);
   TakeInventory("BackPedal", 1);
 }
}


//LEFT
script 423 ENTER
{
 int buttons;

 while (TRUE)
 {
   buttons = GetPlayerInput(-1, INPUT_BUTTONS);
   
if (buttons & BT_MOVELEFT)
{
    GiveInventory("TurnLeft", 1);
}

   delay(1);
 }
}



//RIGHT
script 424 ENTER
{
 int buttons;

 while (TRUE)
 {
   buttons = GetPlayerInput(-1, INPUT_BUTTONS);
   
if (buttons & BT_MOVERIGHT)
{
    GiveInventory("TurnRight", 1);
}

   delay(1);
 }
}
Image

User avatar
Sean
IRC Operator
Posts: 982
Joined: Thu Jan 16, 2014 9:09 pm
Location: United Kingdom
Clan: Zandronum
Clan Tag: [Za]
Contact:

RE: Using a custom bind to give a player a inventory item?

#2

Post by Sean » Mon Feb 01, 2016 8:35 pm

Make sure the items are spelt correctly and make sure the items are actually defined in DECORATE
<capodecima> i dont say any more word without my loyer jenova

Post Reply