廣告廣告
  加入我的最愛 設為首頁 風格修改
首頁 首尾
 手機版   訂閱   地圖  簡體 
您是第 4673 個閱讀者
 
<<   1   2  下頁 >>(共 2 頁)
發表文章 發表投票 回覆文章
  可列印版   加為IE收藏   收藏主題   上一主題 | 下一主題   
n5427114 會員卡
個人文章 個人相簿 個人日記 個人地圖
小有名氣
級別: 小有名氣 該用戶目前不上站
推文 x0 鮮花 x7
分享: 轉寄此文章 Facebook Plurk Twitter 複製連結到剪貼簿 轉換為繁體 轉換為簡體 載入圖片
推文 x0
[1.6][插件] 清除地上武器寫法?
請問清除地上武器寫法怎麼寫?

#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <xs>
#include <fakemeta>


new cvar_removedropped


public plugin_init()
{
    register_plugin("remove_dropper","1.0beta","Anniversary04")
  register_forward(FM_SetModel, "fw_SetModel"
   cvar_removedropped = register_cvar("remove_dropped", "15.0")
}


public fw_SetModel(entity, const model[])
{
  if (strlen(model) < 8)
    return;
 
  if (get_pcvar_float(cvar_removedropped) > 0.0)
  {    
    static classname[10]
    pev(entity, pev_classname, classname, charsmax(classname))
   
    if (equal(classname, "weaponbox"))
    set_pev(entity, pev_nextthink, get_gametime() + get_pcvar_float(cvar_removedropped))
  }
}

冒似寫會無法反編, 而且地上C4好像會被清到..

有辦法分主武一個時間,小槍一個時間清除嗎?



獻花 x0 回到頂端 [樓 主] From:臺灣中華電信股份有限公司 | Posted:2014-07-26 22:39 |
op47 0
個人文章 個人相簿 個人日記 個人地圖
初露鋒芒
級別: 初露鋒芒 該用戶目前不上站
推文 x54 鮮花 x128
分享: 轉寄此文章 Facebook Plurk Twitter 複製連結到剪貼簿 轉換為繁體 轉換為簡體 載入圖片

下面是引用 n5427114 於 2014-07-26 22:39 發表的 清除地上武器寫法?: 到引言文
請問清除地上武器寫法怎麼寫?
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <xs>
.......



FM_SetModel 有帶 const model[] 的變量, 自己用模組名判斷就行


獻花 x0 回到頂端 [1 樓] From:香港特別行政區 | Posted:2014-07-27 16:21 |
n5427114 會員卡
個人文章 個人相簿 個人日記 個人地圖
小有名氣
級別: 小有名氣 該用戶目前不上站
推文 x0 鮮花 x7
分享: 轉寄此文章 Facebook Plurk Twitter 複製連結到剪貼簿 轉換為繁體 轉換為簡體 載入圖片

上面這段沒有辦法正編...


獻花 x0 回到頂端 [2 樓] From:臺灣中華電信股份有限公司 | Posted:2014-07-27 22:03 |
op47 0
個人文章 個人相簿 個人日記 個人地圖
初露鋒芒
級別: 初露鋒芒 該用戶目前不上站
推文 x54 鮮花 x128
分享: 轉寄此文章 Facebook Plurk Twitter 複製連結到剪貼簿 轉換為繁體 轉換為簡體 載入圖片

register_forward(FM_SetModel, "fw_SetModel"
register_forward(FM_SetModel, "fw_SetModel")


獻花 x0 回到頂端 [3 樓] From:香港特別行政區 | Posted:2014-07-27 22:55 |
n5427114 會員卡
個人文章 個人相簿 個人日記 個人地圖
小有名氣
級別: 小有名氣 該用戶目前不上站
推文 x0 鮮花 x7
分享: 轉寄此文章 Facebook Plurk Twitter 複製連結到剪貼簿 轉換為繁體 轉換為簡體 載入圖片

 不是這個問題。


獻花 x0 回到頂端 [4 樓] From:臺灣中華電信股份有限公司 | Posted:2014-07-28 13:21 |
op47 0
個人文章 個人相簿 個人日記 個人地圖
初露鋒芒
級別: 初露鋒芒 該用戶目前不上站
推文 x54 鮮花 x128
分享: 轉寄此文章 Facebook Plurk Twitter 複製連結到剪貼簿 轉換為繁體 轉換為簡體 載入圖片

下面是引用 n5427114 於 2014-07-28 13:21 發表的 : 到引言文
 不是這個問題。

是你sma格式的問題(SMA 換行問題) , 也許你是C&P, 不過我想你也最好參考這個段落:
Indentation, Tabbing and Spacing

Tabbing should always be done whenever you open a code block (which will be discussed more in detail later). A standard tab is either done using the "Tab" key or using 4 spaces. Less commonly, people use 1, 3 or 8 spaces for their tabs, but this is very rare and generally frowned upon. Almost everyone uses the "Tab" key because then other people can set their tab-size higher or lower in their text editors.

There are also many styles of spacing, but I believe the best (despite my not using it personally) is to add a space whenever you put a parameter in brackets, after a comma, immediately after a condition/loop keyword and before/after any operators which take two parameters on the left and right. For example:



if ( !cmd_accessidlevelcid ) )  
... or...


for ( new i10i++ )  
This allows you to easily distinguish functions from conditions/loops and also allows you to easily pick out parameters, operators, etc.

This is by no means standard and is highly up for debate, but to me this makes the most logical sense and is what I would use if I had the option of immediately wiping my habits and picking a new set of them. I would, however, advise you to always add spaces between operators with two parameters and after commas.

You may also consider adding two carriage returns as opposed to one between functions as it may make them easier to read. This is by no means a convention but I recommend it personally.


ACC. TO: https://forums.alliedmods.net...php?t=85274


獻花 x0 回到頂端 [5 樓] From:香港特別行政區 | Posted:2014-07-28 13:50 |
岳岳 手機
個人文章 個人相簿 個人日記 個人地圖
初露鋒芒
級別: 初露鋒芒 該用戶目前不上站
推文 x0 鮮花 x67
分享: 轉寄此文章 Facebook Plurk Twitter 複製連結到剪貼簿 轉換為繁體 轉換為簡體 載入圖片

下面是引用 n5427114 於 2014-07-28 13:21 發表的 : 到引言文
 不是這個問題。



少個誇號就會不能編譯了.....少一個差很多


可以的話最好也把編譯錯誤的訊息貼上來





By Yue
獻花 x0 回到頂端 [6 樓] From:未知地址 | Posted:2014-07-28 13:50 |
n5427114 會員卡
個人文章 個人相簿 個人日記 個人地圖
小有名氣
級別: 小有名氣 該用戶目前不上站
推文 x0 鮮花 x7
分享: 轉寄此文章 Facebook Plurk Twitter 複製連結到剪貼簿 轉換為繁體 轉換為簡體 載入圖片

error 029 invalid expression assumed zero

那個刮號只是沒複製上去,插件內沒有這個問題


獻花 x0 回到頂端 [7 樓] From:臺灣中華電信股份有限公司 | Posted:2014-07-28 19:39 |
n5427114 會員卡
個人文章 個人相簿 個人日記 個人地圖
小有名氣
級別: 小有名氣 該用戶目前不上站
推文 x0 鮮花 x7
分享: 轉寄此文章 Facebook Plurk Twitter 複製連結到剪貼簿 轉換為繁體 轉換為簡體 載入圖片

#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <xs>
#include <fakemeta>
#include <fun>
#include <engine>
#include <hamsandwich>

const HideWeapon_Flags = 1
new cvar_removedropped
new g_time[33]

public plugin_init()
{
       register_plugin("amx_respawn","2.0beta","Tonyyoung")
    register_forward(FM_SetModel, "fw_SetModel")
    RegisterHam(Ham_Spawn, "player", "fw_Spawn_Post", 1)
       cvar_removedropped = register_cvar("remove_dropped", "15.0")
}

public fw_Spawn_Post(id)
{
    if (is_user_alive(id) && is_user_connected(id))
    {
        cs_set_user_money(id, cs_get_user_money(id) + 500)
    }
}

public fw_SetModel(entity, const model[])
{
    if (!pev_valid(entity)) return FMRES_IGNORED
    
    if (strlen(model) < 8) return FMRES_IGNORED;
    
    new ent_classname[32]
    pev(entity, pev_classname, ent_classname, charsmax(ent_classname))
    if (equal(ent_classname, "weaponbox"))
    {
        set_pev(entity, pev_nextthink, get_gametime() + g_weapons_stay)
        return FMRES_IGNORED
    }
    return FMRES_IGNORED
}

sma 在下面


獻花 x0 回到頂端 [8 樓] From:臺灣中華電信股份有限公司 | Posted:2014-07-28 19:45 |
n5427114 會員卡
個人文章 個人相簿 個人日記 個人地圖
小有名氣
級別: 小有名氣 該用戶目前不上站
推文 x0 鮮花 x7
分享: 轉寄此文章 Facebook Plurk Twitter 複製連結到剪貼簿 轉換為繁體 轉換為簡體 載入圖片

源碼在這供各位參考


本帖包含附件
zip respawn_money.rar   (2022-06-09 14:21 / 1 KB)   下載次數:5


獻花 x0 回到頂端 [9 樓] From:臺灣中華電信股份有限公司 | Posted:2014-07-28 19:47 |

<<   1   2  下頁 >>(共 2 頁)
首頁  發表文章 發表投票 回覆文章
Powered by PHPWind v1.3.6
Copyright © 2003-04 PHPWind
Processed in 0.034595 second(s),query:16 Gzip disabled
本站由 瀛睿律師事務所 擔任常年法律顧問 | 免責聲明 | 本網站已依台灣網站內容分級規定處理 | 連絡我們 | 訪客留言