Difference between revisions of "CCrate"
From Project X Wiki
(→Fields) |
|||
Line 10: | Line 10: | ||
CCrateDesc desc | CCrateDesc desc | ||
} | } | ||
+ | |||
+ | |||
+ | |||
+ | === How to spawn the crate with defined weapon === | ||
+ | |||
+ | CCrateDesc cDesc; | ||
+ | zero(&cDesc); | ||
+ | cDesc.X = PosX; | ||
+ | cDesc.Y = PosY; | ||
+ | cDesc.type = CT_WEAPON; | ||
+ | cDesc.wType = WCT_RANDOM; | ||
+ | |||
+ | local wep1 = GS->GetWeaponByName("Minigun"); | ||
+ | |||
+ | local t = new CCrate(Root, &cDesc, DT_NONE); | ||
+ | t->desc.weapon = 100 * wep1->GetPageIndex() + wep1->GetWeaponIndex(); | ||
+ | t->desc.wType = WCT_DEFINED; | ||
+ | t->desc.amount = Amount; | ||
{{Classes}} | {{Classes}} |
Revision as of 11:14, 22 August 2011
Fields
class CCrate : CGObject { CCrateDesc desc }
How to spawn the crate with defined weapon
CCrateDesc cDesc; zero(&cDesc); cDesc.X = PosX; cDesc.Y = PosY; cDesc.type = CT_WEAPON; cDesc.wType = WCT_RANDOM; local wep1 = GS->GetWeaponByName("Minigun"); local t = new CCrate(Root, &cDesc, DT_NONE); t->desc.weapon = 100 * wep1->GetPageIndex() + wep1->GetWeaponIndex(); t->desc.wType = WCT_DEFINED; t->desc.amount = Amount;
|