Плагин админ призрак, ghost |
Здравствуйте, гость Вход | Регистрация
Наши новости:
|
|
Плагин админ призрак, ghost |
5Kirill5 |
17.8.2010, 19:32
Сообщение
|
Есть плагин
admin_ghost Код /******************************************************************************** ********************************** * AMX Mod script. * * Ghost Mode Script * Version 1.4 * by Kiosk3 * email: GeminiMissiles@aol.com * * 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_disconnect(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",ADMIN_LEVEL_A) register_concmd("amx_unghost","admin_unghost",ADMIN_LEVEL_A) register_event("CurWeapon","switchweapon","be") register_event("ResetHUD", "round_start", "be") return PLUGIN_CONTINUE } Вводишь в консоли amx_ghost. Ты становишься бессмертным, невидимым, скорость ходьбы 1000. Только одна проблема. Когда на тебя наводят прицел, показывается твой ник. Можно как-нибудь сделать, чтобы твой ник, не показывался? Ещё сервер грешит на 64 line в плагине. Log: L 08/17/2010 - 22:47:34: [AMXX] Displaying debug trace (plugin "admin_ghost.amxx") L 08/17/2010 - 22:47:34: [AMXX] Run time error 10: native error (native "set_user_rendering") L 08/17/2010 - 22:47:34: [AMXX] [0] admin_ghost.sma::changecolor (line 64)[AMXX] Displaying debug trace (plugin "admin_ghost.amxx")
Отредактировал: 5Kirill5, - 17.8.2010, 20:59
|
|
|
|
kentavrius |
17.8.2010, 19:38
Сообщение
|
|
|
|
|
5Kirill5 |
17.8.2010, 19:41
Сообщение
|
И топаешь как слон.. Забыл написать, что он не топает... footsteps 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 }
Отредактировал: 5Kirill5, - 17.8.2010, 19:46
|
|
Поблагодарили 1 раз
|
|
AndrewZ |
18.8.2010, 8:42
Сообщение
|
|
L 08/17/2010 - 22:47:34: [AMXX] Displaying debug trace (plugin "admin_ghost.amxx")
L 08/17/2010 - 22:47:34: [AMXX] Run time error 10: native error (native "set_user_rendering") L 08/17/2010 - 22:47:34: [AMXX] [0] admin_ghost.sma::changecolor (line 64)[AMXX] Displaying debug trace (plugin "admin_ghost.amxx") Наверно не подружился с каким-то плагином, у меня все норм было. |
|
|
5Kirill5 |
18.8.2010, 12:45
Сообщение
|
L 08/17/2010 - 22:47:34: [AMXX] Displaying debug trace (plugin "admin_ghost.amxx") L 08/17/2010 - 22:47:34: [AMXX] Run time error 10: native error (native "set_user_rendering") L 08/17/2010 - 22:47:34: [AMXX] [0] admin_ghost.sma::changecolor (line 64)[AMXX] Displaying debug trace (plugin "admin_ghost.amxx") Наверно не подружился с каким-то плагином, у меня все норм было. Я обошёл эту ошибку, написав новый плагин. Но проблема с показом ника осталась. |
|
|
|
5Kirill5 |
18.8.2010, 13:25
Сообщение
|
Будут какие-нибудь предложения по нику?
|
|
|
|
STR@TEG |
18.8.2010, 16:07
Сообщение
|
|
|
5Kirill5 |
18.8.2010, 19:39
Сообщение
|
Посмотри в miscstats.sma функцию показа ника в виде HUD-сообщения и попробуй отредактировать ее под себя. Если это, конечно, поможет. Не, это другое. Мне надо чтобы он не показывал имя, которое не плагины выводят на экран, а сервер. Есть переменная в server.cfg. mp_playerid - эта переменная управляет тем, что видят игроки, когда они помещают свое перекрестие по врагу, заложнику, или товарищу по команде: 0 все имена; 1 только имена игроков своей команды; 2 без имён. Вот надо сделать, чтобы при помещении перекрестия на меня, вместо исполнения команды mp_playerid 0 или mp_playerid 1, исполнял команду mp_playerid 2.
Отредактировал: 5Kirill5, - 18.8.2010, 19:45
|
|
|
|
STR@TEG |
18.8.2010, 20:26
Сообщение
|
Не, это другое. Мне надо чтобы он не показывал имя, которое не плагины выводят на экран, а сервер. Я имел в виду изменить ту функцию под свои нужды.Вот надо сделать, чтобы при помещении перекрестия на меня, вместо исполнения команды mp_playerid 0 или mp_playerid 1, исполнял команду mp_playerid 2. Если это можно сделать для определенного игрока, то я не знаю как. Поищи похожие плагины и посмотри принцип работы этой функции в них.
|
|
|
|
5Kirill5 |
18.8.2010, 21:03
Сообщение
|
Вот Я накопал что-то, посмотрите, пожалуйста, и скажите оно или нет.
cl_solid_players 0 Код #include <ApolloRP> #include <amxmodx> #include <amxmisc> #include <engine> #include <tsx> #include <engine_stocks> #include <fun> #include <tsfun> #include <tsxaddon> // Defines #define PLUGIN "No Playernames" #define VERSION "x.1" #define AUTHOR "Shin Lee" public plugin_init() { // Register Plugin register_plugin(PLUGIN, VERSION, AUTHOR); //tasks set_task(2.0,"remove_names",0,"",0,"b") } public client_disconnect(id) { client_cmd(id,"cl_solid_players 1") return PLUGIN_HANDLED } public remove_names(id) // enforces cl_solid_players 0 on the player { new players[32],num get_players(players,num,"ac") for( new i = 0; i < num; i++ ) { client_cmd(players[i],"cl_solid_players 0") } return PLUGIN_HANDLED; } Второй плагин Код ##include <amxmodx> #include <fakemeta> #define PLUGIN "Status Value Blocking" #define VERSION "1.0" #define AUTHOR "hlstriker" #define MAX_PLAYERS 32 new g_hStatusValue; new g_iBlockPlayer[MAX_PLAYERS+1]; public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR); register_clcmd("say /test", "TestFunc"); g_hStatusValue = get_user_msgid("StatusValue"); register_message(g_hStatusValue, "msg_StatusValue"); } public client_authorized(iClient) g_iBlockPlayer[iClient] = 0; public TestFunc(iClient) { if(g_iBlockPlayer[iClient]) g_iBlockPlayer[iClient] = 0; else { static iTarget, iBody; get_user_aiming(iClient, iTarget, iBody); if(is_user_alive(iTarget)) { // Set the block variable to the player you want to block g_iBlockPlayer[iClient] = iTarget; // Send the ClearStatusValue function when starting the block, // This way it removes the text incase you are already looking at someone. ClearStatusValue(iClient); } else client_print(iClient, print_chat, "[Error] Please aim at a player."); } } public msg_StatusValue(iMsgID, iDest, iClient) { // Check to see if player is blocking view of someone if(g_iBlockPlayer[iClient] > 0) { static iFlag, iValue; iFlag = get_msg_arg_int(1); iValue = get_msg_arg_int(2); // Check if client ID is equal to the player you are blocking if(iFlag == 2 && iValue == g_iBlockPlayer[iClient]) { // Call the ClearStatusValue function to remove the text. // We can't block it directly here since this message is sent 3 times, // it won't fully block the text. And because only flag 2 has the client ID // we must resend all 3 messages just to clear the text (stupid, I know). ClearStatusValue(iClient); } } return PLUGIN_CONTINUE; } public ClearStatusValue(iClient) { // All 3 of these messages have to be resent with a value of 0 message_begin(MSG_ONE_UNRELIABLE, g_hStatusValue, _, iClient); write_byte(1); write_short(0); message_end(); message_begin(MSG_ONE_UNRELIABLE, g_hStatusValue, _, iClient); write_byte(2); write_short(0); message_end(); message_begin(MSG_ONE_UNRELIABLE, g_hStatusValue, _, iClient); write_byte(3); write_short(0); message_end(); }
Отредактировал: 5Kirill5, - 18.8.2010, 21:13
|
|
|
|
STR@TEG |
18.8.2010, 21:24
Сообщение
|
Вот Я накопал что-то, посмотрите, пожалуйста, и скажите оно или нет. Попробовал я поиграть с cl_solid_players 0, ничего не заметил, имена на месте. Второй плагин пока не смотрел.
cl_solid_players 0 Код #include <ApolloRP> #include <amxmodx> #include <amxmisc> #include <engine> #include <tsx> #include <engine_stocks> #include <fun> #include <tsfun> #include <tsxaddon> // Defines #define PLUGIN "No Playernames" #define VERSION "x.1" #define AUTHOR "Shin Lee" public plugin_init() { // Register Plugin register_plugin(PLUGIN, VERSION, AUTHOR); //tasks set_task(2.0,"remove_names",0,"",0,"b") } public client_disconnect(id) { client_cmd(id,"cl_solid_players 1") return PLUGIN_HANDLED } public remove_names(id) // enforces cl_solid_players 0 on the player { new players[32],num get_players(players,num,"ac") for( new i = 0; i < num; i++ ) { client_cmd(players[i],"cl_solid_players 0") } return PLUGIN_HANDLED; } Второй плагин Код ##include <amxmodx> #include <fakemeta> #define PLUGIN "Status Value Blocking" #define VERSION "1.0" #define AUTHOR "hlstriker" #define MAX_PLAYERS 32 new g_hStatusValue; new g_iBlockPlayer[MAX_PLAYERS+1]; public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR); register_clcmd("say /test", "TestFunc"); g_hStatusValue = get_user_msgid("StatusValue"); register_message(g_hStatusValue, "msg_StatusValue"); } public client_authorized(iClient) g_iBlockPlayer[iClient] = 0; public TestFunc(iClient) { if(g_iBlockPlayer[iClient]) g_iBlockPlayer[iClient] = 0; else { static iTarget, iBody; get_user_aiming(iClient, iTarget, iBody); if(is_user_alive(iTarget)) { // Set the block variable to the player you want to block g_iBlockPlayer[iClient] = iTarget; // Send the ClearStatusValue function when starting the block, // This way it removes the text incase you are already looking at someone. ClearStatusValue(iClient); } else client_print(iClient, print_chat, "[Error] Please aim at a player."); } } public msg_StatusValue(iMsgID, iDest, iClient) { // Check to see if player is blocking view of someone if(g_iBlockPlayer[iClient] > 0) { static iFlag, iValue; iFlag = get_msg_arg_int(1); iValue = get_msg_arg_int(2); // Check if client ID is equal to the player you are blocking if(iFlag == 2 && iValue == g_iBlockPlayer[iClient]) { // Call the ClearStatusValue function to remove the text. // We can't block it directly here since this message is sent 3 times, // it won't fully block the text. And because only flag 2 has the client ID // we must resend all 3 messages just to clear the text (stupid, I know). ClearStatusValue(iClient); } } return PLUGIN_CONTINUE; } public ClearStatusValue(iClient) { // All 3 of these messages have to be resent with a value of 0 message_begin(MSG_ONE_UNRELIABLE, g_hStatusValue, _, iClient); write_byte(1); write_short(0); message_end(); message_begin(MSG_ONE_UNRELIABLE, g_hStatusValue, _, iClient); write_byte(2); write_short(0); message_end(); message_begin(MSG_ONE_UNRELIABLE, g_hStatusValue, _, iClient); write_byte(3); write_short(0); message_end(); } |
|
|
|
5Kirill5 |
18.8.2010, 22:28
Сообщение
|
Вот этот плаг рабочий
say /test Код #include <amxmodx> #define PLUGIN "Status Value Blocking" #define VERSION "2.0" #define AUTHOR "hlstriker" #define MAX_PLAYERS 32 new g_hStatusValue; new g_iBlockPlayer[MAX_PLAYERS+1]; public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR); register_clcmd("say /test", "TestFunc"); g_hStatusValue = get_user_msgid("StatusValue"); register_event("StatusValue", "event_StatusValue", "be", "1=2", "2>0"); } public client_authorized(iClient) g_iBlockPlayer[iClient] = 0; public TestFunc(iClient) { if(g_iBlockPlayer[iClient]) { g_iBlockPlayer[iClient] = 0; client_print(iClient, print_chat, "[AMXX] No longer blocking anyones name."); } else { static iTarget, iBody; get_user_aiming(iClient, iTarget, iBody); if(is_user_alive(iTarget)) { g_iBlockPlayer[iClient] = iTarget; ClearStatusValue(iClient); static szName[32]; get_user_name(iTarget, szName, sizeof(szName)-1); client_print(iClient, print_chat, "[AMXX] You are blocking %s's name.", szName); } else client_print(iClient, print_chat, "[Error] Please aim at a player."); } } public event_StatusValue(iClient) { if(g_iBlockPlayer[iClient] > 0 && read_data(2) == g_iBlockPlayer[iClient]) ClearStatusValue(iClient); } public ClearStatusValue(iClient) { static i; for(i=1; i<=3; i++) { message_begin(MSG_ONE_UNRELIABLE, g_hStatusValue, _, iClient); write_byte(i); write_short(0); message_end(); } } Только теперь его надо сделать, не для другово игрока, а для себя... |
|
|
|
STR@TEG |
19.8.2010, 14:31
Сообщение
|
Вот этот плаг рабочий Позже попробую сделать.
say /test Код #include <amxmodx> #define PLUGIN "Status Value Blocking" #define VERSION "2.0" #define AUTHOR "hlstriker" #define MAX_PLAYERS 32 new g_hStatusValue; new g_iBlockPlayer[MAX_PLAYERS+1]; public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR); register_clcmd("say /test", "TestFunc"); g_hStatusValue = get_user_msgid("StatusValue"); register_event("StatusValue", "event_StatusValue", "be", "1=2", "2>0"); } public client_authorized(iClient) g_iBlockPlayer[iClient] = 0; public TestFunc(iClient) { if(g_iBlockPlayer[iClient]) { g_iBlockPlayer[iClient] = 0; client_print(iClient, print_chat, "[AMXX] No longer blocking anyones name."); } else { static iTarget, iBody; get_user_aiming(iClient, iTarget, iBody); if(is_user_alive(iTarget)) { g_iBlockPlayer[iClient] = iTarget; ClearStatusValue(iClient); static szName[32]; get_user_name(iTarget, szName, sizeof(szName)-1); client_print(iClient, print_chat, "[AMXX] You are blocking %s's name.", szName); } else client_print(iClient, print_chat, "[Error] Please aim at a player."); } } public event_StatusValue(iClient) { if(g_iBlockPlayer[iClient] > 0 && read_data(2) == g_iBlockPlayer[iClient]) ClearStatusValue(iClient); } public ClearStatusValue(iClient) { static i; for(i=1; i<=3; i++) { message_begin(MSG_ONE_UNRELIABLE, g_hStatusValue, _, iClient); write_byte(i); write_short(0); message_end(); } } Только теперь его надо сделать, не для другово игрока, а для себя... |
|
|
|
5Kirill5 |
19.8.2010, 21:50
Сообщение
|
Что-нибудь получилось?
|
|
|
|
STR@TEG |
19.8.2010, 22:21
Сообщение
|
Что-нибудь получилось? А я и не пробовал :biggrin: Вот, попробуй: CODE #include <amxmodx>
#define PLUGIN "Status Value Blocking" #define VERSION "2.0" #define AUTHOR "hlstriker" new g_StatusValue new g_BlockPlayer[33] public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR) register_clcmd("say /test", "TestFunc") g_StatusValue = get_user_msgid("StatusValue") register_event("StatusValue", "statusValue", "be", "1=2", "2>0") } public client_authorized(id) { g_BlockPlayer[id] = 0 } public TestFunc(id) { if(g_BlockPlayer[id]) { g_BlockPlayer[id] = 0 client_print(id, print_chat, "[AMXX] No longer blocking anyones name.") } else { static i_Target, i_Body get_user_aiming(id, i_Target, i_Body) if(is_user_alive(i_Target)) { g_BlockPlayer[id] = i_Target ClearStatusValue(id) static szName[33] get_user_name(i_Target, szName, 32) client_print(id, print_chat, "[AMXX] You are blocking %s's name.", szName) } else { client_print(id, print_chat, "[Error] Please aim at a player.") } } } public statusValue(id) { if(g_BlockPlayer[id] > 0 && read_data(2) == g_BlockPlayer[id]) { ClearStatusValue(id) } } public ClearStatusValue(id) { static i for(i = 1; i <= 3; i++) { message_begin(MSG_ONE_UNRELIABLE, g_StatusValue, _, id) write_byte(i) write_short(0) message_end() } } |
|
|
|
5Kirill5 |
19.8.2010, 23:09
Сообщение
|
Всё равно пишет [Error] Please aim at a player.
|
|
|
|
STR@TEG |
19.8.2010, 23:10
Сообщение
|
|
|
5Kirill5 |
19.8.2010, 23:30
Сообщение
|
Я в курсе. Я ж не могу навести прицел сам на себя :biggrin: :biggrin: :biggrin: .
|
|
|
|