Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define FILTERSCRIPT
- /*
- &. Fully controlable Anty high ping by Patryk Skibinski
- */
- #include <a_samp>
- #include <zcmd>
- /*
- &. Our variables and a small something that will make our code look more attractive...
- */
- new a_Ping, m_Ping;
- #if defined FILTERSCRIPT
- public OnFilterScriptInit()
- {
- print("&. W pe³ni kontrolowany Anty high ping stworzony przez Patryk Skibinski");
- SetTimer("Check", 1000, 1);
- return 1;
- }
- #else
- main()
- {
- print("&. W pe³ni kontrolowany Anty high ping stworzony przez Patryk Skibinski");
- }
- #endif
- /*
- &. All of the responses to the dialogs, which we have displayed in our administrator command
- */
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- if(dialogid == 69 && response)
- {
- switch(listitem)
- {
- case 0:
- {
- if(a_Ping == 0)
- {
- a_Ping = 1, m_Ping = 500, SendClientMessage(playerid,-1,"Anty ping zosta³ w³¹czony.");
- }
- else a_Ping = 0, m_Ping = 0, SendClientMessage(playerid,-1,"Anty ping zosta³ wy³¹czony.");
- }
- case 1:
- {
- ShowPlayerDialog(playerid, 666, DIALOG_STYLE_INPUT, "&. Panel Kontroli", "&. Zmieñ maks. ping\n&. Minimum 100", "Ustaw", "Anuluj");
- }
- }
- }
- if(dialogid == 666 && response)
- {
- if(strlen(inputtext) <= 99) return ShowPlayerDialog(playerid, 666, DIALOG_STYLE_INPUT, "&. Panel Kontroli", "&. Zmieñ maks. ping\n&. Minimum 100", "Ustaw", "Anuluj");
- m_Ping = strval(inputtext);
- SendClientMessage(playerid,-1,"Zmieni³eœ wartoœc MAX PING.");
- }
- return 1;
- }
- /*
- &. Commands for the administrator
- */
- CMD:ping(playerid, params[])
- {
- if(IsPlayerAdmin(playerid))
- {
- ShowPlayerDialog(playerid, 69, DIALOG_STYLE_LIST, "&. Panel Kontroli", "&. Uruchom/Wylacz\n&. Zmieñ maks. iloœc ping", "Wybierz", "Anuluj");
- }
- else SendClientMessage(playerid, -1, "&. Nie masz dostêpu.");
- return 1;
- }
- /*
- &. Our public which will check if the player's ping is or isn't too high
- */
- forward Check(playerid);
- public Check(playerid)
- {
- for(new i = 0; i < GetMaxPlayers(); i++)
- {
- if(a_Ping == 1 && GetPlayerPing(i) >= m_Ping)
- {
- Kick(i);
- }
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement