非常直截了当的问题,我刚刚忘记了正确的编码。我有一个 void 设置,我希望它在我单击按钮时运行。
无效我想执行:
public void giveWeapon(int clientIndex, string weaponName)
{
uint guns = getWeaponId(weaponName);
XDRPCExecutionOptions options = new XDRPCExecutionOptions(XDRPCMode.Title, 0x822728F8); //Updated
XDRPCArgumentInfo<uint> info = new XDRPCArgumentInfo<uint>(getPlayerState(clientIndex));
XDRPCArgumentInfo<uint> info2 = new XDRPCArgumentInfo<uint>((uint)guns);
XDRPCArgumentInfo<uint> info3 = new XDRPCArgumentInfo<uint>((uint)0);
uint errorCode = xbCon.ExecuteRPC<uint>(options, new XDRPCArgumentInfo[] { info, info2, info3 });
iprintln("gave weapon: " + (guns.ToString()));
giveAmmo(clientIndex, guns);
//switchToWeapon(clientIndex, 46);
}
我只希望它在单击按钮时运行:
private void button14_Click(object sender, EventArgs e)
{
// Call void here
}