Добавить флаг для пользования в admin_ghost

Статус
В этой теме нельзя размещать новые ответы.
Сообщения
460
Реакции
68
Помог
7 раз(а)
Всем привет. Помогите пожалуйста прикрутить сюда флаг выдачи ADMIN_IMMUNITY, а то у меня весь сервер бегает призраками) заранее спасибо.
PHP:
/******************************************************************************************************************
*  AMX Mod script.
*
*  Ghost Mode Script
*  Version 1.4
*  by Kiosk3
*  email: [email protected]
*
*  Changes In 1.4
*
*  -Changed how invisibility works, thanks to jedi's plugin, im using transparency instead of normal.
*
*  Changes In 1.3
*
*  -Added On/Off CSAY Messages
*
*  Changes In 1.2
*
*  -Fixed the speed glitch where if you have it on yourself everyone gets it
*
*  Changes In 1.1
*
*  -Changed on from ghost to amx_ghost
*  -Changed off from unghost to amx_unghost
*  -Fixed godmode, you will not lose godmode untill you hit amx_unghost
*  -Fixed speed, you will not lose speed while switching weapons
*
*  Description:
*
*  This plugin turns your admins into a ghost.
*  What it does is this, records users speed, changes it to 1000,
*  turns on godmode, and makes the person invisible.
*  When you turn it off it reverts to your old speed, ungods and makes you visible.
*  Only admins can use it, and only can use it on themselves.
*  This is great if you want to run around with a knife scaring people, or to watch for hackers
*
*  Console Commands:
*
*  amx_ghost - This turns it on. (Turns on invisibility, godmode, and speed.)
*  amx_unghost - This turns it off. (Turns off invisibility, godmode, and speed.)
*
*  Future Plans:
*
*  None.
******************************************************************************************************************/


#include <amxmodx>
#include <amxmisc>
#include <fun>

#define BPID 341219
#define MAX_TEXT_LENGTH 512
#define MAX_NAME_LENGTH 32

new Float:oldspeed[33]
new ccolor[33]
new IsGhost[33]

public changecolor(ids[]) {
new toghost = ids[0]
switch(ccolor[toghost]) {
case 0: {
set_user_rendering(toghost,kRenderFxNone,0,0,0, kRenderTransTexture,0)
ccolor[toghost] = 1
}
case 1: {
set_user_rendering(toghost,kRenderFxNone,0,0,0, kRenderTransTexture,0)
ccolor[toghost] = 2
}
case 2: {
set_user_rendering(toghost,kRenderFxNone,0,0,0, kRenderTransTexture,0)
ccolor[toghost] = 0
}
}
}

public admin_ghost(id,level,cid)
{
if (!cmd_access(id,level,cid,1))
return PLUGIN_HANDLED
new params[3]
client_print(id,print_chat,"[AMXX]: You are now a ghost")
params[0] = id
IsGhost[id] = 1
oldspeed[id] = get_user_maxspeed(id)
set_user_maxspeed(id,1000.0)
set_user_godmode(id,1)
set_user_footsteps (id , 1)
set_task(0.2, "changecolor", BPID + id, params, 2, "b")
return PLUGIN_HANDLED
}

public admin_unghost(id, level, cid)
{
if (!cmd_access(id,level,cid,1))
return PLUGIN_HANDLED
IsGhost[id] = 0
client_print(id,print_chat,"[AMXX]: You are no longer a ghost.")
set_user_maxspeed(id,oldspeed[id])
set_user_godmode(id,0)
set_user_footsteps (id , 0)
set_user_rendering(id,kRenderFxNone,255,255,255, kRenderNormal,16)
remove_task(BPID + id)
return PLUGIN_HANDLED
}

public switchweapon(id)
{
if(IsGhost[id]) set_user_maxspeed(id,1000.0)
return PLUGIN_CONTINUE
}

public round_start(id)
{
if(IsGhost[id]) set_user_godmode(id,1)
return PLUGIN_CONTINUE
}

public client_connect(id){
IsGhost[id] = 0
return PLUGIN_CONTINUE
}

public client_disconnected(id){
IsGhost[id] = 0
return PLUGIN_CONTINUE
}

public display_msg(msg[],r,g,b)
{

}

public plugin_init() {
register_plugin("Ghost Mode","1.4","Kiosk3")
register_concmd("amx_ghost","admin_ghost")
register_concmd("amx_unghost","admin_unghost")
register_event("CurWeapon","switchweapon","be")
register_event("ResetHUD", "round_start", "be")
return PLUGIN_CONTINUE
}
Мои попытки поменять не прошли успехом хотя я приблизительно знаю что нужно заменить на строке 81 и 97. Но мои познания в скриптинге слишком малы. Помогите кто сможет.
 
