非常簡單的問題,我剛剛忘記了正確的編碼。我設置了一個空白,並且我希望它在單擊按鈕時運行。激活按鈕上的無效按
虛空我想執行:
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
}
'giveWeapon'與'button14_Click'屬於同一類嗎? –
它在同一班,是 – Matt
爲什麼你很難打電話給它? – codingbiz