[HELP] Random Item Box

Results 1 to 1 of 1
  1. #1
    Enthusiast zetoris is offline
    MemberRank
    Jul 2015 Join Date
    ThailandLocation
    29Posts

    talk [HELP] Random Item Box

    how to rollitem when open the box?
    this is my code, that drop itemid 101087 or 101002 to ground when use.
    but cant add more than 2 items.

    warz_server.sln
    Code:
    case WeaponConfig::ITEMID_LootDropPremium:
                {
                    wiInventoryItem wi;
                    wi.itemID = 101155;
                    if(wi.itemID > 0)
                    {
                        r3dPoint3D pos = GetPosition();
                        pos.y += 0.4f;
                        pos.x += u_GetRandom(-1, 1);
                        pos.z += u_GetRandom(-1, 1);
    
                        // create network object
                        obj_DroppedItem* obj = (obj_DroppedItem*)srv_CreateGameObject("obj_DroppedItem", "obj_DroppedItem", pos);
                        obj->SetNetworkID(gServerLogic.GetFreeNetId());
                        obj->NetworkLocal = true;
                        // vars
                        obj->m_Item       = wi;
                        obj->m_Item.itemID   = u_GetRandom() >= 0.75f ? 101087 : 101002;
                        obj->m_Item.quantity = 1;
                    }
                }
                break;
    sorry for bad english.




Advertisement