丟棄所有玩家的武器

Home Home
引用 | 編輯 m8966338
2013-02-24 17:28
樓主
推文 x0
strip_user_weapons()

我知道丟棄武器是這個


但是我不知道()內要輸入什麼才能丟棄進行遊戲中的玩家武器





獻花 x0
引用 | 編輯 op47
2013-02-24 19:36
1樓
  
玩家的ID

獻花 x0
引用 | 編輯 adi37545vfg
2013-02-24 19:36
2樓
  
public xxx(id)

         for(new i=0;i<32;i++)
         {
                    strip_user_weapons(i)
         }
}

因該是這樣吧....@@

獻花 x0
引用 | 編輯 觀眾甲
2013-02-24 21:29
3樓
  
建議用這個
fm_strip_user_weapons( index )
{
  new iEnt = engfunc( EngFunc_CreateNamedEntity, engfunc( EngFunc_AllocString, "player_weaponstrip" ) );

  if( !pev_valid( iEnt ) )
    return 0;

  dllfunc( DLLFunc_Spawn, iEnt );
  dllfunc( DLLFunc_Use, iEnt, index );
  engfunc( EngFunc_RemoveEntity, iEnt );

  return 1;
}
如果太多人同時用strip_user_weapons(id)有機會會over512

獻花 x0
引用 | 編輯 m8966338
2013-02-24 21:47
4樓
  
下面是引用 adi37545vfg 於 2013-02-24 19:36 發表的 : 到引言文
public xxx(id)

         for(new i=0;i<32;i++)
         {
                    strip_user_weapons(i)
         }
}

因該是這樣吧....@@



不是欸,你有測試看看嬤



下面是引用 觀眾甲 於 2013-02-24 21:29 發表的 : 到引言文
  建議用這個
fm_strip_user_weapons( index )
{
   new iEnt = engfunc( EngFunc_CreateNamedEntity, engfunc( EngFunc_AllocString, "player_weaponstrip" ) );


   if( !pev_valid( iEnt ) )
      return 0;


   dllfunc( DLLFunc_Spawn, iEnt );
   dllfunc( DLLFunc_Use, iEnt, index );
   engfunc( EngFunc_RemoveEntity, iEnt );


   return 1;
}
如果太多人同時用strip_user_weapons(id)有機會會over512


這麼慘喔0.0 源碼也夠多的
難道()裡面就無法將對象指向所有玩家嗎?
下面是引用 op47 於 2013-02-24 19:36 發表的 : 到引言文
玩家的ID
我需要所有玩家

獻花 x0
引用 | 編輯 觀眾甲
2013-02-24 23:11
5樓
  
下面是引用 m8966338 於 2013-02-24 21:47 發表的 : 到引言文




不是欸,你有測試看看嬤






這麼慘喔0.0 源碼也夠多的
難道()裡面就無法將對象指向所有玩家嗎?

我需要所有玩家

只需要將這段代碼打在插件最下面
然後直接用fm_strip_user_weapons(XX)就行
如果要指向所有玩家的話,就需要用迴圈1~32執行一次
跟上面一樣用法
for(new i=1;i<=32;i++)
{
   if(!is_user_connected(i)) continue
   if(!is_user_alive(i)) continue
   fm_strip_user_weapons(i)
}

獻花 x0
引用 | 編輯 烈Gama英仙座
2013-02-28 07:51
6樓
  
沒記錯strip_user_weapons不是""清除""玩家所有武器嗎??

怎麼會over512??

獻花 x0