Сообщения
1,419
Реакции
2,509
Помог
59 раз(а)
Код:
/******************************************************************************************************************
*  AMX Mod script.
*
*  Ghost Mode Script
*  Version 1.4
*  by Kiosk3
*  email: [email protected]
*
*  Changes In 1.4
*
*  -Changed how invisibility works, thanks to jedi's plugin, im using transparency instead of normal.
*
*  Changes In 1.3
*
*  -Added On/Off CSAY Messages
*
*  Changes In 1.2
*
*  -Fixed the speed glitch where if you have it on yourself everyone gets it
*
*  Changes In 1.1
*
*  -Changed on from ghost to amx_ghost
*  -Changed off from unghost to amx_unghost
*  -Fixed godmode, you will not lose godmode untill you hit amx_unghost
*  -Fixed speed, you will not lose speed while switching weapons
*
*  Description:
*
*  This plugin turns your admins into a ghost.
*  What it does is this, records users speed, changes it to 1000,
*  turns on godmode, and makes the person invisible.
*  When you turn it off it reverts to your old speed, ungods and makes you visible.
*  Only admins can use it, and only can use it on themselves.
*  This is great if you want to run around with a knife scaring people, or to watch for hackers
*
*  Console Commands:
*
*  amx_ghost - This turns it on. (Turns on invisibility, godmode, and speed.)
*  amx_unghost - This turns it off. (Turns off invisibility, godmode, and speed.)
*
*  Future Plans:
*
*  None.
******************************************************************************************************************/


#include <amxmodx>
#include <amxmisc>
#include <fun>

#if !defined MAX_PLAYERS
    #define MAX_PLAYERS 32
#endif

#define BPID 341219

new Float:g_flOldSpeed[MAX_PLAYERS+1]
new g_iColor[MAX_PLAYERS+1]
new bool:g_bGhost[MAX_PLAYERS+1]

public plugin_init()
{
    register_plugin("Ghost Mode", "1.4", "Kiosk3")
    register_concmd("amx_ghost", "admin_ghost", ADMIN_IMMUNITY)
    register_concmd("amx_unghost", "admin_unghost", ADMIN_IMMUNITY)
    register_event("CurWeapon", "switchweapon", "be")
    register_event("ResetHUD", "round_start", "be")
}

public changecolor(ids[])
{
    new toghost = ids[0]
    switch(g_iColor[toghost])
    {
        case 0:
        {
            set_user_rendering(toghost, kRenderFxNone, 0, 0, 0, kRenderTransTexture, 0)
            g_iColor[toghost] = 1
        }
        case 1:
        {
            set_user_rendering(toghost, kRenderFxNone, 0, 0, 0, kRenderTransTexture, 0)
            g_iColor[toghost] = 2
        }
        case 2:
        {
            set_user_rendering(toghost, kRenderFxNone, 0, 0, 0, kRenderTransTexture, 0)
            g_iColor[toghost] = 0
        }
    }
}

public admin_ghost(id, level, cid)
{
    if (!cmd_access(id,level,cid,1))
        return PLUGIN_HANDLED

    new params[3]
    client_print(id, print_chat, "[AMXX]: You are now a ghost")
    params[0] = id
    g_bGhost[id] = true
    g_flOldSpeed[id] = get_user_maxspeed(id)
    set_user_maxspeed(id, 1000.0)
    set_user_godmode(id, 1)
    set_user_footsteps(id, 1)
    set_task(0.2, "changecolor", BPID + id, params, 2, "b")
    return PLUGIN_HANDLED
}

public admin_unghost(id, level, cid)
{
    if (!cmd_access(id, level, cid, 1))
        return PLUGIN_HANDLED

    g_bGhost[id] = false
    client_print(id, print_chat, "[AMXX]: You are no longer a ghost.")
    set_user_maxspeed(id, g_flOldSpeed[id])
    set_user_godmode(id, 0)
    set_user_footsteps (id, 0)
    set_user_rendering(id, kRenderFxNone, 255, 255, 255, kRenderNormal, 16)
    remove_task(BPID + id)

    return PLUGIN_HANDLED
}

public switchweapon(id) if(g_bGhost[id]) set_user_maxspeed(id, 1000.0)

public round_start(id) if(g_bGhost[id]) set_user_godmode(id,1)

public client_disconnected(id) g_bGhost[id] = false
 
Сообщения
460
Реакции
68
Помог
7 раз(а)
w0w, спасибо большое. И ещё маленький вопрос он как то отличается от того что я скинул. Вверх тормашками чтоль?
 
Сообщения
1,419
Реакции
2,509
Помог
59 раз(а)
Best777, в основном хватило бы просто ADMIN_IMMUNITY добавить в register_clcmd, а так косметические изменения просто, хотя код такой себе изначально.
 
Сообщения
460
Реакции
68
Помог
7 раз(а)
w0w, ещё раз вам большое спасибо.
Админы можно закрыть тему.
 
Сообщения
1,419
Реакции
2,509
Помог
59 раз(а)
Best777, в cmd_access файле тоже нужно поменять флаг, если там есть эта команда.
 
Статус
В этой теме нельзя размещать новые ответы.

Пользователи, просматривающие эту тему

Сейчас на форуме нет ни одного пользователя.
Сверху Снизу