Difference between revisions of "ScriptCore3.menu2weap"

From Soldat Community Wiki
Jump to: navigation, search
(Created page with " '''function menu2weap(Style: Byte): Byte''' Style: string that is to be converted into a number Result: conversion result ==Description== This converts a string into a n...")
 
(Examples)
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
  '''function menu2weap(Style: Byte): Byte'''
 
  '''function menu2weap(Style: Byte): Byte'''
   Style: string that is to be converted into a number
+
   Style: Position(Style) of the weapon in the [[Weapons List]]
   Result: conversion result
+
   Result: Position(Style) of the weapon in the [[TWeapon.WType]]
  
 
==Description==
 
==Description==
This converts a string into a number.
+
Translates the position of the weapon in the Weapon Menu ([[Weapons List]]) to the corresponding position of WType property of a Weapon Object - weapon in player's hands ([[TWeapon.WType]]).
  
 +
==Examples==
 +
<source lang="pascal">
 +
begin
 +
    WriteLn('menu2weap: '+inttostr(menu2weap(1))); //1
 +
    WriteLn('menu2weap: '+inttostr(menu2weap(14))); //13
 +
end.
 +
</source>
  
 
[[Category:Functions]]
 
[[Category:Functions]]

Latest revision as of 17:18, 1 May 2018

function menu2weap(Style: Byte): Byte
 Style: Position(Style) of the weapon in the Weapons List
 Result: Position(Style) of the weapon in the TWeapon.WType

Description

Translates the position of the weapon in the Weapon Menu (Weapons List) to the corresponding position of WType property of a Weapon Object - weapon in player's hands (TWeapon.WType).

Examples

begin
    WriteLn('menu2weap: '+inttostr(menu2weap(1))); //1
    WriteLn('menu2weap: '+inttostr(menu2weap(14))); //13
end.