请选择 进入手机版 | 继续访问电脑版

 找回密码
 点一下
查看: 1650|回复: 6

麻烦帮修改下这个JASS的一个细节

[复制链接]
发表于 2010-3-10 20:00:34 | 显示全部楼层 |阅读模式
///////////////////////////////////////////////////////////////////////
///  请添加下列变量
///////////////////////////////////////////////////////////////////////
//globals
//    unit        udg_FWG_UNIT    = null
//{{ 修改这里
//    // 设置反外挂自动检测时间间隔
//    real        udg_FWG_TIME    = 1
//    // 不要在其他地方使用这个单位类型
//    // 单位类型满足下列要求
//    // 不能移动,没有视野,无敌, 没有模型
//    integer     udg_FWG_UID     = 'H000'
//    // 将 FWG_LOC_X, FWG_LOC_Y 修改成在你的地图中
//    // 整个游戏过程中任何玩家都不能拥有视野的点的坐标
//    real        udg_FWG_LOC_X   = 0
//    real        udg_FWG_LOC_Y   = 0
////}}
//endglobals
///////////////////////////////////////////////////////////////////////
function FWG_Hide takes boolean b returns nothing
    if b then
        call ShowInterface(false , 0)
        call EnableUserUI(false)
        call SetCineFilterTexture("ReplaceableTextures\\CameraMasks\\Black_mask.blp")
        call SetCineFilterBlendMode(BLEND_MODE_BLEND)
        call SetCineFilterTexMapFlags(TEXMAP_FLAG_NONE)
        call SetCineFilterStartUV(0 , 0 , 1 , 1)
        call SetCineFilterEndUV(0 , 0 , 1 , 1)
        call SetCineFilterStartColor(0 , 0 , 0 , 255)
        call SetCineFilterEndColor(0 , 0 , 0 , 255)
        call SetCineFilterDuration(0)
        call DisplayCineFilter(true)
    else            
        call DisplayCineFilter(false)
        call EnableUserUI(true)
        call ShowInterface(true , 0.01)
    endif
endfunction
function FWG_Kick takes player p returns nothing
    call BJDebugMsg("|cFFFF0000英雄"+I2S(GetPlayerId(p))+" 正在作弊!|r")
    call TriggerSleepAction(5.0)
endfunction
function FWG_Seek takes nothing returns nothing
    local integer uid = udg_FWG_UID
    local unit u = udg_FWG_UNIT
    local player p = GetTriggerPlayer()
    if GetUnitTypeId(GetTriggerUnit()) == uid then
        if GetTriggerEventId() == EVENT_PLAYER_UNIT_SELECTED  then
            call FWG_Kick(p)
            if GetLocalPlayer() == p then
                call SelectUnit(u, FALSE)
            endif
        elseif GetTriggerEventId() == EVENT_PLAYER_UNIT_DESELECTED  then
            if GetLocalPlayer() == p then
                call FWG_Hide(false)
            endif
        endif
    endif
endfunction
function FWG_Core takes nothing returns nothing
    local lightning ltn = null
//{{Import Global var
    local real x = udg_FWG_LOC_X
    local real y = udg_FWG_LOC_Y
    local unit u = udg_FWG_UNIT
//}}
    //TRUE参数表示检查可见性后再创建,如果不可见则不会创建Lightning.
    set ltn = AddLightning("CLPB" , TRUE , x , y , x , y)
    if ltn != null then
    //只有作弊的玩家可以执行到,所以不需要 GetLocalPlayer()==Player(i)
        call DestroyLightning(ltn)
        call FWG_Hide(TRUE)
        call SelectUnit(u, TRUE)
    endif
endfunction
function InitTrig_FWG takes nothing returns nothing
    local integer i = 0
    local real x = udg_FWG_LOC_X
    local real y = udg_FWG_LOC_Y
    local real t = udg_FWG_TIME
    local integer uid = udg_FWG_UID
    local integer i = 0
    set udg_FWG_UNIT = CreateUnit(Player(13),uid,x,y,0)
    set gg_trg_FWG = CreateTrigger()
    loop
        exitwhen i > 11
        call TriggerRegisterPlayerUnitEvent(gg_trg_FWG, Player(i) , EVENT_PLAYER_UNIT_SELECTED, null)
        call TriggerRegisterPlayerUnitEvent(gg_trg_FWG, Player(i) , EVENT_PLAYER_UNIT_DESELECTED, null)
        set i = i + 1
    endloop
    call TriggerAddAction(gg_trg_FWG, function FWG_Seek)
    set gg_trg_FWG = CreateTrigger()
    call TriggerRegisterTimerEvent(gg_trg_FWG, t, TRUE)
    call TriggerAddAction(gg_trg_FWG, function FWG_Core)
endfunction




以上是个反作弊的JASS,我自己不懂得JASS,所以修改上很难。麻烦高手帮我吧其中    call BJDebugMsg("|cFFFF0000英雄"+I2S(GetPlayerId(p))+" 正在作弊!|r")  这里改成T效果中   【英雄 +(玩家名字)+正在作弊】的效果,现在这个无论是哪个玩家作弊,系统提示是 【英雄0正在作弊】,貌似判断不出玩家几,所以求助于大家,先谢谢了。
发表于 2010-3-11 01:08:39 | 显示全部楼层
表示没有研究
回复

使用道具 举报

发表于 2010-3-11 02:04:20 | 显示全部楼层
[jass]call BJDebugMsg("|cFFFF0000英雄"+GetPlayerName(p)+" 正在作弊!|r") [/jass]
回复

使用道具 举报

发表于 2010-3-11 10:47:24 | 显示全部楼层
英雄编号变成英雄名字了[s:198]
回复

使用道具 举报

 楼主| 发表于 2010-3-11 12:50:57 | 显示全部楼层

回 2楼(按下esc键) 的帖子

非常感谢。

但遇到一个问题,文字显示时间太久,能否再帮修改一下持续时间为1秒。

另外想请教一下怎么设置JASS触发的关闭与打开?
因为地图里有全知药水和透视眼的技能,会与这个系统造成冲突,所以再使用技能时暂时关闭该系统,求教一下怎么弄关闭或打开,感激不尽。
回复

使用道具 举报

发表于 2010-3-11 13:26:17 | 显示全部楼层
[codes=jass]function BJDebugMsg takes string msg returns nothing
    local integer i = 0
    loop
        call DisplayTimedTextToPlayer(Player(i),0,0,60,msg)
        set i = i + 1
        exitwhen i == bj_MAX_PLAYERS
    endloop
endfunction[/codes]

也就是说显示时间是60秒,自己写个函数替换掉吧
回复

使用道具 举报

 楼主| 发表于 2010-3-12 12:45:04 | 显示全部楼层
非常感谢
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 点一下

本版积分规则

Archiver|移动端|小黑屋|地精研究院

GMT+8, 2024-3-29 08:29 , Processed in 0.133050 second(s), 18 queries .

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表