Вот плагин на авто бхоп, он работает у всех. Может кто нибудь переделать его так, чтобы он работал только у игроков с правами kick?
Отправлено 01 Июнь 2018 - 13:45
Вот плагин на авто бхоп, он работает у всех. Может кто нибудь переделать его так, чтобы он работал только у игроков с правами kick?
Отправлено 01 Июнь 2018 - 18:45
#pragma semicolon 1 #include <sourcemod> #include <sdktools> #define MAXCLIENTS 32 new bool:g_bIsAutobhop[MAXCLIENTS + 1]; public Plugin:myinfo = { name = "Auto Bunnyhop", author = "PCI Gaming Team", description = "Allows jump easier.", version = "1.2", url = "http://steamcommunity.com/sharedfiles/filedetails/?id=510955402" } //============================================================ //============================================================ public OnPluginStart() { RegAdminCmd("sm_autobhop", Cmd_Autobhop, ADMFLAG_KICK); } public Action:Cmd_Autobhop(client, args) { if (client > 0) { if (g_bIsAutobhop[client]) { PrintToChat(client, "[SM] Autobhop enabled."); } else { PrintToChat(client, "[SM] Autobhop disabled."); } g_bIsAutobhop[client] = !g_bIsAutobhop[client]; } return Plugin_Handled; } public Action:OnPlayerRunCmd(client, &buttons) { if (!g_bIsAutobhop[client] && IsPlayerAlive(client) && buttons & IN_JUMP) { if (!(GetEntityFlags(client) & FL_ONGROUND) && !(GetEntityMoveType(client) & MOVETYPE_LADDER) && GetEntProp(client, Prop_Send, "m_nWaterLevel") < 2) { buttons &= ~IN_JUMP; } else if (GetEntPropEnt(client, Prop_Send, "m_hGroundEntity") == -1 && GetEntityFlags(client) & FL_ONGROUND) { SetEntityFlags(client, 128); } } return Plugin_Continue; }
Отправлено 02 Июнь 2018 - 14:27
#pragma semicolon 1 #include <sourcemod> #include <sdktools> #define MAXCLIENTS 32 new bool:g_bIsAutobhop[MAXCLIENTS + 1]; public Plugin:myinfo = { name = "Auto Bunnyhop", author = "PCI Gaming Team", description = "Allows jump easier.", version = "1.2", url = "http://steamcommunity.com/sharedfiles/filedetails/?id=510955402" } //============================================================ //============================================================ public OnPluginStart() { RegAdminCmd("sm_autobhop", Cmd_Autobhop, ADMFLAG_KICK); } public Action:Cmd_Autobhop(client, args) { if (client > 0) { if (g_bIsAutobhop[client]) { PrintToChat(client, "[SM] Autobhop enabled."); } else { PrintToChat(client, "[SM] Autobhop disabled."); } g_bIsAutobhop[client] = !g_bIsAutobhop[client]; } return Plugin_Handled; } public Action:OnPlayerRunCmd(client, &buttons) { if (!g_bIsAutobhop[client] && IsPlayerAlive(client) && buttons & IN_JUMP) { if (!(GetEntityFlags(client) & FL_ONGROUND) && !(GetEntityMoveType(client) & MOVETYPE_LADDER) && GetEntProp(client, Prop_Send, "m_nWaterLevel") < 2) { buttons &= ~IN_JUMP; } else if (GetEntPropEnt(client, Prop_Send, "m_hGroundEntity") == -1 && GetEntityFlags(client) & FL_ONGROUND) { SetEntityFlags(client, 128); } } return Plugin_Continue; }Странно, он все равно работает у обычных игроков (наверно автоматически включается при заходе на сервер). Однако, теперь игроки не могут его отключить, т.к. нету флага кик. Можно сделать как нибудь, что бы плагин активировался в ручную?
Сообщение отредактировал pedre228: 02 Июнь 2018 - 14:28
Отправлено 02 Июнь 2018 - 15:09
#pragma semicolon 1 #include <sourcemod> #include <sdktools> #define MAXCLIENTS 32 new bool:g_bIsAutobhop[MAXCLIENTS + 1]; public Plugin:myinfo = { name = "Auto Bunnyhop", author = "PCI Gaming Team", description = "Allows jump easier.", version = "1.2", url = "http://steamcommunity.com/sharedfiles/filedetails/?id=510955402" } //============================================================ //============================================================ public OnPluginStart() { RegAdminCmd("sm_autobhop", Cmd_Autobhop, ADMFLAG_KICK); } public Action:Cmd_Autobhop(client, args) { if (client > 0) { if (g_bIsAutobhop[client]) { PrintToChat(client, "[SM] Autobhop enabled."); } else { PrintToChat(client, "[SM] Autobhop disabled."); } g_bIsAutobhop[client] = !g_bIsAutobhop[client]; } return Plugin_Handled; } public Action:OnPlayerRunCmd(client, &buttons) { if (!g_bIsAutobhop[client] && IsPlayerAlive(client) && buttons & IN_JUMP) { if (!(GetEntityFlags(client) & FL_ONGROUND) && !(GetEntityMoveType(client) & MOVETYPE_LADDER) && GetEntProp(client, Prop_Send, "m_nWaterLevel") < 2) { buttons &= ~IN_JUMP; } else if (GetEntPropEnt(client, Prop_Send, "m_hGroundEntity") == -1 && GetEntityFlags(client) & FL_ONGROUND) { SetEntityFlags(client, 128); } } return Plugin_Continue; }Странно, он все равно работает у обычных игроков (наверно автоматически включается при заходе на сервер). Однако, теперь игроки не могут его отключить, т.к. нету флага кик. Можно сделать как нибудь, что бы плагин активировался в ручную?
#pragma semicolon 1 #include <sourcemod> #include <sdktools> #define MAXCLIENTS 32 bool g_bIsAutobhop[MAXCLIENTS + 1]; public Plugin myinfo = { name = "Auto Bunnyhop", author = "PCI Gaming Team", description = "Allows jump easier.", version = "1.2", url = "http://steamcommunity.com/sharedfiles/filedetails/?id=510955402" } public OnPluginStart() { RegAdminCmd("sm_autobhop", Cmd_Autobhop, ADMFLAG_KICK); } public Action Cmd_Autobhop(int client, int args) { if (client > 0) { if (g_bIsAutobhop[client]) { PrintToChat(client, "[SM] Autobhop enabled."); } else { PrintToChat(client, "[SM] Autobhop disabled."); } g_bIsAutobhop[client] = !g_bIsAutobhop[client]; } return Plugin_Handled; } public Action OnPlayerRunCmd(int client, int &buttons, int &impulse, float vel[3], float angles[3], int &weapon, int &subtype, int &cmdnum, int &tickcount, int &seed, int mouse[2]) { AdminId AId = GetUserAdmin(client); int flags = GetAdminFlags(AId, Access_Effective); if (flags & ADMFLAG_KICK) { if (!g_bIsAutobhop[client] && IsPlayerAlive(client) && buttons & IN_JUMP) { if (!(GetEntityFlags(client) & FL_ONGROUND) && !(GetEntityMoveType(client) & MOVETYPE_LADDER) && GetEntProp(client, Prop_Send, "m_nWaterLevel") < 2) { buttons &= ~IN_JUMP; } else if (GetEntPropEnt(client, Prop_Send, "m_hGroundEntity") == -1 && GetEntityFlags(client) & FL_ONGROUND) { SetEntityFlags(client, 128); } } } return Plugin_Continue; }
Отправлено 02 Июнь 2018 - 15:25
Ты указал именно на этот флаг. если у админа пару флагов этот и другой. работать не будет.
лучше тогда так if(GetUserFlagBits(client) & ADMFLAG_KICK)
Отправлено 02 Июнь 2018 - 20:37
Ты указал именно на этот флаг. если у админа пару флагов этот и другой. работать не будет.
лучше тогда так if(GetUserFlagBits(client) & ADMFLAG_KICK)
Наверное, Вы меня не правильно поняли. Плагин работает у всех, даже у кого нет флага кик,
Отправлено 03 Июнь 2018 - 14:56
Наверное, Вы меня не правильно поняли. Плагин работает у всех, даже у кого нет флага кик,
Тебе же Лекс выше кинул версию в чем дело?
Отправлено 03 Июнь 2018 - 15:07
Тебе же Лекс выше кинул версию в чем дело?
Этот плагин не работает
Отправлено 03 Июнь 2018 - 15:33
Этот плагин не работает
#include <sourcemod> #include <sdktools> #define MAXCLIENTS 32 new bool:g_bIsAutobhop[MAXCLIENTS + 1]; public Plugin:myinfo = { name = "Auto Bunnyhop", author = "PCI Gaming Team", description = "Allows jump easier.", version = "1.2", url = "http://steamcommunity.com/sharedfiles/filedetails/?id=510955402" } //============================================================ //============================================================ public OnPluginStart() { RegAdminCmd("sm_autobhop", Cmd_Autobhop, ADMFLAG_KICK); } public Action:Cmd_Autobhop(client, args) { if (client > 0) { if (g_bIsAutobhop[client]) { PrintToChat(client, "[SM] Autobhop enabled."); } else { PrintToChat(client, "[SM] Autobhop disabled."); } g_bIsAutobhop[client] = !g_bIsAutobhop[client]; } return Plugin_Handled; } public Action:OnPlayerRunCmd(client, &buttons) { if ((GetUserFlagBits(client) & ADMFLAG_KICK) && !g_bIsAutobhop[client] && IsPlayerAlive(client) && buttons & IN_JUMP) { if (!(GetEntityFlags(client) & FL_ONGROUND) && !(GetEntityMoveType(client) & MOVETYPE_LADDER) && GetEntProp(client, Prop_Send, "m_nWaterLevel") < 2) { buttons &= ~IN_JUMP; } else if (GetEntPropEnt(client, Prop_Send, "m_hGroundEntity") == -1 && GetEntityFlags(client) & FL_ONGROUND) { SetEntityFlags(client, 128); } } return Plugin_Continue; }
Отправлено 03 Июнь 2018 - 18:48
#include <sourcemod> #include <sdktools> #define MAXCLIENTS 32 new bool:g_bIsAutobhop[MAXCLIENTS + 1]; public Plugin:myinfo = { name = "Auto Bunnyhop", author = "PCI Gaming Team", description = "Allows jump easier.", version = "1.2", url = "http://steamcommunity.com/sharedfiles/filedetails/?id=510955402" } //============================================================ //============================================================ public OnPluginStart() { RegAdminCmd("sm_autobhop", Cmd_Autobhop, ADMFLAG_KICK); } public Action:Cmd_Autobhop(client, args) { if (client > 0) { if (g_bIsAutobhop[client]) { PrintToChat(client, "[SM] Autobhop enabled."); } else { PrintToChat(client, "[SM] Autobhop disabled."); } g_bIsAutobhop[client] = !g_bIsAutobhop[client]; } return Plugin_Handled; } public Action:OnPlayerRunCmd(client, &buttons) { if ((GetUserFlagBits(client) & ADMFLAG_KICK) && !g_bIsAutobhop[client] && IsPlayerAlive(client) && buttons & IN_JUMP) { if (!(GetEntityFlags(client) & FL_ONGROUND) && !(GetEntityMoveType(client) & MOVETYPE_LADDER) && GetEntProp(client, Prop_Send, "m_nWaterLevel") < 2) { buttons &= ~IN_JUMP; } else if (GetEntPropEnt(client, Prop_Send, "m_hGroundEntity") == -1 && GetEntityFlags(client) & FL_ONGROUND) { SetEntityFlags(client, 128); } } return Plugin_Continue; }Спасибо!
Отправлено 03 Июнь 2018 - 19:29
Отправлено 03 Июнь 2018 - 20:50
Работает как надо?
Да, все хорошо
0 пользователей, 0 гостей, 0 анонимных