Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><code>void</code> is a keyword indicating that your <strong>function</strong> <code>giveWeapon</code> does not return a value. So your correct question would be: <em>"How can I call a function?"</em></p> <p>The answer:</p> <pre><code>private void button14_Click(object sender, EventArgs e) { int clientIndex = 5; // use correct value string weaponName = "Bazooka"; // use correct value giveWeapon(clientIndex, weaponName); } </code></pre> <p>if <code>giveWeapon</code> is defined in a different class, you'd need to create an instance and call the method on that instance, i.e.:</p> <pre><code>ContainingClass instance = new ContainingClass(); instance.giveWeapon(clientIndex, weaponName); </code></pre> <hr> <p>As a side note, your code readability would benefit a lot from using <a href="http://msdn.microsoft.com/en-us/library/bb383973.aspx" rel="nofollow"><em>implicitly typed local variables</em></a>:</p> <pre><code>public void giveWeapon(int clientIndex, string weaponName) { uint guns = getWeaponId(weaponName); var options = new XDRPCExecutionOptions(XDRPCMode.Title, 0x822728F8); //Updated var info = new XDRPCArgumentInfo&lt;uint&gt;(getPlayerState(clientIndex)); var info2 = new XDRPCArgumentInfo&lt;uint&gt;(guns); // guns is already uint, why cast? var info3 = new XDRPCArgumentInfo&lt;uint&gt;(0); // same goes for 0 uint errorCode = xbCon.ExecuteRPC&lt;uint&gt;(options, new XDRPCArgumentInfo[] { info, info2, info3 }); iprintln("gave weapon: " + guns); // ToString is redundant giveAmmo(clientIndex, guns); //switchToWeapon(clientIndex, 46); } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload